package com.rongwei.bsentity.vo;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 工步，工艺路线里的工步
 */
public class ProductionProcesses{

    private String id;

    public ProductionProcesses(){

    }

    public ProductionProcesses(String id, String equipmentType, List<ProduceOrder> produceOrder, Integer produceTime) {
        this.id = id;
        this.equipmentType = equipmentType;
        this.produceOrder = produceOrder;
        this.produceTime = produceTime;
    }

    /**
     * 业务表订单工序ID
     */
    private List<String> bsProcessesId;

    /**
     * 可选设备ID
     */
    private List<String> optionalEquipments;

    /**
     * 设备类型
     */
    private String equipmentType;

    /**
     * 工步生产时的设备
     */
    private String equipmentId;

    /**
     * 工步生产时的设备
     */
    private Equipment equipment;

    /**
     * 工序类型
     */
    private String processType;

    /**
     * 所属的生产订单
     */
    private List<ProduceOrder> produceOrder;

    /**
     * 是否瓶颈工序
     */
    private Boolean bottleneck;

    /**
     * 合并生产标识，同样的合并生产标识，尽量一起生产
     */
    private String mergeProcessMark;

    /**
     * 连续生产标识
     */
    private String seriesProduceMark;

    /**
     * 工序流转时间
     */
    private Integer circulationTime;

    /**
     * 下一步工序最小等待生产时间
     */
    private Integer minWaitTime;

    /**
     * 下一步工序最大等待生产时间
     */
    private Integer maxWaitTime;

    /**
     * 当前工步的生产时间(单位是分钟)
     */
    private Integer produceTime;

    /**
     * 加工数量
     */
    private BigDecimal produceNum;

    /**
     * 单批次生产时间
     */
    private Integer unitProduceTime;
    /**
     * 单卷宽度
     */
    private BigDecimal volumeWidth;
    // 单卷厚度
    private BigDecimal volumeThickness;

    /**
     * 单卷重
     */
    private BigDecimal singlerollweight;
    /**
     * 生产批次数量
     */
    private Integer producePcNum;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 上一个工步
     */
    private List<ProductionProcesses> previousProcesses;
    /**
     * 上一个工步ID
     */
    private List<String> previousProcessesIds;

    /**
     * 下一个工步
     */
    private List<ProductionProcesses> nextProcesses;
    /**
     * 下一个工步ID
     */
    private List<String> nextProcessesIds;

    /**
     * 加工铝卷的集合
     */
    private List<AluminumCoil> aluminumCoils;

    /**
     * 是否冲突
     */
    private String hasConflict;

    /**
     * 冲突等级
     * hard：强制冲突
     * soft：非强制冲突
     */
    private String conflictLevel;

    /**
     * 非强制冲突描述
     */
    private String softconflictdes;

    /**
     * 冲突描述
     */
    private String conflictDes;

    /**
     * 上机准备时间（单位：分钟）
     */
    private Integer prepressworkmin;
    /**
     * 下机收尾时间（单位：分钟）
     */
    private Integer cutfinishmin;

    /**
     * 是否锁定，锁定的工序开始时间、结束时间需要初始化，参与排程但开始时间、结束时间、以及设备占用不会变化
     */
    private boolean ifLock;

    /**
     * 是否合并工序
     */
    private boolean mergeProcesses;

    /**
     * 合金
     */
    private String volumeMetal;

    // 合金状态
    private String volumeMetalstate;

    public String getEquipmentType() {
        return equipmentType;
    }

    public void setEquipmentType(String equipmentType) {
        this.equipmentType = equipmentType;
    }

    public Equipment getEquipment() {
        return equipment;
    }

    public void setEquipment(Equipment equipment) {
        this.equipment = equipment;
    }

    public String getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(String equipmentId) {
        this.equipmentId = equipmentId;
    }

    public Integer getProduceTime() {
        return produceTime;
    }

    public void setProduceTime(Integer produceTime) {
        this.produceTime = produceTime;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
        if(startTime != null){
            this.endTime = startTime.plusMinutes(produceTime);
        }
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public List<ProductionProcesses> getPreviousProcesses() {
        return previousProcesses;
    }

    public void setPreviousProcesses(List<ProductionProcesses> previousProcesses) {
        this.previousProcesses = previousProcesses;
    }

    public List<ProductionProcesses> getNextProcesses() {
        return nextProcesses;
    }

    public void setNextProcesses(List<ProductionProcesses> nextProcesses) {
        this.nextProcesses = nextProcesses;
    }

    public List<ProduceOrder> getProduceOrder() {
        return produceOrder;
    }

    public void setProduceOrder(List<ProduceOrder> produceOrder) {
        this.produceOrder = produceOrder;
    }

    public Integer getCirculationTime() {
        return circulationTime;
    }

    public void setCirculationTime(Integer circulationTime) {
        this.circulationTime = circulationTime;
    }

    public Integer getMinWaitTime() {
        return minWaitTime;
    }

    public void setMinWaitTime(Integer minWaitTime) {
        this.minWaitTime = minWaitTime;
    }

    public Integer getMaxWaitTime() {
        return maxWaitTime;
    }

    public void setMaxWaitTime(Integer maxWaitTime) {
        this.maxWaitTime = maxWaitTime;
    }

    public Boolean getBottleneck() {
        return bottleneck;
    }

    public void setBottleneck(Boolean bottleneck) {
        this.bottleneck = bottleneck;
    }

    public String getMergeProcessMark() {
        return mergeProcessMark;
    }

    public void setMergeProcessMark(String mergeProcessMark) {
        this.mergeProcessMark = mergeProcessMark;
    }

    public List<String> getPreviousProcessesIds() {
        return previousProcessesIds;
    }

    public void setPreviousProcessesIds(List<String> previousProcessesIds) {
        this.previousProcessesIds = previousProcessesIds;
    }

    public List<String> getNextProcessesIds() {
        return nextProcessesIds;
    }

    public void setNextProcessesIds(List<String> nextProcessesIds) {
        this.nextProcessesIds = nextProcessesIds;
    }

    public List<String> getBsProcessesId() {
        return bsProcessesId;
    }

    public void setBsProcessesId(List<String> bsProcessesId) {
        this.bsProcessesId = bsProcessesId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public List<String> getOptionalEquipments() {
        return optionalEquipments;
    }

    public void setOptionalEquipments(List<String> optionalEquipments) {
        this.optionalEquipments = optionalEquipments;
    }

    public List<AluminumCoil> getAluminumCoils() {
        return aluminumCoils;
    }

    public void setAluminumCoils(List<AluminumCoil> aluminumCoils) {
        this.aluminumCoils = aluminumCoils;
    }

    public BigDecimal getProduceNum() {
        return produceNum;
    }

    public void setProduceNum(BigDecimal produceNum) {
        this.produceNum = produceNum;
    }

    public Integer getUnitProduceTime() {
        return unitProduceTime;
    }

    public void setUnitProduceTime(Integer unitProduceTime) {
        this.unitProduceTime = unitProduceTime;
    }

    public Integer getProducePcNum() {
        return producePcNum;
    }

    public void setProducePcNum(Integer producePcNum) {
        this.producePcNum = producePcNum;
    }

    public String getProcessType() {
        return processType;
    }

    public void setProcessType(String processType) {
        this.processType = processType;
    }

    public String getSeriesProduceMark() {
        return seriesProduceMark;
    }

    public void setSeriesProduceMark(String seriesProduceMark) {
        this.seriesProduceMark = seriesProduceMark;
    }

    public String getHasConflict() {
        return hasConflict;
    }

    public void setHasConflict(String hasConflict) {
        this.hasConflict = hasConflict;
    }

    public String getConflictDes() {
        return conflictDes;
    }

    public void setConflictDes(String conflictDes) {
        this.conflictDes = conflictDes;
    }

    public String getConflictLevel() {
        return conflictLevel;
    }

    public void setConflictLevel(String conflictLevel) {
        this.conflictLevel = conflictLevel;
    }

    public String getSoftconflictdes() {
        return softconflictdes;
    }

    public void setSoftconflictdes(String softconflictdes) {
        this.softconflictdes = softconflictdes;
    }

    public Integer getPrepressworkmin() {
        return prepressworkmin;
    }

    public void setPrepressworkmin(Integer prepressworkmin) {
        this.prepressworkmin = prepressworkmin;
    }

    public Integer getCutfinishmin() {
        return cutfinishmin;
    }

    public void setCutfinishmin(Integer cutfinishmin) {
        this.cutfinishmin = cutfinishmin;
    }

    public boolean isIfLock() {
        return ifLock;
    }

    public void setIfLock(boolean ifLock) {
        this.ifLock = ifLock;
    }

    public boolean isMergeProcesses() {
        return mergeProcesses;
    }

    public void setMergeProcesses(boolean mergeProcesses) {
        this.mergeProcesses = mergeProcesses;
    }

    public String getVolumeMetal() {
        return volumeMetal;
    }

    public void setVolumeMetal(String volumeMetal) {
        this.volumeMetal = volumeMetal;
    }

    public BigDecimal getVolumeWidth() {
        return volumeWidth;
    }

    public void setVolumeWidth(BigDecimal volumeWidth) {
        this.volumeWidth = volumeWidth;
    }

    public BigDecimal getSinglerollweight() {
        return singlerollweight;
    }

    public void setSinglerollweight(BigDecimal singlerollweight) {
        this.singlerollweight = singlerollweight;
    }

    public String getVolumeMetalstate() {
        return volumeMetalstate;
    }

    public void setVolumeMetalstate(String volumeMetalstate) {
        this.volumeMetalstate = volumeMetalstate;
    }

    public BigDecimal getVolumeThickness() {
        return volumeThickness;
    }

    public void setVolumeThickness(BigDecimal volumeThickness) {
        this.volumeThickness = volumeThickness;
    }
}
