package cn.estsh.i3plus.ext.mes.pojo.model.jx;

import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @DESCRIPTION:
 * @USER: wangjie
 * @DATE: 2022-11-01 15:54
 */
@Data
@ApiModel("嘉兴时段合并MODEL")
public class JxMergeTimeSlotsModel implements Serializable {

    private static final long serialVersionUID = 2947166834890286384L;

    private String startTime;
    private String endTime;

    private Date startDate;
    private Date endDate;

    public JxMergeTimeSlotsModel convertTime(String startTime, String endTime, SimpleDateFormat simpleDateFormat) {
        this.startTime = startTime;
        this.endTime = endTime;
        try {
            this.startDate = simpleDateFormat.parse(startTime);
            this.endDate = simpleDateFormat.parse(endTime);
        } catch (ParseException e) {
        }
        return this;
    }

    public JxMergeTimeSlotsModel mergeEnd(String endTime, Date endDate) {
        this.endTime = endTime;
        this.endDate = endDate;
        return this;
    }

}
