yangys
2024-09-02 f4c55bef9c60013eea760d2aad47d1d2201dd2fe
启动代码美化
已修改1个文件
16 ■■■■ 文件已修改
collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java
@@ -5,14 +5,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/*
import com.qianwen.core.redis.lock.RedisLock;
import com.qianwen.posting.cache.TimeSliceCache;
import com.qianwen.posting.dto.CacheBuildDTO;
import com.qianwen.posting.entity.tdengine.WorkstationState;
import com.qianwen.posting.mapper.tdengine.WorkstationStateMapper;
import com.qianwen.posting.service.IWorkstationStateFixPointService;
*/
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
@@ -37,14 +30,13 @@
    @Autowired
    private DeviceStateMapper deviceStateMapper;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        //生成时间切片
        CacheBuildDTO cacheBuildDTO = CacheBuildDTO.builder().tenantIds(Sets.newHashSet(new String[]{"000000"})).targetDate(LocalDate.now()).build();
        timeSliceCache.build(cacheBuildDTO);
        
        checkNeedStateFixPoint();
    }
    //@RedisLock("posting:lock:initStateFixPoint")
@@ -60,11 +52,11 @@
                */
        //Long result = 1L;
        if (count <= 0) {
            log.info("工位未打过固定点,启动时打点....... ");
            log.info("设备未打过锚点,启动时打点....... ");
            //this.workStationStateFixPointService.workStationStateFixPoint(dateTime, null);
            stateFixPointService.deviceStateFixPoint(dateTime, null);
        }else {
            log.info("工位已存在固定点");
            log.info("设备已存在锚点");
        }
    }
}