Преглед на файлове

fix 低电量报警改为电量耗尽

18339543638 преди 3 години
родител
ревизия
36f98371ba

+ 6 - 4
nb-service/web-service/src/main/java/com/nb/web/service/bus/listener/DeviceInfoListener.java

@@ -221,7 +221,9 @@ public class DeviceInfoListener implements IIotMsgHandler {
             }
             cacheOperation.add(()->{
                 deviceOperator.setContinueDose(device.getContinueDose());
-                if(FlowStatusEnum.Down.equals(device.getWarnFlow())){
+                if(FlowStatusEnum.Down.equals(device.getWarnFlow())
+                ||(device.isNewInfusion()&&!FlowStatusEnum.Limited.equals(device.getWarnFlow()))){
+                    //减档或者非加档受限的新输注
                     deviceOperator.setFlowLimit(false);
                 }
                 return null;
@@ -243,9 +245,9 @@ public class DeviceInfoListener implements IIotMsgHandler {
                 device.setWarnFlow(FlowStatusEnum.Limited);
             }
         }
-        if(device.getWarnFlow()!=null&&FlowStatusEnum.None.equals(device.getWarnFlow())){
-            device.setWarnFlow(null);
-        }
+//        if(device.getWarnFlow()!=null&&FlowStatusEnum.None.equals(device.getWarnFlow())){
+//            device.setWarnFlow(null);
+//        }
         if(device.getWarnFlow()!=null&&FlowStatusEnum.Limited.equals(device.getWarnFlow())){
             //加档受限,进行标识
             device.setFlowRestricted(true);

+ 4 - 1
nb-service/web-service/src/main/java/com/nb/web/service/log/config/LogEventListenerConfig.java

@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
 public class LogEventListenerConfig {
     private ISysLogService sysLogService;
     private LocalSysRunningLogService sysRunningLogService;
+    @Autowired(required = false)
     private EnterpriseWeChatNotify weChatNotify;
 
     @Autowired
@@ -51,7 +52,9 @@ public class LogEventListenerConfig {
         if(Level.ERROR.levelStr.equals(log.getLevel())){
             SysRunningLog sysLog = BeanUtil.copyProperties(log, SysRunningLog.class);
             sysRunningLogService.save(sysLog);
-            weChatNotify.send(ErrorMsg.of(log.getExceptionStack()));
+            if(weChatNotify!=null){
+                weChatNotify.send(ErrorMsg.of(log.getExceptionStack()));
+            }
         }
     }
 }