yangys
2024-05-30 a3686cfa49bf53fb91a2ceb960cf15b3ebdac641
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.qianwen.smartman.modules.mdc.service.impl;
 
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.qianwen.smartman.common.cache.cps.WorkstationCache;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.cps.dto.WorkstationDTO;
import com.qianwen.smartman.modules.mdc.service.ICollectDataService;
import com.qianwen.smartman.modules.mdc.service.ISuperNewCollectService;
import org.springframework.stereotype.Service;
 
/**
 * super_collect_data_json表入库
 */
@Service
public class CollectDataServiceImpl implements ICollectDataService {
    private static final Logger log = LoggerFactory.getLogger(CollectDataServiceImpl.class);
    private final ISuperNewCollectService collectService;
 
    public CollectDataServiceImpl(final ISuperNewCollectService collectService) {
        this.collectService = collectService;
    }
 
    @Override
    public void cacheNowCollectData() {
        Map<String, WorkstationDTO> workstationMap = WorkstationCache.getWorkstations();
        if (Func.isEmpty(workstationMap)) {
            log.info("没有获取到工位信息");
            return;
        }
        Set<String> workstationIds = workstationMap.keySet();
        this.collectService.insertData(workstationIds);
    }
}