|
|
@@ -198,6 +198,7 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
* @return void
|
|
|
*/
|
|
|
private void handleIntelligent(BusDeviceRunningEntity device, DeviceOperator deviceOperator, List<Supplier<?>> cacheOperation) {
|
|
|
+
|
|
|
//开机数据不进行加减档判定
|
|
|
if (!DeviceStatusEnum.StartUp.equals(device.getRunState())) {
|
|
|
if(DeviceTypeEnum.intelligent.equals(device.getType())
|
|
|
@@ -205,8 +206,10 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
&& Boolean.FALSE.equals(device.isNewInfusion())){
|
|
|
BigDecimal lastContinueDose = deviceOperator.getContinueDose();
|
|
|
if(lastContinueDose==null){
|
|
|
- device.setWarnFlow(null);
|
|
|
- log.warn("设备【{}】流速在缓存中不存在",device.getContinueDose());
|
|
|
+ device.setWarnFlow(FlowStatusEnum.None);
|
|
|
+ if(log.isDebugEnabled()){
|
|
|
+ log.warn("设备【{}】流速在缓存中不存在",device.getContinueDose());
|
|
|
+ }
|
|
|
}else {
|
|
|
if(CompareUtil.compare(device.getContinueDose(),lastContinueDose)>0){
|
|
|
log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,加档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
|
|
|
@@ -215,14 +218,14 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,减档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
|
|
|
device.setWarnFlow(FlowStatusEnum.Down);
|
|
|
}else {
|
|
|
- device.setWarnFlow(null);
|
|
|
+ device.setWarnFlow(FlowStatusEnum.None);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cacheOperation.add(()->{
|
|
|
deviceOperator.setContinueDose(device.getContinueDose());
|
|
|
if(FlowStatusEnum.Down.equals(device.getWarnFlow())
|
|
|
- ||(device.isNewInfusion()&&!FlowStatusEnum.Limited.equals(device.getWarnFlow()))){
|
|
|
+ ||(device.isNewInfusion()&&FlowStatusEnum.Limited.equals(device.getWarnFlow()))){
|
|
|
//减档或者非加档受限的新输注
|
|
|
deviceOperator.setFlowLimit(false);
|
|
|
}
|
|
|
@@ -232,19 +235,14 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
cacheOperation.add(()->{
|
|
|
//开机包不进行计算
|
|
|
deviceOperator.setContinueDose(null);
|
|
|
+ deviceOperator.setFlowLimit(false);
|
|
|
return null;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void init(BusDeviceRunningEntity device,DeviceOperator deviceOperator ) {
|
|
|
- //开机数据不做加档受限判断
|
|
|
- if(!DeviceStatusEnum.StartUp.equals(device.getRunState())
|
|
|
- &&ObjectUtil.equal(DeviceTypeEnum.intelligent,device.getType())){
|
|
|
- if (deviceOperator.isFlowLimit()) {
|
|
|
- device.setWarnFlow(FlowStatusEnum.Limited);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
// if(device.getWarnFlow()!=null&&FlowStatusEnum.None.equals(device.getWarnFlow())){
|
|
|
// device.setWarnFlow(null);
|
|
|
// }
|