From 1f46976c9ee72d7889fceee968db9c8aef885eca Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 28 十月 2024 17:28:15 +0800 Subject: [PATCH] 远程监控中开关阀记录查询重构,增加了水价信息,调整了显示内容,优化SQL语句,开闭阀类型改为通信协议中的Common*.*.java中的统一匹配。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataAlarmVo.java | 80 +++++++++++++++++++++++++++++++++++---- 1 files changed, 71 insertions(+), 9 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataAlarmVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataAlarmVo.java index c4cb401..bc263ac 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataAlarmVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/upVos/DataAlarmVo.java @@ -1,28 +1,90 @@ package com.dy.common.mw.protocol.p206V1_0_0.upVos; +import com.dy.common.mw.protocol.UpDataVo; import lombok.Data; @Data -public class DataAlarmVo { +public class DataAlarmVo implements UpDataVo { public Byte batteryVolt ;// 钃勭數姹犵數鍘� public Byte loss ;//婕忔崯 - public Byte meter ;//浠〃 + public Byte meter ;//娴侀噺璁℃晠闅� public Byte valve ;//闃�闂� + public boolean hasAlarm(){ + boolean flag = false ; + if((batteryVolt != null && batteryVolt == 1) || + (loss != null && loss == 1) || + (meter != null && meter == 1) || + (valve != null && valve == 1)){ + flag = true ; + } + return flag ; + } + + + public boolean hasAlarmExcludeLoss(){ + boolean flag = false ; + if((batteryVolt != null && batteryVolt == 1) || + (meter != null && meter == 1) || + (valve != null && valve == 1)){ + flag = true ; + } + return flag ; + } + + public String alarmContent(){ + String txt = "" ; + boolean hasTxt = false ; + if(batteryVolt != null && batteryVolt == 1){ + txt += (hasTxt?"銆�":"") + "钃勭數姹犵數鍘嬫姤璀�" ; + hasTxt = true ; + } + if(meter != null && meter == 1){ + txt += (hasTxt?"銆�":"") + "娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(valve != null && valve == 1){ + txt += (hasTxt?"銆�":"") + "闃�闂ㄦ晠闅滄姤璀�" ; + hasTxt = true ; + } + if(loss != null && loss == 1){ + txt += (hasTxt?"銆�":"") + "婕忔崯鎶ヨ" ; + hasTxt = true ; + } + return txt ; + } + + public String alarmContentExcludeLoss(){ + String txt = "" ; + boolean hasTxt = false ; + if(batteryVolt != null && batteryVolt == 1){ + txt += (hasTxt?"銆�":"") + "钃勭數姹犵數鍘嬫姤璀�" ; + hasTxt = true ; + } + if(meter != null && meter == 1){ + txt += (hasTxt?"銆�":"") + "娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(valve != null && valve == 1){ + txt += (hasTxt?"銆�":"") + "闃�闂ㄦ晠闅滄姤璀�" ; + hasTxt = true ; + } + return txt ; + } public String toString(){ StringBuilder str = new StringBuilder() ; str.append(" 鎶ヨ:\n"); str.append(" 钃勭數姹犵數鍘嬶細"); - str.append(batteryVolt==null?"":(batteryVolt==1?"鎶ヨ":"姝e父")); + str.append(batteryVolt==null?"":(batteryVolt==1?"鎶ヨ(1)":"姝e父(0)")); str.append("\n"); - str.append(" 婕忔崯锛�"); - str.append(loss==null?"":(loss==1?"鎶ヨ":"姝e父")); + str.append(" 婕忔崯锛� "); + str.append(loss==null?"":(loss==1?"鎶ヨ(1)":"姝e父(0)")); str.append("\n"); - str.append(" 浠〃锛�"); - str.append(meter==null?"":(meter==1?"鎶ヨ":"姝e父")); + str.append(" 娴侀噺璁℃晠闅滐細"); + str.append(meter==null?"":(meter==1?"鎶ヨ(1)":"姝e父(0)")); str.append("\n"); - str.append(" 闃�闂細"); - str.append(valve==null?"":(valve==1?"鎶ヨ":"姝e父")); + str.append(" 闃�闂細 "); + str.append(valve==null?"":(valve==1?"鎶ヨ(1)":"姝e父(0)")); return str.toString() ; } } -- Gitblit v1.8.0