| package com.dy.common.mw.protocol4Mqtt.pSdV1.upVos; | 
|   | 
| import com.alibaba.fastjson2.annotation.JSONField; | 
| import com.dy.common.mw.protocol4Mqtt.Vo4Up; | 
| import com.dy.common.util.DateTime; | 
| import lombok.Data; | 
|   | 
| /** | 
|  * @Author: liurunyu | 
|  * @Date: 2025/6/10 10:05 | 
|  * @Description | 
|  */ | 
| @Data | 
| public class ManureVo implements Vo4Up { | 
|     @JSONField(name = "flexem_message_id") | 
|     public Integer messageId ;//消息ID | 
|   | 
|     public Integer no ;//测站编号,其不在JSON数据中,其在主题中 | 
|   | 
|     /** | 
|      * 搅拌机1是否运行;(水肥机还可存在搅拌机2、搅拌机3、搅拌机4 ......) 运行时1,停止0. | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌运行1", "stirRunning1"}) | 
|     public Byte stirRunning1;//搅拌1运行状态 | 
|     /** | 
|      * 搅拌机2是否运行;(水肥机还可存在搅拌机2、搅拌机3、搅拌机4 ......) 运行时1,停止0. | 
|      * (当前大禹应用不存在) | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌运行2", "stirRunning2"}) | 
|     public Byte stirRunning2;//搅拌2运行状态 | 
|     /** | 
|      * 搅拌机3是否运行;(水肥机还可存在搅拌机2、搅拌机3、搅拌机4 ......) 运行时1,停止0. | 
|      * (当前大禹应用不存在) | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌运行3", "stirRunning3"}) | 
|     public Byte stirRunning3;//搅拌3运行状态 | 
|     /** | 
|      * 搅拌机4是否运行;(水肥机还可存在搅拌机2、搅拌机3、搅拌机4 ......) 运行时1,停止0. | 
|      * (当前大禹应用不存在) | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌运行4", "stirRunning4"}) | 
|     public Byte stirRunning4;//搅拌4运行状态 | 
|   | 
|     /** | 
|      * 一个水肥机只有一个注肥泵 | 
|      */ | 
|     @JSONField(alternateNames = {"注肥运行", "injectRunning"}) | 
|     public Byte injectRunning ;//注肥运行状态 | 
|   | 
|   | 
|     @JSONField(alternateNames = {"灌溉运行", "irrRunning"}) | 
|     public Byte irrRunning ;//灌溉运行状态 | 
|   | 
|     /** | 
|      *  1:注肥泵有故障。0:注肥泵没有故障 | 
|      */ | 
|     @JSONField(alternateNames = {"报警", "alarm"}) | 
|     public Byte alarm ;//注肥泵故障 | 
|   | 
|     /** | 
|      * 肥料流量,单位升 | 
|      */ | 
|     @JSONField(alternateNames = {"肥料流量", "manureFlow"}) | 
|     public Float manureFlow ; | 
|   | 
|     /** | 
|      * 单位秒 | 
|      */ | 
|     @JSONField(alternateNames = {"注肥经过时间", "manureTime"}) | 
|     public Integer manureTime ; | 
|   | 
|     /** | 
|      * 单位秒 | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌经过时间", "stirTime"}) | 
|     public Integer stirTime ; | 
|   | 
|     /** | 
|      * 单位秒 | 
|      */ | 
|     @JSONField(alternateNames = {"搅拌设定时间", "stirDuration"}) | 
|     public Integer stirDuration ; | 
|   | 
|     /** | 
|      * 单位秒 | 
|      */ | 
|     @JSONField(alternateNames = {"注肥设定时间", "injectDuration"}) | 
|     public Integer injectDuration ; | 
|   | 
|     @JSONField(name = "flexem_timestamp") | 
|     public Long devDt ;//设备时间 | 
|   | 
|     public String devDtStr ;//设备时间 | 
|   | 
|     @Override | 
|     public void setNo(Integer no ){ | 
|         this.no = no ; | 
|     } | 
|   | 
|     public String getDevDtStr() { | 
|         if(devDt != null){ | 
|             return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ; | 
|         }else{ | 
|             return "" ; | 
|         } | 
|     } | 
|   | 
|     public boolean stateIsChanged(ManureVo compareVo){ | 
|         if(this.stirRunning1 != null && compareVo.stirRunning1 != null && this.stirRunning1.byteValue() != compareVo.stirRunning1.byteValue()){ | 
|            return true ; | 
|         } | 
|         if(this.stirRunning2 != null && compareVo.stirRunning2 != null && this.stirRunning2.byteValue() != compareVo.stirRunning2.byteValue()){ | 
|             return true ; | 
|         } | 
|         if(this.stirRunning3 != null && compareVo.stirRunning3 != null && this.stirRunning3.byteValue() != compareVo.stirRunning3.byteValue()){ | 
|             return true ; | 
|         } | 
|         if(this.stirRunning4 != null && compareVo.stirRunning4 != null && this.stirRunning4.byteValue() != compareVo.stirRunning4.byteValue()){ | 
|             return true ; | 
|         } | 
|         if(this.injectRunning != null && compareVo.injectRunning != null && this.injectRunning.byteValue() != compareVo.injectRunning.byteValue()){ | 
|             return true ; | 
|         } | 
|         if(this.irrRunning != null && compareVo.irrRunning != null && this.irrRunning.byteValue() != compareVo.irrRunning.byteValue()){ | 
|             return true ; | 
|         } | 
|         if(this.alarm != null && compareVo.alarm != null && this.alarm.byteValue() != compareVo.alarm.byteValue()){ | 
|             return true ; | 
|         } | 
|         return false ; | 
|     } | 
|   | 
|     @Override | 
|     public String toString(){ | 
|         StringBuilder sb = new StringBuilder(); | 
|         sb.append("水肥数据=>") ; | 
|         sb.append(" 消息ID:" + messageId + ", ") ; | 
|         sb.append(" 搅拌运行1:" + stirRunning1 + ", ") ; | 
|         sb.append(" 搅拌运行2:" + stirRunning2 + ", ") ; | 
|         sb.append(" 搅拌运行3:" + stirRunning3 + ", ") ; | 
|         sb.append(" 搅拌运行4:" + stirRunning4 + ", ") ; | 
|         sb.append(" 注肥运行:" + injectRunning + ", ") ; | 
|         sb.append(" 灌溉运行:" + irrRunning + ", ") ; | 
|         sb.append(" 报警:" + alarm + ", ") ; | 
|         sb.append(" 肥料流量:" + manureFlow + ", ") ; | 
|         sb.append(" 注肥经过时间:" + manureTime + ", ") ; | 
|         sb.append(" 搅拌经过时间:" + stirTime + ", ") ; | 
|         sb.append(" 注肥设定时间:" + injectDuration + ", ") ; | 
|         sb.append(" 搅拌设定时间:" + stirDuration + ", ") ; | 
|         sb.append(" 设备时间:" + devDt + ", ") ; | 
|         sb.append(" 设备时间:" +  this.getDevDtStr()) ; | 
|         sb.append("\n") ; | 
|         return sb.toString() ; | 
|     } | 
|   | 
| } |