From fe82f1f9a9be911d1420fe3b018ea85dd5fff1a3 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 21 十一月 2024 21:22:58 +0800
Subject: [PATCH] 代码整理

---
 collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java b/collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java
index f72c9b3..771affd 100644
--- a/collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java
+++ b/collect/src/main/java/com/qianwen/mdc/collect/runner/InitRunner.java
@@ -1,6 +1,8 @@
 package com.qianwen.mdc.collect.runner;
 
 import java.time.LocalDate;
+import java.util.Arrays;
+import java.util.List;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -15,7 +17,6 @@
 import com.qianwen.mdc.collect.dto.CacheBuildDTO;
 import com.qianwen.mdc.collect.mapper.iotdb.DeviceStateMapper;
 import com.qianwen.mdc.collect.service.DeviceStateFixPointService;
-
 import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateTime;
 
@@ -29,9 +30,14 @@
     private TimeSliceCache timeSliceCache;
     @Autowired
     private DeviceStateMapper deviceStateMapper;
-
+    //@Autowired
+    //private WorkstationAppMappingService mappingService;;
+    
     @Override
     public void run(ApplicationArguments args) throws Exception {
+    	
+    	//mappingService.saveToCache();
+    	
     	//鐢熸垚鏃堕棿鍒囩墖
         CacheBuildDTO cacheBuildDTO = CacheBuildDTO.builder().tenantIds(Sets.newHashSet(new String[]{"000000"})).targetDate(LocalDate.now()).build();
         timeSliceCache.build(cacheBuildDTO);
@@ -42,18 +48,20 @@
     //@RedisLock("posting:lock:initStateFixPoint")
     public void checkNeedStateFixPoint() {
         DateTime dateTime = DateTime.now();
-        log.info("杩涘叆绋嬪簭鍚姩鏍¢獙鏄惁瀛樺湪宸ヤ綅鎵撹繃鍥哄畾鐐�....... ");
+        log.info("绋嬪簭鍚姩鏍¢獙鏄惁瀛樺湪宸ヤ綅鎵撹繃鍥哄畾鐐�....... ");
        
-        long count = deviceStateMapper.fixPointCountByDate(Integer.valueOf(DatePattern.PURE_DATE_FORMAT.format(dateTime)));
+        Long count = deviceStateMapper.fixPointCountByDate(Integer.valueOf(DatePattern.PURE_DATE_FORMAT.format(dateTime)));
         /*
         Long result = this.workstationStateMapper.selectCount(Wrappers.<WorkstationState>lambdaQuery()
                 .eq(WorkstationState::getFactoryDate, Integer.valueOf(DatePattern.PURE_DATE_FORMAT.format(dateTime)))
                 .eq(WorkstationState::getIsFixPoint, Boolean.TRUE));
                 */
         //Long result = 1L;
-        if (count <= 0) {
+        if(count == null || count == 0) {
+        //if (count <= 0) {
             log.info("璁惧鏈墦杩囬敋鐐�,鍚姩鏃舵墦鐐�....... ");
             //this.workStationStateFixPointService.workStationStateFixPoint(dateTime, null);
+            //List<String> wids = Arrays.asList("1656819188967653378");
             stateFixPointService.deviceStateFixPoint(dateTime, null);
         }else {
         	log.info("璁惧宸插瓨鍦ㄩ敋鐐�");

--
Gitblit v1.9.3