package com.ruoyi.biz.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.biz.tools.Tools; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.utils.bean.BeanUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.math.BigDecimal; import java.util.Date; /** * 日统计数据对象 twin_calc_day * * @author ruoyi * @date 2024-05-22 */ @ApiModel(value = "ITwinCalcDay", description = "日统计数据") public class TwinCalcDay extends BaseEntity { private static final long serialVersionUID = 1L; /** * ID */ private Long id; /** * 时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("时间") private Date time; /** * 总米长 */ @Excel(name = "总米长") @ApiModelProperty("总米长") private BigDecimal length; /** * 总重量 */ @Excel(name = "总重量") @ApiModelProperty("总重量") private BigDecimal weight; /** * 稼动率 */ @Excel(name = "稼动率") @ApiModelProperty("稼动率") private BigDecimal efficiency; /** * 总电量 */ @Excel(name = "总电量") @ApiModelProperty("总电量") private BigDecimal kwh; /** * 告警数量 */ @Excel(name = "告警数量") @ApiModelProperty("告警数量") private Long alarm; /** * A班米长 */ @Excel(name = "A班米长") @ApiModelProperty("A班米长") private BigDecimal lengthA; /** * A班重量 */ @Excel(name = "A班重量") @ApiModelProperty("A班重量") private BigDecimal weightA; /** * A班稼动率 */ @Excel(name = "A班稼动率") @ApiModelProperty("A班稼动率") private BigDecimal efficiencyA; /** * A班开机时间 */ @Excel(name = "A班开机时间") @ApiModelProperty("A班开机时间") private BigDecimal openTimeA; /** * A班停机时间 */ @Excel(name = "A班停机时间") @ApiModelProperty("A班停机时间") private BigDecimal closeTimeA; /** * A班电量 */ @Excel(name = "A班电量") @ApiModelProperty("A班电量") private BigDecimal kwhA; /** * A班停经片停机 */ @Excel(name = "A班停经片停机") @ApiModelProperty("A班停经片停机") private Long stop1A; /** * A班CCD停机 */ @Excel(name = "A班CCD停机") @ApiModelProperty("A班CCD停机") private Long stop2A; /** * A班人工停机 */ @Excel(name = "A班人工停机") @ApiModelProperty("A班人工停机") private Long stop3A; /** * B班米长 */ @Excel(name = "B班米长") @ApiModelProperty("B班米长") private BigDecimal lengthB; /** * B班重量 */ @Excel(name = "B班重量") @ApiModelProperty("B班重量") private BigDecimal weightB; /** * B班稼动率 */ @Excel(name = "B班稼动率") @ApiModelProperty("B班稼动率") private BigDecimal efficiencyB; /** * B班开机时间 */ @Excel(name = "B班开机时间") @ApiModelProperty("B班开机时间") private BigDecimal openTimeB; /** * B班停机时间 */ @Excel(name = "B班停机时间") @ApiModelProperty("B班停机时间") private BigDecimal closeTimeB; /** * B班电量 */ @Excel(name = "B班电量") @ApiModelProperty("B班电量") private BigDecimal kwhB; /** * B班停经片停机 */ @Excel(name = "B班停经片停机") @ApiModelProperty("B班停经片停机") private Long stop1B; /** * B班CCD停机 */ @Excel(name = "B班CCD停机") @ApiModelProperty("B班CCD停机") private Long stop2B; /** * B班人工停机 */ @Excel(name = "B班人工停机") @ApiModelProperty("B班人工停机") private Long stop3B; /** * 创建人 */ @Excel(name = "创建人") @ApiModelProperty("创建人") private String createdBy; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("创建时间") private Date createdTime; /** * 更新人 */ @Excel(name = "更新人") @ApiModelProperty("更新人") private String updatedBy; /** * 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("更新时间") private Date updatedTime; /** * 从calc2hr转换为当前对象 * * @param calc2hr 2小时统计的对象 */ public void convert(TwinCalc2hr calc2hr) { BeanUtils.copyProperties(calc2hr, this); this.time = calc2hr.getDataDate(); // this.kwh = this.kwhA.add(this.kwhB); this.weight = this.weightA.add(this.weightB); this.length = this.lengthA.add(this.lengthB); this.efficiencyA = Tools.calcPercent(this.openTimeA, this.closeTimeA); this.efficiencyB = Tools.calcPercent(this.openTimeB, this.closeTimeB); BigDecimal totalOpenTime = this.openTimeA.add(this.openTimeB); BigDecimal totalCloseTime = this.closeTimeA.add(this.closeTimeB); this.efficiency = Tools.calcPercent(totalOpenTime, totalCloseTime); } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setTime(Date time) { this.time = time; } public Date getTime() { return time; } public void setLength(BigDecimal length) { this.length = length; } public BigDecimal getLength() { return length; } public void setWeight(BigDecimal weight) { this.weight = weight; } public BigDecimal getWeight() { return weight; } public void setEfficiency(BigDecimal efficiency) { this.efficiency = efficiency; } public BigDecimal getEfficiency() { return efficiency; } public void setKwh(BigDecimal kwh) { this.kwh = kwh; } public BigDecimal getKwh() { return kwh; } public void setAlarm(Long alarm) { this.alarm = alarm; } public Long getAlarm() { return alarm; } public void setLengthA(BigDecimal lengthA) { this.lengthA = lengthA; } public BigDecimal getLengthA() { return lengthA; } public void setWeightA(BigDecimal weightA) { this.weightA = weightA; } public BigDecimal getWeightA() { return weightA; } public void setEfficiencyA(BigDecimal efficiencyA) { this.efficiencyA = efficiencyA; } public BigDecimal getEfficiencyA() { return efficiencyA; } public void setOpenTimeA(BigDecimal openTimeA) { this.openTimeA = openTimeA; } public BigDecimal getOpenTimeA() { return openTimeA; } public void setCloseTimeA(BigDecimal closeTimeA) { this.closeTimeA = closeTimeA; } public BigDecimal getCloseTimeA() { return closeTimeA; } public void setKwhA(BigDecimal kwhA) { this.kwhA = kwhA; } public BigDecimal getKwhA() { return kwhA; } public void setStop1A(Long stop1A) { this.stop1A = stop1A; } public Long getStop1A() { return stop1A; } public void setStop2A(Long stop2A) { this.stop2A = stop2A; } public Long getStop2A() { return stop2A; } public void setStop3A(Long stop3A) { this.stop3A = stop3A; } public Long getStop3A() { return stop3A; } public void setLengthB(BigDecimal lengthB) { this.lengthB = lengthB; } public BigDecimal getLengthB() { return lengthB; } public void setWeightB(BigDecimal weightB) { this.weightB = weightB; } public BigDecimal getWeightB() { return weightB; } public void setEfficiencyB(BigDecimal efficiencyB) { this.efficiencyB = efficiencyB; } public BigDecimal getEfficiencyB() { return efficiencyB; } public void setOpenTimeB(BigDecimal openTimeB) { this.openTimeB = openTimeB; } public BigDecimal getOpenTimeB() { return openTimeB; } public void setCloseTimeB(BigDecimal closeTimeB) { this.closeTimeB = closeTimeB; } public BigDecimal getCloseTimeB() { return closeTimeB; } public void setKwhB(BigDecimal kwhB) { this.kwhB = kwhB; } public BigDecimal getKwhB() { return kwhB; } public void setStop1B(Long stop1B) { this.stop1B = stop1B; } public Long getStop1B() { return stop1B; } public void setStop2B(Long stop2B) { this.stop2B = stop2B; } public Long getStop2B() { return stop2B; } public void setStop3B(Long stop3B) { this.stop3B = stop3B; } public Long getStop3B() { return stop3B; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public String getCreatedBy() { return createdBy; } public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } public Date getCreatedTime() { return createdTime; } public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } public String getUpdatedBy() { return updatedBy; } public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } public Date getUpdatedTime() { return updatedTime; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("time", getTime()) .append("length", getLength()) .append("weight", getWeight()) .append("efficiency", getEfficiency()) .append("kwh", getKwh()) .append("alarm", getAlarm()) .append("lengthA", getLengthA()) .append("weightA", getWeightA()) .append("efficiencyA", getEfficiencyA()) .append("openTimeA", getOpenTimeA()) .append("closeTimeA", getCloseTimeA()) .append("kwhA", getKwhA()) .append("stop1A", getStop1A()) .append("stop2A", getStop2A()) .append("stop3A", getStop3A()) .append("lengthB", getLengthB()) .append("weightB", getWeightB()) .append("efficiencyB", getEfficiencyB()) .append("openTimeB", getOpenTimeB()) .append("closeTimeB", getCloseTimeB()) .append("kwhB", getKwhB()) .append("stop1B", getStop1B()) .append("stop2B", getStop2B()) .append("stop3B", getStop3B()) .append("createdBy", getCreatedBy()) .append("createdTime", getCreatedTime()) .append("updatedBy", getUpdatedBy()) .append("updatedTime", getUpdatedTime()) .append("remark", getRemark()) .toString(); } }