pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmWorkReportHistory.java
@@ -5,7 +5,12 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1;
import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCd84Vo;
import com.dy.common.mw.protocol.p206V202404.DataV202404;
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd80_5BVo;
import com.dy.common.po.BaseEntity;
import com.dy.common.util.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@@ -13,20 +18,19 @@
import java.util.Date;
/**
 * @Author liurunyu
 * @Date 2024/2/28 8:52
 * @LastEditTime 2024/2/28 8:52
 * @Description 终端工作报历史数据
 * @Author: liurunyu
 * @Date: 2024/6/14 10:58
 * @Description 终端阀开工作报历史数据
 */
@TableName(value="rm_work_report_history", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "终端工作报历史数据")
public class RmWorkReportHistory  implements BaseEntity {
@Schema(name = "终端阀开工作报历史数据")
public class RmWorkReportHistory implements BaseEntity {
    public static final long serialVersionUID = 202402280859001L;
    /**
     * 主键
@@ -36,6 +40,18 @@
    @TableId(type = IdType.INPUT)
    public Long id;
    /**
     * 农户实体ID(外键)
     */
    @Schema(description = "农户实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long clientId;
    /**
     * 农户姓名
     */
    @Schema(description = "农户姓名", requiredMode = Schema.RequiredMode.REQUIRED)
    public String clientName;
    /**
     * 控制器实体ID(外键)
     */
@@ -71,28 +87,235 @@
    public Date rtuDt;
    /**
     * 订单号(16位数字)
     */
    @Schema(hidden=true)
    @JSONField(serialize = false)
    public String orderNo;
    /**
     * IC卡地址(远程开泵/阀时全为0)
     */
    @Schema(description = "IC卡地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public String icCardAddr;
    /**
     * IC卡编号
     */
    @Schema(description = "IC卡编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public String icCardNo;
    /**
     * 累计流量
     * 水位(单位0.001米)
     */
    @Schema(description = "累计流量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double totalAmount;
    @Schema(description = "水位(单位0.001米)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterLevel;
    /**
     * 瞬时流量
     * 水压(单位0.01千帕)
     */
    @Schema(description = "瞬时流量(m3/h)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double instantAmount;
    @Schema(description = "水压(单位0.01千帕)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterPress;
    /**
     * 剩余金额
     * 瞬时流量(单位0.01m3/小时)
     */
    @Schema(description = "剩余蒂金额(元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double remainMoney;
    @Schema(description = "瞬时流量(单位0.01m3/小时)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterInstant;
    /**
     * 水表累计流量(单位0.01m3)
     */
    @Schema(description = "水表累计流量(单位0.01m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterTotal;
    /**
     * 电表累计电量(单位0.01度)
     */
    @Schema(description = "电表累计电量(单位0.01度)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double eleTotal;
    /**
     * 用户剩余金额(单位0.01元)
     */
    @Schema(description = "用户剩余金额(单位0.01元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double moneyRemain;
    /**
     * 用户剩余水量(单位0.01m3)
     */
    @Schema(description = "用户剩余水量(单位0.01m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterRemain;
    /**
     * 本次使用电量(单位0.01度)
     */
    @Schema(description = "本次使用电量(单位0.01度)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double thisEle;
    /**
     * 本次使用水量(单位0.01m3)
     */
    @Schema(description = "本次使用水量(单位0.01m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double thisWater;
    /**
     * 本次使用金额(单位0.01元)
     */
    @Schema(description = "本次使用金额(单位0.01元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double thisMoney;
    /**
     * 本次使用时长(单位:分钟  最大9999分钟)
     */
    @Schema(description = "本次使用时长(单位:分钟  最大9999分钟)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Integer thisDuration;
    /**
     * 当前水量单价(单位0.01元 最大99.99元)
     */
    @Schema(description = "当前水量单价(单位0.01元 最大99.99元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterPrice;
    /**
     * 当前电量单价(单位0.01元 最大99.99元)
     */
    @Schema(description = "当前电量单价(单位0.01元 最大99.99元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double elePrice;
    /**
     * 交流A相电压(单位0.1伏特)
     */
    @Schema(description = "交流A相电压(单位0.1伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double aVolt;
    /**
     * 交流B相电压(单位0.1伏特)
     */
    @Schema(description = "交流B相电压(单位0.1伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double bVolt;
    /**
     * 交流C相电压(单位0.1伏特)
     */
    @Schema(description = "交流C相电压(单位0.1伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double cVolt;
    /**
     * 交流A相电流(单位0.1安培)
     */
    @Schema(description = "交流A相电流(单位0.1安培)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double aCurrent;
    /**
     * 交流B相电流数据(单位0.1安培)
     */
    @Schema(description = "交流B相电流数据(单位0.1安培)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double bCurrent;
    /**
     * 交流C相电流(单位0.1安培)
     */
    @Schema(description = "交流C相电流(单位0.1安培)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double cCurrent;
    /**
     * 后备电池电压(单位0.01伏特)
     */
    @Schema(description = "后备电池电压(单位0.01伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double batteryVolt;
    /**
     * 水表远传电压(单位0.01伏特)
     */
    @Schema(description = "水表远传电压(单位0.01伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterMeterTransVolt;
    /**
     * 水表工作电压(单位0.01伏特)
     */
    @Schema(description = "水表工作电压(单位0.01伏特)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double waterMeterWorkVolt;
    public void valueFrom(DataV202404 dataV202404, DataCd80_5BVo cdData) throws Exception{
        this.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataV202404.dt);
        this.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt);
        this.orderNo = cdData.orderNo ;
        this.icCardAddr = cdData.icCardAddr ;
        this.icCardNo = cdData.icCardNo ;
        this.waterLevel = cdData.waterLevel ;
        this.waterPress = cdData.waterPress ;
        this.waterInstant = cdData.waterInstant ;
        this.waterTotal = cdData.waterTotal ;
        this.eleTotal = cdData.eleTotal ;
        this.moneyRemain = cdData.moneyRemain ;
        this.waterRemain = cdData.waterRemain ;
        this.thisEle = cdData.thisEle ;
        this.thisWater = cdData.thisWater ;
        this.thisMoney = cdData.thisMoney ;
        this.thisDuration = cdData.thisDuration ;
        this.waterPrice = cdData.waterPrice ;
        this.elePrice = cdData.elePrice ;
        this.aVolt = cdData.aVolt ;
        this.bVolt = cdData.bVolt ;
        this.cVolt = cdData.cVolt ;
        this.aCurrent = cdData.aCurrent ;
        this.bCurrent = cdData.bCurrent ;
        this.cCurrent = cdData.cCurrent ;
        this.batteryVolt = cdData.batteryVolt ;
        this.waterMeterTransVolt = cdData.waterMeterTransVolt ;
        this.waterMeterWorkVolt = cdData.waterMeterWorkVolt ;
    }
    public void valueFrom(DataV1_0_1 dV1_0_1, DataCd84Vo cdData) throws Exception{
        this.dt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1_0_1.dt);
        this.rtuDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt);
        //this.orderNo = cdData.orderNo ;
        this.icCardAddr = cdData.cardAddr ;
        this.icCardNo = cdData.cardNo ;
        //this.waterLevel = cdData.waterLevel ;
        //this.waterPress = cdData.waterPress ;
        this.waterInstant = cdData.instantAmount ;
        this.waterTotal = cdData.totalAmount ;
        //this.eleTotal = cdData.eleTotal ;
        this.moneyRemain = cdData.remainMoney ;
        //this.waterRemain = cdData.waterRemain ;
        //this.thisEle = cdData.thisEle ;
        //this.thisWater = cdData.thisWater ;
        //this.thisMoney = cdData.thisMoney ;
        //this.thisDuration = cdData.thisDuration ;
        //this.waterPrice = cdData.waterPrice ;
        //this.elePrice = cdData.elePrice ;
        //this.aVolt = cdData.aVolt ;
        //this.bVolt = cdData.bVolt ;
        //this.cVolt = cdData.cVolt ;
        //this.aCurrent = cdData.aCurrent ;
        //this.bCurrent = cdData.bCurrent ;
        //this.cCurrent = cdData.cCurrent ;
        //this.batteryVolt = cdData.batteryVolt ;
        //this.waterMeterTransVolt = cdData.waterMeterTransVolt ;
        //this.waterMeterWorkVolt = cdData.waterMeterWorkVolt ;
    }
}