ResponseSchedulingDto.java 3.31 KB
package com.ruoyi.pojo.response;

import com.ruoyi.utils.DateUtil;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * Auto-generated: 2023-07-05 21:23:27
 *
 * @author json.cn (i@json.cn)
 * @website http://www.json.cn/java2pojo/
 */
@Data
public class ResponseSchedulingDto implements Serializable {

    private static final long serialVersionUID = -3L;

    private Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date scheduleDate;
    private String lineName;
    private String lineCode;
    private String jobCode;
    private String posts;
    private String lpName;
    private String nbbm;
    private String jsy;
    private String spy;
    private String upDown;
    private String qdzCode;
    private String qdzName;
    private String zdzCode;
    private String zdzName;
    private Long fcsjT;
    private Long dfsjT;
    private Long zdsjT;
    private Long fcsjActualTime;
    private Long zdsjActualTime;
    private Double jhlc;
    private Double jhlcOrig;
    private Integer bcsj;
    private String bcType;
    private Integer status;
    private String adjustExps;
    private Boolean sflj;
    private String remarks;
    private List<CTasks> cTasks;
    private String name;


    private String fcsj;
    private Integer dfsj;
    private String scheduleDateStr;


    public void setScheduleDateStr(Object scheduleDateStr) {
        if (Objects.nonNull(scheduleDateStr)) {
            this.scheduleDateStr = scheduleDateStr.toString();
            try {
                scheduleDate = DateUtil.YYYY_MM_DD_LINK.parse(this.scheduleDateStr);
            } catch (ParseException e) {
                throw new RuntimeException(e);
            }

        }

    }

    public Long getfcsjTValue() {
        if (Objects.nonNull(fcsjT) && fcsjT >0) {
            return fcsjT;
        }

        if (StringUtils.isNotEmpty(fcsj) && StringUtils.isNotEmpty(this.scheduleDateStr)) {
            String dateStr = StringUtils.join(this.scheduleDateStr, " ", fcsj);
            try {
                Date date = DateUtil.YYYY_MM_DD_LINK_HH_MM.parse(dateStr);
                fcsjT = date.getTime();
                return fcsjT;
            } catch (ParseException e) {
                throw new RuntimeException(e);
            }
        }
        return null;
    }

    public Long getzdsjTTValue() {
        if (Objects.nonNull(zdsjT) && zdsjT >0) {
            return zdsjT;
        }

        if(Objects.nonNull(bcsj)){
            Long value = getfcsjTValue();
            zdsjT = value+bcsj*60000;
            return zdsjT;
        }
        return null;
    }

//    public  String getJobCode(){
//        if(StringUtils.isEmpty(this.jobCode) && StringUtils.isNotEmpty(this.jsy)){
//            this.jobCode = StringUtils.substringBeforeLast(this.jsy,"/");
//        }
//        return this.jobCode;
//    }
//
//    public String getName(){
//        if(StringUtils.isEmpty(this.name) && StringUtils.isNotEmpty(this.jsy)){
//            this.name = StringUtils.substringAfterLast(this.jsy,"/");
//        }
//        return this.name;
//    }


    public void setUpDowm(String upDowm){
        this.upDown = upDowm;
    }


}