From 346288bc38bdab442721d7609caed86d03b9d2d4 Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Tue, 26 Sep 2023 19:25:24 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wb' into qa --- screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java | 122 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 122 insertions(+), 0 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java new file mode 100644 index 0000000..3264fd6 --- /dev/null +++ b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java @@ -0,0 +1,122 @@ +package com.moral.api.pojo.vo.allocation; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.moral.api.pojo.enums.AllocationApproveEnum; +import com.moral.api.pojo.ext.allocation.AllocationPageExt; +import com.moral.api.utils.BeanConverts; +import com.moral.util.DateUtils; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * <p> + * ��������� + * </p> + * deyt template generate + * @author JI + * @since 2023-09-25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="Allocation - ������VO������", description="Allocation - ������VO������") +public class AllocationPageVo implements Serializable { + + + @ApiModelProperty(value = "������id") + private Integer allocationId; + + @ApiModelProperty(value = "������������") + private String allocationNum; + + @ApiModelProperty(value = "������������") + @JsonFormat(pattern="yyyy-MM-dd") + private Date escalationTime; + + @ApiModelProperty(value = "������������id") + private Integer unitId; + + @ApiModelProperty(value = "������������id") + private Integer polluteType; + + @ApiModelProperty(value = "������������id") + private Integer changeType; + + @ApiModelProperty(value = "������������") + private Integer changeDay; + + @ApiModelProperty(value = "������������") + private Integer residueDay; + + @ApiModelProperty(value = "������������id") + private Integer escalationUnitId; + + @ApiModelProperty(value = "���������") + private String escalationName; + + @ApiModelProperty(value = "������������id") + private Integer investigationType; + + @ApiModelProperty(value = "������") + private Integer state; + + @ApiModelProperty(value = "������������") + private Integer isInvalid; + + @ApiModelProperty(value = "���������id") + private Integer createId; + + @ApiModelProperty(value = "���������������") + private String createName; + + @ApiModelProperty(value = "������������") + @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date createTime; + + @ApiModelProperty(value = "���������id") + private Integer updateId; + + @ApiModelProperty(value = "���������������") + private String updateName; + + @ApiModelProperty(value = "������������") + @JsonFormat(pattern="yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date updateTime; + + @ApiModelProperty(value = "������������������") + private Integer applyState; + + + public static AllocationPageVo convert(AllocationPageExt allocationPageExt) { + AllocationPageVo allocationPageVo = BeanConverts.convert(allocationPageExt, AllocationPageVo.class); + return allocationPageVo; + } + + public static List<AllocationPageVo> convert(List<AllocationPageExt> allocationPageExtList) { + return allocationPageExtList.stream().map(AllocationPageVo::convert).collect(Collectors.toList()); + } + + public Integer getResidueDay() { + int day = this.changeDay; + if(AllocationApproveEnum.UNDER_RECTIFICATION.value.equals(state)){ + Date date = new Date(); + int days = DateUtils.getDays(escalationTime, date); + return day-days; + } + return day; + } + + public Integer getApplyState() { + return Objects.isNull(applyState)?0:applyState; + } +} -- Gitblit v1.8.0