Explorar el Código

add 智能泵加档、减档校验

A17404李放 hace 3 años
padre
commit
f443d3eb33

+ 4 - 3
nb-system/src/main/java/com/nb/bus/hospital/config/HospitalFunctionAnalConfigHandler.java

@@ -110,7 +110,8 @@ public class HospitalFunctionAnalConfigHandler extends AbstractHospitalConfigHan
 
         Long startTime=endTime-TimeUnit.MINUTES.toMillis(insufficientTime);
         long now = System.currentTimeMillis();
-        long delStartTime =now - TimeUnit.DAYS.toMillis(7);
+        long delStartTime =DateUtil.parse("2022/01/01").getTime();
+        long delEndTime =now - TimeUnit.DAYS.toMillis(7);
         //获取该次输注过程中,以当前输注上传时间为结束时间,以判定时间区间为区间范围的时间窗口数据
         Collection<Object> valueRange = redissonUtil.getValueRange(analSortKey, startTime, true, endTime, true);
         if(CollUtil.isEmpty(valueRange)){
@@ -159,9 +160,9 @@ public class HospitalFunctionAnalConfigHandler extends AbstractHospitalConfigHan
             log.debug("消息【{}】,镇痛不足缓存解析失败,设备号【{}】",source.getMsgId(),source.getDeviceId(), ExceptionUtil.getExceptionMsg(e));
         }
 
-        int delCount = redissonUtil.removeRangeScore(analSortKey, delStartTime, true, startTime, false);
+        int delCount = redissonUtil.removeRangeScore(analSortKey, delStartTime, true, delEndTime, false);
         if(delCount!=0){
-            log.info("消息【{}】,设备【{}】清除了【{}】-【{}】时间段内【{}】条PCA缓存数据",source.getMsgId(),source.getDeviceId(),new Date(delStartTime),new Date(now),delCount);
+            log.info("消息【{}】,设备【{}】清除了【{}】-【{}】时间段内【{}】条PCA缓存数据",source.getMsgId(),source.getDeviceId(),new Date(delStartTime),new Date(delEndTime),delCount);
         }
     }
 

+ 6 - 7
nb-system/src/main/java/com/nb/bus/websocket/listener/DeviceInfoListener.java

@@ -201,21 +201,20 @@ public class DeviceInfoListener {
                 log.warn("设备【{}】流速在缓存中不存在",device.getContinueDose());
             }else {
                 if(CompareUtil.compare(device.getContinueDose(),lastContinueDose)>0){
-                    log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,加档",device.getMsgId(),device.getContinueDose(),lastContinueDose,device.getDeviceId());
+                    log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,加档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
                     device.setWarnFlow(FlowStatusEnum.Up);
                 }else if(CompareUtil.compare(device.getContinueDose(),lastContinueDose)<0){
-                    log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,减档",device.getMsgId(),device.getContinueDose(),lastContinueDose,device.getDeviceId());
+                    log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,减档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
                     device.setWarnFlow(FlowStatusEnum.Down);
                 }else {
                     device.setWarnFlow(null);
                 }
             }
-            cacheOperation.add(()->{
-                deviceOperator.setContinueDose(device.getContinueDose());
-                return null;
-            });
-
         }
+        cacheOperation.add(()->{
+            deviceOperator.setContinueDose(device.getContinueDose());
+            return null;
+        });
 
     }