|
|
@@ -1,5 +1,11 @@
|
|
|
package cn.tr.module.smart.common.dto;
|
|
|
|
|
|
+import cn.hutool.core.text.CharSequenceUtil;
|
|
|
+import cn.hutool.core.util.EnumUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.tr.module.smart.common.enums.FlowStatusEnum;
|
|
|
+import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
@@ -46,4 +52,99 @@ public class BizDeviceDTO {
|
|
|
|
|
|
@ApiModelProperty(value = "电量", position = 10)
|
|
|
private Integer electricQuantity;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "已输入量",position = 11)
|
|
|
+ private BigDecimal inputDose;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "泵别名", position = 12)
|
|
|
+ private String alias;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "泵运行状态", position = 13)
|
|
|
+ private String deviceRunState;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "报警信息",position = 14)
|
|
|
+ private String deviceAlarm;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "提醒字段",position = 15)
|
|
|
+ private String warns;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "输注即将结束提醒",position = 16,hidden = true)
|
|
|
+ @JsonIgnore
|
|
|
+ private Boolean warnWillFinished;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "镇痛不足提醒",position = 17,hidden = true)
|
|
|
+ @JsonIgnore
|
|
|
+ private Boolean warnAnalgesicPoor;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "电量偏低提醒",position = 18,hidden = true)
|
|
|
+ @JsonIgnore
|
|
|
+ private Boolean warnLowBattery;
|
|
|
+
|
|
|
+ @ApiModelProperty(value = "加减档提示", position = 19 ,hidden = true)
|
|
|
+ @JsonIgnore
|
|
|
+ private String warnFlow;
|
|
|
+
|
|
|
+ private void judgeWarnWillFinished() {
|
|
|
+ if (!Boolean.TRUE.equals(this.warnWillFinished)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (CharSequenceUtil.isEmpty(this.warns)) {
|
|
|
+ this.warns = "输注即将结束;";
|
|
|
+ } else {
|
|
|
+ this.warns = this.warns + "输注即将结束;";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void judgeWarnAnalgesicPoor() {
|
|
|
+ if (!Boolean.TRUE.equals(this.warnAnalgesicPoor)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (CharSequenceUtil.isEmpty(this.warns)) {
|
|
|
+ this.warns = "镇痛不足;";
|
|
|
+ } else {
|
|
|
+ this.warns = this.warns + "镇痛不足;";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void judgeWarnLowBattery() {
|
|
|
+ if (!Boolean.TRUE.equals(this.warnLowBattery)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (CharSequenceUtil.isEmpty(this.warns)) {
|
|
|
+ this.warns = "电量偏低;";
|
|
|
+ } else {
|
|
|
+ this.warns = this.warns + "电量偏低;";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void judgeWarnFlow() {
|
|
|
+ if (this.warnFlow == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ FlowStatusEnum flow = EnumUtil.likeValueOf(FlowStatusEnum.class, this.warns);
|
|
|
+ if (ObjectUtil.isNull(flow)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (CharSequenceUtil.isEmpty(this.warns)) {
|
|
|
+ this.warns = flow.getText() + ";";
|
|
|
+ } else {
|
|
|
+ this.warns = this.warns + flow.getText() + ";";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void handleWarn() {
|
|
|
+ judgeWarnAnalgesicPoor();
|
|
|
+ judgeWarnFlow();
|
|
|
+ judgeWarnLowBattery();
|
|
|
+ judgeWarnWillFinished();
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getWarns() {
|
|
|
+ handleWarn();
|
|
|
+ if (StrUtil.isNotEmpty(warns)) {
|
|
|
+ return warns.endsWith(";") ? warns.substring(0, warns.length() - 1) : warns;
|
|
|
+ }
|
|
|
+ return warns;
|
|
|
+
|
|
|
+ }
|
|
|
}
|