Jelajahi Sumber

add 添加智能泵 脉冲泵字段

18339543638 3 tahun lalu
induk
melakukan
031297eb3c

+ 4 - 4
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceHistoryEntity.java

@@ -173,13 +173,13 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
         history.setContinueQuantity(pump.getContinueDose());
         history.setSelfControlLockTime(pump.getSelfControlLockTime());
         history.setInputQuantity(pump.getInputDose());
-        history.setValidTime(pump.getValidTime());
-        history.setInvalidTime(pump.getInvalidTime());
+        history.setValidTime(pump.getPcaValidCount());
+        history.setInvalidTime(pump.getPcaInvalidCount());
         history.setMaxQuantity(pump.getMaxDose());
         history.setFirstQuantity(pump.getFirstDose());
-        history.setSingleQuantity(pump.getSingleDose());
+        history.setSingleQuantity(pump.getAppendDose());
         history.setTotalQuantity(pump.getTotalDose());
-        history.setTotalCount(pump.getTotalCount());
+        history.setTotalCount(pump.getPcaTotalCount());
         history.setRunState(pump.getRunState());
         history.setStartTime(pump.getStartTime());
         history.setMonitorType(pump.getMonitorType());

+ 87 - 22
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceRunningEntity.java

@@ -19,6 +19,10 @@ import lombok.ToString;
 import lombok.experimental.Accessors;
 import org.apache.ibatis.type.EnumOrdinalTypeHandler;
 
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -60,47 +64,108 @@ public class BusDeviceRunningEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "床号")
     private String bedNo;
     /***************临床固定数据*****************/
-    @ApiModelProperty(value = "别名")
+    @ApiModelProperty(value = "设备别名")
     private String alias;
 
-    @ApiModelProperty(value = "剩余量",readOnly = true)
-    private BigDecimal remainDose;
+    @ApiModelProperty(value = "总量",readOnly = true)
+    @Max(value = 999,message = "总量最大值不得超过999")
+    @Min(value = 0,message ="总量最小值不得超过0" )
+    private Integer totalDose;
 
-    @ApiModelProperty(value = "持续量",readOnly = true)
-    private BigDecimal continueDose;
+    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+    @Max(value = 50,message = "首次量最大值不得超过50")
+    @Min(value = 0,message ="首次量最小值不得超过0" )
+    private Integer firstDose;
 
-    @ApiModelProperty(value = "自控锁时",readOnly = true)
-    private BigDecimal selfControlLockTime;
 
-    @ApiModelProperty(value = "已输入量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+    private BigDecimal remainDose;
+
+    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
     private BigDecimal inputDose;
 
-    @ApiModelProperty(value = "有效次数",readOnly = true)
-    private Integer validTime;
+    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
+    private BigDecimal appendDose;
 
-    @ApiModelProperty(value = "无效次数",readOnly = true)
-    private Integer invalidTime;
+    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
+    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
+    private BigDecimal appendLockTime;
 
-    @ApiModelProperty(value = "极限量",readOnly = true)
+    @ApiModelProperty(value = "公共参数-极限量",readOnly = true)
+    @DecimalMax(value = "90",message = "PCA追加量最大值不得超过90")
+    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
     private BigDecimal maxDose;
 
-    @ApiModelProperty(value = "首次量",readOnly = true)
-    private Integer firstDose;
+    @ApiModelProperty(value = "公共参数-自控锁时",readOnly = true)
+    private BigDecimal selfControlLockTime;
 
-    @ApiModelProperty(value = "追加量",readOnly = true)
-    private BigDecimal singleDose;
+    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+    private Integer pcaValidCount;
 
-    @ApiModelProperty(value = "总量",readOnly = true)
-    private Integer totalDose;
+    @ApiModelProperty(value = "公共参数-pca无效次数",readOnly = true)
+    private Integer pcaInvalidCount;
+
+    @ApiModelProperty(value = "公共参数-pca总按次数",readOnly = true)
+    private Integer pcaTotalCount;
+
+    @ApiModelProperty(value = "持续泵参数-持续量",readOnly = true)
+    @DecimalMax(value = "50",message = "持续给液量最大值不得超过50")
+    @DecimalMin(value = "0",message ="持续给液量最小值不得超过0" )
+    private BigDecimal continueDose;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲量",readOnly = true)
+    @Max(value = 20,message = "脉冲量最大值不得超过20")
+    @Min(value = 0,message ="脉冲量最小值不得超过0" )
+    private Integer pulseDose;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲锁时",readOnly = true)
+    @Max(value = 90,message = "脉冲锁时最大值不得超过90")
+    @Min(value = 30,message ="脉冲锁时最小值不得超过30" )
+    private Integer pulseLockTime;
+
+    @ApiModelProperty(value = "脉冲泵参数-脉冲首次锁时",readOnly = true)
+    @Max(value = 60,message = "脉冲首次锁时最大值不得超过60")
+    @Min(value = 0,message ="脉冲首次锁时最小值不得超过0" )
+    private Integer pulseFirstLockTime;
+
+    @ApiModelProperty(value = "智能泵参数-加档周期",readOnly = true)
+    @DecimalMax(value = "10",message = "加档周期最大值不得超过10")
+    @DecimalMin(value = "0.5",message ="加档周期最小值不得超过0.5" )
+    private BigDecimal flowUpCycle;
+
+    @ApiModelProperty(value = "智能泵参数-减档周期",readOnly = true)
+    @DecimalMax(value = "10",message = "减档周期最大值不得超过10")
+    @DecimalMin(value = "0.5",message ="减档周期最小值不得超过0.5" )
+    private BigDecimal flowDownCycle;
+
+    @ApiModelProperty(value = "智能泵参数-计次",readOnly = true)
+    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过1" )
+    private BigDecimal flowCount;
+
+    @ApiModelProperty(value = "智能泵参数-上限",readOnly = true)
+    @DecimalMax(value = "50",message = "智能泵上限值最大值不得超过90")
+    @DecimalMin(value = "1",message ="智能泵上限值最小值不得超过0" )
+    private BigDecimal flowUpLimit;
+
+    @ApiModelProperty(value = "智能泵参数-下限",readOnly = true)
+    @DecimalMax(value = "50",message = "智能泵下限值最大值不得超过50")
+    @DecimalMin(value = "0.1",message ="智能泵下限值最小值不得超过0.1" )
+    private BigDecimal flowDownLimit;
+
+    @ApiModelProperty(value = "智能泵参数-自调比例",readOnly = true)
+    @DecimalMax(value = "95",message = "自调比例不得超过95")
+    @DecimalMin(value = "0",message ="自调比例最小值不得超过0" )
+    private BigDecimal flowAdjustRate;
 
-    @ApiModelProperty(value = "总按次数",readOnly = true)
-    private Integer totalCount;
 
     @ApiModelProperty(value = "泵运行状态",readOnly = true)
     @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
     private DeviceStatusEnum runState;
 
-
     @ApiModelProperty(value = "报警信息",readOnly = true)
     @TableField(typeHandler = EnumOrdinalTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
     private DeviceAlarmEnum alarm;

+ 31 - 15
coffee-system/src/main/java/com/coffee/bus/websocket/listener/DeviceInfoListener.java

@@ -255,7 +255,8 @@ public class DeviceInfoListener {
         if(!StrUtil.isNullOrUndefined(bindDeviceId)&&!deviceId.equals(bindDeviceId)){
             //泵号发生改变,获取病号绑定的泵信息,判断绑定的泵开始时间,将开始时间稍后的泵设置为主泵
             DeviceOperator<DeviceCacheInfo> patientCurrentBindDevice = deviceRegistry.getDevice(bindDeviceId);
-            if (patientCurrentBindDevice.getStartTime().before(device.getStartTime())) {
+            Date startTime = patientCurrentBindDevice.getStartTime();
+            if (startTime==null||startTime.before(device.getStartTime())) {
                 log.error("病号:[{}],之前主泵为:[{}],现在主泵为:[{}]",device.getPatientCode(),bindDeviceId,deviceId);
                 //设置当前上传信息的泵为主泵,将旧泵设置为副泵,并更新病人绑定泵的消息 todo 更新缓存信息
                 device.setMaster(1);
@@ -301,14 +302,14 @@ public class DeviceInfoListener {
 
 
     public static boolean s=false;
-        @Scheduled(cron = "0/15 * * * * ?")
+    @Scheduled(cron = "0/15 * * * * ?")
     public void send() throws InterruptedException {
 //        List<BusDeviceRunningEntity> list = deviceUsingService.list();
 //        list.forEach(pump->{
-            if(s){
-                return;
-            }
-            s=true;
+        if(s){
+            return;
+        }
+        s=true;
         BusDeviceRunningEntity pump = new BusDeviceRunningEntity();
         pump.setClassification("-1");
         pump.setDeviceId("123");
@@ -316,9 +317,9 @@ public class DeviceInfoListener {
         pump.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump.setSelfControlLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-        pump.setValidTime(RandomUtil.randomInt(100));
-        pump.setInvalidTime(RandomUtil.randomInt(100));
-        pump.setTotalCount(RandomUtil.randomInt(100));
+        pump.setPcaValidCount(RandomUtil.randomInt(100));
+        pump.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump.setPcaTotalCount(RandomUtil.randomInt(100));
         SpringUtil.publishEvent(new DeviceInfoEvent(this,pump,pump.getDeviceId()));
 
         Thread.sleep(5000);
@@ -330,9 +331,9 @@ public class DeviceInfoListener {
         pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump1.setSelfControlLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-        pump1.setValidTime(RandomUtil.randomInt(100));
-        pump1.setInvalidTime(RandomUtil.randomInt(100));
-        pump1.setTotalCount(RandomUtil.randomInt(100));
+        pump1.setPcaValidCount(RandomUtil.randomInt(100));
+        pump1.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump1.setPcaTotalCount(RandomUtil.randomInt(100));
         SpringUtil.publishEvent(new DeviceInfoEvent(this,pump1,pump1.getDeviceId()));
 
         Thread.sleep(5000);
@@ -344,10 +345,25 @@ public class DeviceInfoListener {
         pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
         pump2.setSelfControlLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-        pump2.setValidTime(RandomUtil.randomInt(100));
-        pump2.setInvalidTime(RandomUtil.randomInt(100));
-        pump2.setTotalCount(RandomUtil.randomInt(100));
+        pump2.setPcaValidCount(RandomUtil.randomInt(100));
+        pump2.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump2.setPcaTotalCount(RandomUtil.randomInt(100));
         SpringUtil.publishEvent(new DeviceInfoEvent(this,pump2,pump2.getDeviceId()));
+
+
+        Thread.sleep(5000);
+
+        BusDeviceRunningEntity pump3 = new BusDeviceRunningEntity();
+        pump3.setDeviceId("456");
+        pump3.setClassification("-1");
+        pump3.setPatientCode("456");
+        pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setSelfControlLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setPcaValidCount(RandomUtil.randomInt(100));
+        pump3.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump3.setPcaTotalCount(RandomUtil.randomInt(100));
+        SpringUtil.publishEvent(new DeviceInfoEvent(this,pump3,pump3.getDeviceId()));
 //        });
     }
 }