qiangxuan hai 6 meses
pai
achega
7c7026041e

+ 7 - 3
zgztBus/jeecg-module-lesm/src/main/java/org/jeecg/modules/events/service/impl/LeanEventsHostServiceImpl.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.events.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.deviceLesm.entity.DeviceInformation;
 import org.jeecg.modules.deviceLesm.mapper.DeviceInformationMapper;
@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
  * @Version: V1.0
  */
 @Service
+@Slf4j
 public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper, LeanEventsHost> implements ILeanEventsHostService {
 
     @Resource
@@ -66,6 +68,7 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
                 leanEventsHostConfigService.saveBatch(leanEventsHostConfigList);
             }
         }
+        log.info("{}", "编辑精益事件设备启停配置表更新设备ID缓存");
         updateEviceInformationCache();
     }
 
@@ -97,20 +100,19 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
             }
 
         });
-
         leanEventsHosts.forEach(x ->{
             LeanEventsHostResult leanEventsHostResult = new LeanEventsHostResult();
             BeanUtils.copyProperties(x, leanEventsHostResult);
             leanEventsHostResultList.add(leanEventsHostResult);
         });
-        if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList)){
+        if (oConvertUtils.listIsEmpty(leanEventsHostResultList)){
             return leanEventsHostResultList;
         }
 
         List<LeanEventsHostResult> leanEventsHostResultList1 = leanEventsHostResultList.stream()
                 .filter(s -> oConvertUtils.isNotEmpty(s.getDeviceInformationList()))
                 .collect(Collectors.toList());
-        if (!oConvertUtils.listIsNotEmpty(leanEventsHostResultList1)){
+        if (oConvertUtils.listIsEmpty(leanEventsHostResultList1)){
             return leanEventsHostResultList;
         }
         List<String> list =leanEventsHostResultList1.stream().map(LeanEventsHostResult::getDeviceInformationList).collect(Collectors.toList());
@@ -149,6 +151,8 @@ public class LeanEventsHostServiceImpl extends ServiceImpl<LeanEventsHostMapper,
                 allSubDeviceInformationList.addAll(Arrays.asList(x.split(",")));
             });
             List<String> cacheSubDeviceInformationList = allSubDeviceInformationList.stream().distinct().collect(Collectors.toList());
+            log.info("{}{}", "更新主设备ID集合keyMainString:", mainDeviceInformationIds);
+            log.info("{}{}", "更新辅设备ID集合keySubString:", cacheSubDeviceInformationList);
             redisTemplate.opsForValue().set(keyMainString, mainDeviceInformationIds);
             redisTemplate.opsForValue().set(keySubString, cacheSubDeviceInformationList);
         }

+ 3 - 1
zgztBus/jeecg-module-lesm/src/main/java/org/jeecg/modules/fpgLeanModel/service/impl/FpgLeanModelServiceImpl.java

@@ -87,6 +87,7 @@ public class FpgLeanModelServiceImpl extends ServiceImpl<FpgLeanModelMapper, Fpg
         // 执行查询
         List<DeviceStatiscsModelMongodb> fpgStatiscsModelDataList = mongoTemplate.find(query, DeviceStatiscsModelMongodb.class, "total_startstop");
         if (oConvertUtils.listIsEmpty(fpgStatiscsModelDataList)){
+            log.info("{}{}", "total_startstop峰平谷大屏查询设备模型历史记录-为空", query);
             return leanModelDeviceHistoryInfoIPage;
         }
 
@@ -130,7 +131,8 @@ public class FpgLeanModelServiceImpl extends ServiceImpl<FpgLeanModelMapper, Fpg
         // 执行查询
         List<DeviceStatiscsModelMongodb> deviceStatiscsModelMongodbList = mongoTemplate.find(query, DeviceStatiscsModelMongodb.class, "leanmodel_run_realtime");
         if (oConvertUtils.listIsEmpty(deviceStatiscsModelMongodbList)){
-            return null;
+            log.info("{}{}", "leanmodel_run_realtime峰平谷大屏通过设备id查询实时功率和电流为空", deviceInformationId);
+            return new ArrayList<>();
         }
         return deviceStatiscsModelMongodbList;
     }