Parcourir la source

add 增加公共设备参数 CommonDeviceParam

18339543638 il y a 3 ans
Parent
commit
b5bb303e76

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

@@ -3,6 +3,7 @@ package com.coffee.bus.entity;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.bus.entity.common.CommonDeviceParam;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.coffee.bus.enums.DeviceStatusEnum;
@@ -33,11 +34,11 @@ import java.util.Date;
 @Accessors(chain = true)
 @TableName(value = "bus_device_history",autoResultMap = true)
 @ApiModel(value="设备历史运行数据", description="设备历史运行数据记录")
-public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
+public class BusDeviceHistoryEntity extends CommonDeviceParam<String,String> {
 
-    @ApiModelProperty(value = "网络泵id")
-    @JsonIgnoreProperties
-    private String deviceId;
+//    @ApiModelProperty(value = "网络泵id")
+//    @JsonIgnoreProperties
+//    private String deviceId;
 
     @ApiModelProperty(value = "患者编号")
     private String patientId;
@@ -46,136 +47,136 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
     @JsonIgnoreProperties
     private String infusionId;
 
-    @ApiModelProperty(value = "分包标记位",readOnly = true)
-    @JsonIgnoreProperties(allowSetters = true)
-    private String classification;
-
-    @ApiModelProperty(value = "数据编号",readOnly = true)
-    @JsonIgnoreProperties(allowSetters = true)
-    private String dataNumber;
+//    @ApiModelProperty(value = "分包标记位",readOnly = true)
+//    @JsonIgnoreProperties(allowSetters = true)
+//    private String classification;
+//
+//    @ApiModelProperty(value = "数据编号",readOnly = true)
+//    @JsonIgnoreProperties(allowSetters = true)
+//    private String dataNumber;
 
     @ApiModelProperty(value = "输注修改记录id")
     @JsonIgnoreProperties
     private String infusionModifyId;
 
 
-    @ApiModelProperty(value = "总量",readOnly = true)
-    @Max(value = 999,message = "总量最大值不得超过999")
-    @Min(value = 0,message ="总量最小值不得超过0" )
-    private Integer totalDose;
-
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
-    @Max(value = 50,message = "首次量最大值不得超过50")
-    @Min(value = 0,message ="首次量最小值不得超过0" )
-    private Integer firstDose;
-
-
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
-    private BigDecimal remainDose;
-
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
-    private BigDecimal inputDose;
-
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
-    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
-    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendDose;
-
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
-    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
-    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendLockTime;
-
-    @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 selfControlLockTime;
-
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
-    private Integer selfControlCount;
-
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
-    private Integer pcaValidCount;
-
-    @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)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceStatusEnum runState;
-
-    @ApiModelProperty(value = "报警信息",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceAlarmEnum alarm;
-
-    @ApiModelProperty(value = "报警原因")
-    private String alarmCause;
-
-    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
-    private Boolean warnWillFinished;
-
-    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
-    private Boolean warnAnalgesicPoor;
-
-    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
-    private Boolean warnLowBattery;
+//    @ApiModelProperty(value = "总量",readOnly = true)
+//    @Max(value = 999,message = "总量最大值不得超过999")
+//    @Min(value = 0,message ="总量最小值不得超过0" )
+//    private Integer totalDose;
+//
+//    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+//    @Max(value = 50,message = "首次量最大值不得超过50")
+//    @Min(value = 0,message ="首次量最小值不得超过0" )
+//    private Integer firstDose;
+//
+//
+//    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+//    private BigDecimal remainDose;
+//
+//    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+//    private BigDecimal inputDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+//    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+//    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+//    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
+//    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendLockTime;
+//
+//    @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 selfControlLockTime;
+//
+//    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+//    private Integer selfControlCount;
+//
+//    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+//    private Integer pcaValidCount;
+//
+//    @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)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceStatusEnum runState;
+//
+//    @ApiModelProperty(value = "报警信息",readOnly = true)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceAlarmEnum alarm;
+//
+//    @ApiModelProperty(value = "报警原因")
+//    private String alarmCause;
+//
+//    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
+//    private Boolean warnWillFinished;
+//
+//    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
+//    private Boolean warnAnalgesicPoor;
+//
+//    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
+//    private Boolean warnLowBattery;
 
     @ApiModelProperty(value = "是否已撤泵,0、未撤泵1、已撤泵")
     @JsonIgnoreProperties
@@ -185,10 +186,10 @@ public class BusDeviceHistoryEntity extends TenantGenericEntity<String,String> {
     @JsonIgnoreProperties
     private Boolean master;
 
-
-    @ApiModelProperty(value = "泵类型",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.NEVER)
-    private DeviceTypeEnum type;
+//
+//    @ApiModelProperty(value = "泵类型",readOnly = true)
+//    @TableField(updateStrategy = FieldStrategy.NEVER)
+//    private DeviceTypeEnum type;
 
     @ApiModelProperty(value = "数据上传时间",readOnly = true,hidden = true)
     @JsonIgnoreProperties(allowSetters = true)

+ 169 - 145
coffee-system/src/main/java/com/coffee/bus/entity/BusDeviceRunningEntity.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.coffee.aliyun.utils.*;
+import com.coffee.bus.entity.common.CommonDeviceParam;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceStatusEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
@@ -36,20 +37,20 @@ import java.util.Date;
  **/
 @ToString
 @Data
-@EqualsAndHashCode(callSuper = false)
+@EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @TableName(value = "bus_device_running",autoResultMap = true)
 @ApiModel(value="设备运行状态", description="设备运行状态")
-public class BusDeviceRunningEntity extends TenantGenericEntity<String,String> {
+public class BusDeviceRunningEntity extends CommonDeviceParam<String,String> {
 
-    @ApiModelProperty(value = "网络泵id",readOnly = true)
-    private String deviceId;
+//    @ApiModelProperty(value = "网络泵id",readOnly = true)
+//    private String deviceId;
 
     @ApiModelProperty(value = "输注记录")
     private String infusionId;
 
-    @ApiModelProperty(value = "病号")
-    private String patientCode;
+//    @ApiModelProperty(value = "病号")
+//    private String patientCode;
 
     @ApiModelProperty(value = "临床号")
     private String clinicId;
@@ -61,132 +62,132 @@ public class BusDeviceRunningEntity extends TenantGenericEntity<String,String> {
     @ApiModelProperty(value = "病人性别")
     private SexEnum patientSex;
 
-    @ApiModelProperty(value = "病区")
-    private String ward;
-
-    @ApiModelProperty(value = "床号")
-    private String bedNo;
+//    @ApiModelProperty(value = "病区")
+//    private String ward;
+//
+//    @ApiModelProperty(value = "床号")
+//    private String bedNo;
     /***************临床固定数据*****************/
 
     @ApiModelProperty(value = "设备别名")
     private String alias;
 
-    @ApiModelProperty(value = "总量",readOnly = true)
-    @Max(value = 999,message = "总量最大值不得超过999")
-    @Min(value = 0,message ="总量最小值不得超过0" )
-    private Integer totalDose;
-
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
-    @Max(value = 50,message = "首次量最大值不得超过50")
-    @Min(value = 0,message ="首次量最小值不得超过0" )
-    private Integer firstDose;
-
-
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
-    private BigDecimal remainDose;
-
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
-    private BigDecimal inputDose;
-
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
-    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
-    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendDose;
-
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
-    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
-    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendLockTime;
-
-    @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 selfControlLockTime;
-
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
-    private Integer selfControlCount;
-
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
-    private Integer pcaValidCount;
-
-    @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)
-//    @TableField(typeHandler = EnumTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceStatusEnum runState;
-
-    @ApiModelProperty(value = "报警信息",readOnly = true)
-//    @TableField(typeHandler = EnumTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceAlarmEnum alarm;
-
-    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
-    private Boolean warnWillFinished;
-
-    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
-    private Boolean warnAnalgesicPoor;
-
-    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
-    private Boolean warnLowBattery;
+//    @ApiModelProperty(value = "总量",readOnly = true)
+//    @Max(value = 999,message = "总量最大值不得超过999")
+//    @Min(value = 0,message ="总量最小值不得超过0" )
+//    private Integer totalDose;
+
+//    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+//    @Max(value = 50,message = "首次量最大值不得超过50")
+//    @Min(value = 0,message ="首次量最小值不得超过0" )
+//    private Integer firstDose;
+
+
+//    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+//    private BigDecimal remainDose;
+
+//    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+//    private BigDecimal inputDose;
+
+//    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+//    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+//    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendDose;
+
+//    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+//    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
+//    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendLockTime;
+
+//    @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 selfControlLockTime;
+//
+//    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+//    private Integer selfControlCount;
+//
+//    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+//    private Integer pcaValidCount;
+//
+//    @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)
+////    @TableField(typeHandler = EnumTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceStatusEnum runState;
+//
+//    @ApiModelProperty(value = "报警信息",readOnly = true)
+////    @TableField(typeHandler = EnumTypeHandler.class,javaType = true,updateStrategy = FieldStrategy.IGNORED)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceAlarmEnum alarm;
+
+//    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
+//    private Boolean warnWillFinished;
+//
+//    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
+//    private Boolean warnAnalgesicPoor;
+//
+//    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
+//    private Boolean warnLowBattery;
 
     @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",readOnly = true)
     private Date startTime;
@@ -232,30 +233,53 @@ public class BusDeviceRunningEntity extends TenantGenericEntity<String,String> {
      * @param items
      */
     public void setFiledsByItems(String deviceName, Items items) {
-        this.deviceId = deviceName;
-        this.classification = items.getString(PumpParams.classification);
+        this.setDeviceId(deviceName)  ;
+        this.setClassification( items.getString(PumpParams.classification));
+        this.setDataNumber(items.getInteger(PumpParams.dataNumber));
+        this.setPatientCode( items.getString(PumpParams.patientCode));
+        this.setWard(items.getString(PumpParams.ward));
+        this.setBedNo(items.getString(PumpParams.bedNo));
+        this.setTotalDose( items.getInteger(PumpParams.totalDose));
+        this.setInputDose(items.getBigDecimal(PumpParams.finishedDose));
+        this.setFirstDose( items.getInteger(PumpParams.firstDosis));
+        this.setMaxDose(items.getBigDecimal(PumpParams.maxDose));
+        this.setAppendDose(items.getBigDecimal(PumpParams.singleDosis));
+        this.setAppendLockTime(items.getBigDecimal(PumpParams.lockTime));
+        this.setContinueDose(items.getBigDecimal(PumpParams.flow));
+        this.setType( DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType)));
+        this.setPcaValidCount(items.getInteger(PumpParams.pcaValid));
+        this.setPcaInvalidCount(items.getInteger(PumpParams.pcaInvalid));
+        this.setPcaTotalCount(this.getPcaInvalidCount()+this.getPcaValidCount());
+        this.setElectricQuantity(items.getInteger(PumpParams.electricQuantity));
+        this.setRunState(DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus)));
+        this.setAlarm(DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus)));
+//        this.deviceId = deviceName;
+
+//        this.classification = items.getString(PumpParams.classification);
 //        this.dataNumber = items.getString(PumpParams.dataNumber);
-        this.patientCode = items.getString(PumpParams.patientCode);
-        this.ward = items.getString(PumpParams.ward);
-        this.bedNo = items.getString(PumpParams.bedNo);
-        this.totalDose = items.getInteger(PumpParams.totalDose);
-        this.inputDose = items.getBigDecimal(PumpParams.finishedDose);
-        this.firstDose = items.getInteger(PumpParams.firstDosis);
-        this.maxDose = items.getBigDecimal(PumpParams.maxDose);
-        this.appendLockTime = items.getBigDecimal(PumpParams.lockTime);
-        this.continueDose = items.getBigDecimal(PumpParams.flow);
-        this.type = DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType));
-        this.appendDose = items.getBigDecimal(PumpParams.singleDosis);
-        this.pcaValidCount = items.getInteger(PumpParams.pcaValid);
-        this.pcaInvalidCount = items.getInteger(PumpParams.pcaInvalid);
-        this.pcaTotalCount = this.pcaInvalidCount + this.pcaValidCount;
+//        this.patientCode = items.getString(PumpParams.patientCode);
+//        this.ward = items.getString(PumpParams.ward);
+//        this.bedNo = items.getString(PumpParams.bedNo);
+//        this.totalDose = items.getInteger(PumpParams.totalDose);
+//        this.inputDose = items.getBigDecimal(PumpParams.finishedDose);
+//        this.firstDose = items.getInteger(PumpParams.firstDosis);
+//        this.maxDose = items.getBigDecimal(PumpParams.maxDose);
+//        this.appendLockTime = items.getBigDecimal(PumpParams.lockTime);
+//        this.continueDose = items.getBigDecimal(PumpParams.flow);
+//        this.type = DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType));
+//        this.appendDose = items.getBigDecimal(PumpParams.singleDosis);
+//        this.pcaValidCount = items.getInteger(PumpParams.pcaValid);
+//        this.pcaInvalidCount = items.getInteger(PumpParams.pcaInvalid);
+//        this.pcaTotalCount = this.pcaInvalidCount + this.pcaValidCount;
 //        this.electricQuantity = items.getInteger(PumpParams.electricQuantity);
 
         // 运行状态
-        this.runState = DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus));
+//        this.runState = DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus));
         // 报警
-        this.alarm = DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus));
+//        this.alarm = DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus));
 
         // 预报
     }
+
+
 }

+ 184 - 164
coffee-system/src/main/java/com/coffee/bus/entity/BusInfusionHistoryEntity.java

@@ -2,6 +2,7 @@ package com.coffee.bus.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.coffee.aliyun.utils.*;
+import com.coffee.bus.entity.common.CommonDeviceParam;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.coffee.bus.enums.DeviceStatusEnum;
@@ -37,9 +38,9 @@ import java.util.Date;
 @Accessors(chain = true)
 @TableName(value = "bus_infusion_history",autoResultMap = true)
 @ApiModel(value="设备输注历史信息记录", description="设备的classification标识每改变一次,就算一次新的输注记录")
-public class BusInfusionHistoryEntity extends TenantGenericEntity<String,String> implements RecordCreationEntity, RecordModifierEntity {
-    @ApiModelProperty(value = "网络泵id",readOnly = true)
-    private String deviceId;
+public class BusInfusionHistoryEntity extends CommonDeviceParam<String,String> {
+//    @ApiModelProperty(value = "网络泵id",readOnly = true)
+//    private String deviceId;
 
     @ApiModelProperty(value = "临床号")
     private String clinicId;
@@ -47,150 +48,150 @@ public class BusInfusionHistoryEntity extends TenantGenericEntity<String,String>
     @ApiModelProperty(value = "患者编号")
     private String patientId;
 
-    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",readOnly = true)
-    @JsonIgnoreProperties(allowSetters = true)
-    private String classification;
-
-    @ApiModelProperty(value = "数据编号",readOnly = true)
-    @JsonIgnoreProperties(allowSetters = true)
-    private String dataNumber;
+//    @ApiModelProperty(value = "数据分类号,标识某些数据属于同一个输注",readOnly = true)
+//    @JsonIgnoreProperties(allowSetters = true)
+//    private String classification;
+//
+//    @ApiModelProperty(value = "数据编号",readOnly = true)
+//    @JsonIgnoreProperties(allowSetters = true)
+//    private String dataNumber;
+//
+//    @ApiModelProperty(value = "泵类型",readOnly = true)
+//    @TableField(updateStrategy = FieldStrategy.NEVER)
+//    private DeviceTypeEnum deviceType;
 
-    @ApiModelProperty(value = "泵类型",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.NEVER)
-    private DeviceTypeEnum deviceType;
-
-    @ApiModelProperty(value = "住院号")
-    private String patientCode;
+//    @ApiModelProperty(value = "住院号")
+//    private String patientCode;
 
 
     /***************临床固定数据*****************/
-    @ApiModelProperty(value = "病区")
-    private String ward;
-
-    @ApiModelProperty(value = "床号")
-    private String bedNo;
+//    @ApiModelProperty(value = "病区")
+//    private String ward;
+//
+//    @ApiModelProperty(value = "床号")
+//    private String bedNo;
     /***************临床固定数据*****************/
 
-    @ApiModelProperty(value = "总量",readOnly = true)
-    @Max(value = 999,message = "总量最大值不得超过999")
-    @Min(value = 0,message ="总量最小值不得超过0" )
-    private Integer totalDose;
-
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
-    @Max(value = 50,message = "首次量最大值不得超过50")
-    @Min(value = 0,message ="首次量最小值不得超过0" )
-    private Integer firstDose;
-
-
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
-    private BigDecimal remainDose;
-
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
-    private BigDecimal inputDose;
-
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
-    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
-    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendDose;
-
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
-    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
-    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendLockTime;
-
-    @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 selfControlLockTime;
-
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
-    private Integer selfControlCount;
-
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
-    private Integer pcaValidCount;
-
-    @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)
-    @TableField(updateStrategy = FieldStrategy.DEFAULT)
-    private FlowStatusEnum warnFlow;
-
-    @ApiModelProperty(value = "公共参数-电量",readOnly = true)
-    private Integer electricQuantity;
-
-    @ApiModelProperty(value = "泵运行状态",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceStatusEnum runState;
-
-    @ApiModelProperty(value = "报警信息",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
-    private DeviceAlarmEnum alarm;
-
-    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
-    private Boolean warnWillFinished;
-
-    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
-    private Boolean warnAnalgesicPoor;
-
-    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
-    private Boolean warnLowBattery;
+//    @ApiModelProperty(value = "总量",readOnly = true)
+//    @Max(value = 999,message = "总量最大值不得超过999")
+//    @Min(value = 0,message ="总量最小值不得超过0" )
+//    private Integer totalDose;
+//
+//    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+//    @Max(value = 50,message = "首次量最大值不得超过50")
+//    @Min(value = 0,message ="首次量最小值不得超过0" )
+//    private Integer firstDose;
+//
+//
+//    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+//    private BigDecimal remainDose;
+//
+//    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+//    private BigDecimal inputDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+//    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+//    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+//    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
+//    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendLockTime;
+//
+//    @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 selfControlLockTime;
+//
+//    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+//    private Integer selfControlCount;
+//
+//    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+//    private Integer pcaValidCount;
+//
+//    @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)
+//    @TableField(updateStrategy = FieldStrategy.DEFAULT)
+//    private FlowStatusEnum warnFlow;
+//
+//    @ApiModelProperty(value = "公共参数-电量",readOnly = true)
+//    private Integer electricQuantity;
+//
+//    @ApiModelProperty(value = "泵运行状态",readOnly = true)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceStatusEnum runState;
+//
+//    @ApiModelProperty(value = "报警信息",readOnly = true)
+//    @TableField(updateStrategy = FieldStrategy.IGNORED)
+//    private DeviceAlarmEnum alarm;
+//
+//    @ApiModelProperty(value = "输注即将结束提醒",readOnly = true)
+//    private Boolean warnWillFinished;
+//
+//    @ApiModelProperty(value = "镇痛不足提醒",readOnly = true)
+//    private Boolean warnAnalgesicPoor;
+//
+//    @ApiModelProperty(value = "电量偏低提醒",readOnly = true)
+//    private Boolean warnLowBattery;
 
     @ApiModelProperty(value = "输注开始时间,即本次运行开机时间",readOnly = true)
     private Date startTime;
@@ -233,7 +234,7 @@ public class BusInfusionHistoryEntity extends TenantGenericEntity<String,String>
         entity.setDeviceId(running.getDeviceId());
         entity.setClinicId(running.getClinicId());
         entity.setPatientCode(running.getPatientCode());
-        entity.setDeviceType(running.getType());
+        entity.setType(running.getType());
         entity.setWard(running.getWard());
         entity.setBedNo(running.getBedNo());
         entity.setClassification(running.getClassification());
@@ -288,28 +289,47 @@ public class BusInfusionHistoryEntity extends TenantGenericEntity<String,String>
      * @param items
      */
     public void setFiledsByItems(Items items) {
-        this.classification = items.getString(PumpParams.classification);
-        this.dataNumber = items.getString(PumpParams.dataNumber);
-        this.patientCode = items.getString(PumpParams.patientCode);
-        this.ward = items.getString(PumpParams.ward);
-        this.bedNo = items.getString(PumpParams.bedNo);
-        this.totalDose = items.getInteger(PumpParams.totalDose);
-        this.inputDose = items.getBigDecimal(PumpParams.finishedDose);
-        this.firstDose = items.getInteger(PumpParams.firstDosis);
-        this.maxDose = items.getBigDecimal(PumpParams.maxDose);
-        this.appendLockTime = items.getBigDecimal(PumpParams.lockTime);
-        this.continueDose = items.getBigDecimal(PumpParams.flow);
-        this.deviceType = DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType));
-        this.appendDose = items.getBigDecimal(PumpParams.singleDosis);
-        this.pcaValidCount = items.getInteger(PumpParams.pcaValid);
-        this.pcaInvalidCount = items.getInteger(PumpParams.pcaInvalid);
-        this.pcaTotalCount = this.pcaInvalidCount + this.pcaValidCount;
-        this.electricQuantity = items.getInteger(PumpParams.electricQuantity);
-
-        // 运行状态
-        this.runState = DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus));
-        // 报警
-        this.alarm = DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus));
+        this.setClassification( items.getString(PumpParams.classification));
+        this.setDataNumber(items.getInteger(PumpParams.dataNumber));
+        this.setPatientCode( items.getString(PumpParams.patientCode));
+        this.setWard(items.getString(PumpParams.ward));
+        this.setBedNo(items.getString(PumpParams.bedNo));
+        this.setTotalDose( items.getInteger(PumpParams.totalDose));
+        this.setInputDose(items.getBigDecimal(PumpParams.finishedDose));
+        this.setFirstDose( items.getInteger(PumpParams.firstDosis));
+        this.setMaxDose(items.getBigDecimal(PumpParams.maxDose));
+        this.setAppendLockTime(items.getBigDecimal(PumpParams.lockTime));
+        this.setContinueDose(items.getBigDecimal(PumpParams.flow));
+        this.setType( DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType)));
+        this.setAppendDose(items.getBigDecimal(PumpParams.singleDosis));
+        this.setPcaValidCount(items.getInteger(PumpParams.pcaValid));
+        this.setPcaInvalidCount(items.getInteger(PumpParams.pcaInvalid));
+        this.setPcaTotalCount(this.getPcaInvalidCount()+this.getPcaValidCount());
+        this.setElectricQuantity(items.getInteger(PumpParams.electricQuantity));
+        this.setRunState(DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus)));
+        this.setAlarm(DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus)));
+//        this.classification = items.getString(PumpParams.classification);
+//        this.dataNumber = items.getString(PumpParams.dataNumber);
+//        this.patientCode = items.getString(PumpParams.patientCode);
+//        this.ward = items.getString(PumpParams.ward);
+//        this.bedNo = items.getString(PumpParams.bedNo);
+//        this.totalDose = items.getInteger(PumpParams.totalDose);
+//        this.inputDose = items.getBigDecimal(PumpParams.finishedDose);
+//        this.firstDose = items.getInteger(PumpParams.firstDosis);
+//        this.maxDose = items.getBigDecimal(PumpParams.maxDose);
+//        this.appendLockTime = items.getBigDecimal(PumpParams.lockTime);
+//        this.continueDose = items.getBigDecimal(PumpParams.flow);
+//        this.deviceType = DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType));
+//        this.appendDose = items.getBigDecimal(PumpParams.singleDosis);
+//        this.pcaValidCount = items.getInteger(PumpParams.pcaValid);
+//        this.pcaInvalidCount = items.getInteger(PumpParams.pcaInvalid);
+//        this.pcaTotalCount = this.pcaInvalidCount + this.pcaValidCount;
+//        this.electricQuantity = items.getInteger(PumpParams.electricQuantity);
+//
+//        // 运行状态
+//        this.runState = DeviceRunStatusUtils.getRunStatus(items.getInteger(PumpParams.runStatus));
+//        // 报警
+//        this.alarm = DeviceAlarmUtils.getAlarm(items.getInteger(PumpParams.alarmStatus));
 
         // 预报
 

+ 134 - 133
coffee-system/src/main/java/com/coffee/bus/entity/BusInfusionModifyEntity.java

@@ -5,6 +5,7 @@ import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.bus.entity.common.CommonDeviceParam;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.coffee.common.entity.TenantGenericEntity;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -31,124 +32,124 @@ import java.util.Date;
  */
 @ToString
 @Data
-@EqualsAndHashCode(callSuper = false)
+@EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @TableName(value = "bus_infusion_modify",autoResultMap = true)
 @ApiModel(value="设备输注参数修改记录", description="当输注参数发生修改时,在此表中进行记录")
-public class BusInfusionModifyEntity extends TenantGenericEntity<String,String> {
-    @ApiModelProperty(value = "网络泵id",readOnly = true)
-    private String deviceId;
+public class BusInfusionModifyEntity extends CommonDeviceParam<String,String> {
+//    @ApiModelProperty(value = "网络泵id",readOnly = true)
+//    private String deviceId;
 
     @ApiModelProperty(value = "输注记录")
     private String infusionId;
 
-    @ApiModelProperty(value = "泵类型",readOnly = true)
-    @TableField(updateStrategy = FieldStrategy.NEVER)
-    private DeviceTypeEnum type;
-
-    @ApiModelProperty(value = "总量",readOnly = true)
-    @Max(value = 999,message = "总量最大值不得超过999")
-    @Min(value = 0,message ="总量最小值不得超过0" )
-    private Integer totalDose;
-
-    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
-    @Max(value = 50,message = "首次量最大值不得超过50")
-    @Min(value = 0,message ="首次量最小值不得超过0" )
-    private Integer firstDose;
-
-    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
-    private BigDecimal remainDose;
-
-    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
-    private BigDecimal inputDose;
-
-    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
-    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
-    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendDose;
-
-    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
-    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
-    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
-    private BigDecimal appendLockTime;
-
-    @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 selfControlLockTime;
-
-    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
-    private Integer selfControlCount;
-
-    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
-    private Integer pcaValidCount;
-
-    @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)
+//    @TableField(updateStrategy = FieldStrategy.NEVER)
+//    private DeviceTypeEnum type;
+
+//    @ApiModelProperty(value = "总量",readOnly = true)
+//    @Max(value = 999,message = "总量最大值不得超过999")
+//    @Min(value = 0,message ="总量最小值不得超过0" )
+//    private Integer totalDose;
+//
+//    @ApiModelProperty(value = "公共参数-首次量",readOnly = true)
+//    @Max(value = 50,message = "首次量最大值不得超过50")
+//    @Min(value = 0,message ="首次量最小值不得超过0" )
+//    private Integer firstDose;
+//
+//    @ApiModelProperty(value = "公共参数-剩余量",readOnly = true)
+//    private BigDecimal remainDose;
+//
+//    @ApiModelProperty(value = "公共参数-已输入量",readOnly = true)
+//    private BigDecimal inputDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加量",readOnly = true)
+//    @DecimalMax(value = "10",message = "PCA追加量最大值不得超过10")
+//    @DecimalMin(value = "0",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendDose;
+//
+//    @ApiModelProperty(value = "公共参数-追加锁时",readOnly = true)
+//    @DecimalMax(value = "99",message = "PCA追加量最大值不得超过99")
+//    @DecimalMin(value = "1",message ="PCA追加量最小值不得超过0" )
+//    private BigDecimal appendLockTime;
+//
+//    @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 selfControlLockTime;
+//
+//    @ApiModelProperty(value = "公共参数-自控次数",readOnly = true)
+//    private Integer selfControlCount;
+//
+//    @ApiModelProperty(value = "公共参数-pca有效次数",readOnly = true)
+//    private Integer pcaValidCount;
+//
+//    @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 = "参数修改时间")
     private Date modifyTime;
 
 
-    @ApiModelProperty(value = "分包标记位",readOnly = true)
-    @JsonIgnoreProperties(allowSetters = true)
-    private String classification;
+//    @ApiModelProperty(value = "分包标记位",readOnly = true)
+//    @JsonIgnoreProperties(allowSetters = true)
+//    private String classification;
 
     public static BusInfusionModifyEntity parseRunningInfo(BusDeviceRunningEntity running){
         BusInfusionModifyEntity entity = new BusInfusionModifyEntity();
@@ -198,37 +199,37 @@ public class BusInfusionModifyEntity extends TenantGenericEntity<String,String>
         //加密过程中,加入分包标识,保证新的输注的输注参数必定发生改变
         switch (this.getType()){
             case continuous:
-                param.putOpt("continueDose",this.continueDose);
-                param.putOpt("firstDose",this.firstDose);
-                param.putOpt("appendDose",this.appendDose);
-                param.putOpt("appendLockTime",this.appendLockTime);
-                param.putOpt("maxDose",this.maxDose);
-                param.putOpt("classification",this.classification);
+                param.putOpt("continueDose",this.getContinueDose());
+                param.putOpt("firstDose",this.getFirstDose());
+                param.putOpt("appendDose",this.getAppendDose());
+                param.putOpt("appendLockTime",this.getAppendLockTime());
+                param.putOpt("maxDose",this.getMaxDose());
+                param.putOpt("classification",this.getClassification());
                 break;
             case pulse:
-                param.putOpt("firstDose",this.firstDose);
-                param.putOpt("firstLockTime",this.pulseFirstLockTime);
-                param.putOpt("continueDose",this.continueDose);
-                param.putOpt("pulseDose",this.pulseDose);
-                param.putOpt("lockTime",this.pulseLockTime);
-                param.putOpt("appendDose",this.appendDose);
-                param.putOpt("appendLockTime",this.appendLockTime);
-                param.putOpt("maxDose",this.maxDose);
-                param.putOpt("classification",this.classification);
+                param.putOpt("firstDose",this.getFirstDose());
+                param.putOpt("firstLockTime",this.getPulseFirstLockTime());
+                param.putOpt("continueDose",this.getContinueDose());
+                param.putOpt("pulseDose",this.getPulseDose());
+                param.putOpt("lockTime",this.getPulseLockTime());
+                param.putOpt("appendDose",this.getAppendDose());
+                param.putOpt("appendLockTime",this.getAppendLockTime());
+                param.putOpt("maxDose",this.getMaxDose());
+                param.putOpt("classification",this.getClassification());
                 break;
             case intelligent:
-                param.putOpt("firstDose",this.firstDose);
-                param.putOpt("appendDose",this.appendDose);
-                param.putOpt("appendLockTime",this.appendLockTime);
-                param.putOpt("flowUpCycle",this.flowUpCycle);
-                param.putOpt("flowCount",this.flowCount);
-                param.putOpt("flowDownCycle",this.flowDownCycle);
-                param.putOpt("flowAdjustRate",this.flowAdjustRate);
-                param.putOpt("flowUpLimit",this.flowUpLimit);
-                param.putOpt("flowDownLimit",this.flowDownLimit);
-                param.putOpt("continueDose",this.continueDose);
-                param.putOpt("maxDose",this.maxDose);
-                param.putOpt("classification",this.classification);
+                param.putOpt("firstDose",this.getFirstDose());
+                param.putOpt("appendDose",this.getAppendDose());
+                param.putOpt("appendLockTime",this.getAppendLockTime());
+                param.putOpt("flowUpCycle",this.getFlowUpCycle());
+                param.putOpt("flowCount",this.getFlowCount());
+                param.putOpt("flowDownCycle",this.getFlowDownCycle());
+                param.putOpt("flowAdjustRate",this.getFlowAdjustRate());
+                param.putOpt("flowUpLimit",this.getFlowUpLimit());
+                param.putOpt("flowDownLimit",this.getFlowDownLimit());
+                param.putOpt("continueDose",this.getContinueDose());
+                param.putOpt("maxDose",this.getMaxDose());
+                param.putOpt("classification",this.getClassification());
                 break;
             default:break;
         }

+ 2 - 5
coffee-system/src/main/java/com/coffee/bus/entity/common/CommonDeviceParam.java

@@ -6,8 +6,6 @@ import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceStatusEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.coffee.bus.enums.FlowStatusEnum;
-import com.coffee.common.entity.RecordCreationEntity;
-import com.coffee.common.entity.RecordModifierEntity;
 import com.coffee.common.entity.TenantGenericEntity;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import io.swagger.annotations.ApiModelProperty;
@@ -19,7 +17,6 @@ import javax.validation.constraints.DecimalMin;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * @author lifang
@@ -30,7 +27,7 @@ import java.util.Date;
  */
 @Accessors(chain = true)
 @Data
-public class CommonDeviceParam  extends TenantGenericEntity<String,String>  {
+public class CommonDeviceParam<PK,TN>  extends TenantGenericEntity<PK,TN>  {
     @ApiModelProperty(value = "网络泵id",readOnly = true)
     private String deviceId;
 
@@ -40,7 +37,7 @@ public class CommonDeviceParam  extends TenantGenericEntity<String,String>  {
 
     @ApiModelProperty(value = "数据编号",readOnly = true)
     @JsonIgnoreProperties(allowSetters = true)
-    private String dataNumber;
+    private Integer dataNumber;
 
     @ApiModelProperty(value = "泵类型",readOnly = true)
     @TableField(updateStrategy = FieldStrategy.NEVER)

+ 2 - 0
coffee-system/src/main/java/com/coffee/bus/registry/constant/DeviceKeyConstant.java

@@ -35,4 +35,6 @@ public class DeviceKeyConstant {
     public static final String INFUSION_PARAM="infusion_param";
 
     public static final String UNDO="undo";
+
+    public static final String UPLOAD_TIME="upload_time";
 }

+ 10 - 0
coffee-system/src/main/java/com/coffee/bus/registry/device/ClusterDeviceOperator.java

@@ -258,6 +258,16 @@ public class ClusterDeviceOperator implements DeviceOperator<DeviceCacheInfo> {
         configStorage.setConfig(DeviceKeyConstant.UNDO,undo);
     }
 
+    @Override
+    public Date getUploadTime() {
+        return getValue(DeviceKeyConstant.UPLOAD_TIME).asDate();
+    }
+
+    @Override
+    public void setUploadTime(Date uploadTime) {
+        configStorage.setConfig(DeviceKeyConstant.UPLOAD_TIME,uploadTime);
+    }
+
     @Override
     public void clear() {
         configStorage.clear();

+ 13 - 0
coffee-system/src/main/java/com/coffee/bus/registry/device/DeviceOperator.java

@@ -186,5 +186,18 @@ public interface DeviceOperator<T> extends Operator<T> {
      */
     void setUndo(Boolean undo);
 
+    /**
+     * 获取设备最新上传数据时间
+     * @return
+     */
+    Date getUploadTime();
+
+
+    /**
+     * 设置设备最新上传数据时间
+     * @param uploadTime
+     */
+    void setUploadTime(Date uploadTime);
+
     void clear();
 }

+ 116 - 118
coffee-system/src/main/java/com/coffee/bus/websocket/listener/DeviceInfoListener.java

@@ -9,9 +9,8 @@ import cn.hutool.crypto.SignUtil;
 import cn.hutool.crypto.asymmetric.Sign;
 import cn.hutool.crypto.asymmetric.SignAlgorithm;
 import cn.hutool.extra.spring.SpringUtil;
-import com.baomidou.mybatisplus.annotation.IEnum;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -19,7 +18,6 @@ import com.coffee.bus.entity.*;
 import com.coffee.bus.enums.DeviceAlarmEnum;
 import com.coffee.bus.enums.DeviceTypeEnum;
 import com.coffee.bus.enums.PatientAlarmEnum;
-import com.coffee.bus.listener.event.bean.HisEvent;
 import com.coffee.bus.registry.device.DeviceRegistry;
 import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
 import com.coffee.bus.registry.device.bean.DeviceCacheInfo;
@@ -29,9 +27,7 @@ import com.coffee.bus.registry.patient.PatientRegistry;
 import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
 import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
 import com.coffee.bus.service.*;
-import com.coffee.bus.websocket.DeviceConflictHandler;
 import com.coffee.common.config.websocket.WebSocketConstant;
-import com.coffee.common.enums.SexEnum;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.event.EventListener;
@@ -115,7 +111,7 @@ public class DeviceInfoListener {
                 throw new RuntimeException("设备数据中分包标识不能为空");
             }
 
-            log.info("接收到设备数据:[{}]",infoEvent.getContent().toString());
+            log.info("接收到设备数据:[{}]", JSONUtil.toJsonStr(infoEvent.getContent()));
             AtomicBoolean newInfusion=new AtomicBoolean(false);
             //缓存操作
             List<Supplier<?>> cacheOperation=new ArrayList<>();
@@ -381,6 +377,7 @@ public class DeviceInfoListener {
         BusInfusionModifyEntity busInfusionModify = BusInfusionModifyEntity.parseRunningInfo(device);
         String signHex = busInfusionModify.signParam(sign);
         String infusionParam = deviceOperator.getInfusionParam();
+
         //输注参数已发生变化
         if(ObjectUtil.notEqual(signHex,infusionParam)){
             infusionModifyService.save(busInfusionModify);
@@ -518,118 +515,119 @@ public class DeviceInfoListener {
 
         SpringUtil.publishEvent(new DeviceInfoEvent(this,pump,pump.getDeviceId()));
 
-//        Thread.sleep(5000);
-//
-//        BusDeviceRunningEntity pump1 = new BusDeviceRunningEntity();
-//        pump1.setDeviceId("456");
-//        pump1.setType(DeviceTypeEnum.continuous);
-//        pump1.setClassification(String.valueOf(mark));
-//        pump1.setPatientCode("456");
-//        pump1.setTotalDose(RandomUtil.randomInt(100));
-//        pump1.setFirstDose(RandomUtil.randomInt(100));
-//        pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setSelfControlCount(RandomUtil.randomInt(100));
-//        pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump1.setFirstDose(RandomUtil.randomInt(100));
-//        pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump1.setPcaValidCount(RandomUtil.randomInt(100));
-//        pump1.setPcaInvalidCount(RandomUtil.randomInt(100));
-//        pump1.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
-//        pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//
-//        pump1.setPulseDose(RandomUtil.randomInt(100));
-//        pump1.setPulseLockTime(RandomUtil.randomInt(100));
-//        pump1.setPulseFirstLockTime(RandomUtil.randomInt(100));
-//        pump1.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump1.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//        pump1.setUploadTime(new Date());
-//        Thread.sleep(5000);
-//
-//        BusDeviceRunningEntity pump2 = new BusDeviceRunningEntity();
-//        pump2.setType(DeviceTypeEnum.continuous);
-//        pump2.setDeviceId("456");
-//        pump2.setClassification(String.valueOf(mark));
-//        pump2.setPatientCode("789");
-//        pump2.setTotalDose(RandomUtil.randomInt(100));
-//        pump2.setFirstDose(RandomUtil.randomInt(100));
-//        pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setSelfControlCount(RandomUtil.randomInt(100));
-//        pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump2.setFirstDose(RandomUtil.randomInt(100));
-//        pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump2.setPcaValidCount(RandomUtil.randomInt(100));
-//        pump2.setPcaInvalidCount(RandomUtil.randomInt(100));
-//        pump2.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
-//        pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//        pump2.setPulseDose(RandomUtil.randomInt(100));
-//        pump2.setPulseLockTime(RandomUtil.randomInt(100));
-//        pump2.setPulseFirstLockTime(RandomUtil.randomInt(100));
-//        pump2.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump2.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//        pump2.setUploadTime(new Date());
-//
-//        Thread.sleep(5000);
-//
-//        BusDeviceRunningEntity pump3 = new BusDeviceRunningEntity();
-//        pump3.setDeviceId("456");
-//        pump3.setClassification(String.valueOf(mark));
-//        pump3.setType(DeviceTypeEnum.continuous);
-//        pump3.setPatientCode("456");
-//        pump3.setTotalDose(RandomUtil.randomInt(100));
-//        pump3.setFirstDose(RandomUtil.randomInt(100));
-//        pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setSelfControlCount(RandomUtil.randomInt(100));
-//        pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump3.setFirstDose(RandomUtil.randomInt(100));
-//        pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
-//        pump3.setPcaValidCount(RandomUtil.randomInt(100));
-//        pump3.setPcaInvalidCount(RandomUtil.randomInt(100));
-//        pump3.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
-//        pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//        pump3.setPulseDose(RandomUtil.randomInt(100));
-//        pump3.setPulseLockTime(RandomUtil.randomInt(100));
-//        pump3.setPulseFirstLockTime(RandomUtil.randomInt(100));
-//        pump3.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//        pump3.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
-//
-//        pump3.setUploadTime(new Date());
-//        SpringUtil.publishEvent(new DeviceInfoEvent(this,pump3,pump3.getDeviceId()));
-//        });
+        Thread.sleep(5000);
+
+        BusDeviceRunningEntity pump1 = new BusDeviceRunningEntity();
+        pump1.setDeviceId("456");
+        pump1.setType(DeviceTypeEnum.continuous);
+        pump1.setClassification(String.valueOf(mark));
+        pump1.setPatientCode("456");
+        pump1.setTotalDose(RandomUtil.randomInt(100));
+        pump1.setFirstDose(RandomUtil.randomInt(100));
+        pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setSelfControlCount(RandomUtil.randomInt(100));
+        pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump1.setFirstDose(RandomUtil.randomInt(100));
+        pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump1.setPcaValidCount(RandomUtil.randomInt(100));
+        pump1.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump1.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
+        pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+
+        pump1.setPulseDose(RandomUtil.randomInt(100));
+        pump1.setPulseLockTime(RandomUtil.randomInt(100));
+        pump1.setPulseFirstLockTime(RandomUtil.randomInt(100));
+        pump1.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump1.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+        pump1.setUploadTime(new Date());
+        SpringUtil.publishEvent(new DeviceInfoEvent(this,pump1,pump1.getDeviceId()));
+        Thread.sleep(5000);
+
+        BusDeviceRunningEntity pump2 = new BusDeviceRunningEntity();
+        pump2.setType(DeviceTypeEnum.continuous);
+        pump2.setDeviceId("456");
+        pump2.setClassification(String.valueOf(mark));
+        pump2.setPatientCode("789");
+        pump2.setTotalDose(RandomUtil.randomInt(100));
+        pump2.setFirstDose(RandomUtil.randomInt(100));
+        pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setSelfControlCount(RandomUtil.randomInt(100));
+        pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump2.setFirstDose(RandomUtil.randomInt(100));
+        pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump2.setPcaValidCount(RandomUtil.randomInt(100));
+        pump2.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump2.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
+        pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+        pump2.setPulseDose(RandomUtil.randomInt(100));
+        pump2.setPulseLockTime(RandomUtil.randomInt(100));
+        pump2.setPulseFirstLockTime(RandomUtil.randomInt(100));
+        pump2.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump2.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+        pump2.setUploadTime(new Date());
+        SpringUtil.publishEvent(new DeviceInfoEvent(this,pump2,pump2.getDeviceId()));
+        Thread.sleep(5000);
+
+        BusDeviceRunningEntity pump3 = new BusDeviceRunningEntity();
+        pump3.setDeviceId("456");
+        pump3.setClassification(String.valueOf(mark));
+        pump3.setType(DeviceTypeEnum.continuous);
+        pump3.setPatientCode("456");
+        pump3.setTotalDose(RandomUtil.randomInt(100));
+        pump3.setFirstDose(RandomUtil.randomInt(100));
+        pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setSelfControlCount(RandomUtil.randomInt(100));
+        pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump3.setFirstDose(RandomUtil.randomInt(100));
+        pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
+        pump3.setPcaValidCount(RandomUtil.randomInt(100));
+        pump3.setPcaInvalidCount(RandomUtil.randomInt(100));
+        pump3.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
+        pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+        pump3.setPulseDose(RandomUtil.randomInt(100));
+        pump3.setPulseLockTime(RandomUtil.randomInt(100));
+        pump3.setPulseFirstLockTime(RandomUtil.randomInt(100));
+        pump3.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+        pump3.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
+
+        pump3.setUploadTime(new Date());
+        SpringUtil.publishEvent(new DeviceInfoEvent(this,pump3,pump3.getDeviceId()));
+
         Thread.sleep(5000);
         String now = DateUtil.yesterday().toString();