package com.sw.mes.itemclean.clean.dto.batchNoOperate;

import com.sw.mes.core.enums.ItemCleanEnums;
import lombok.Getter;

/**
 * @author liuzemin
 * @date 2022/12/26 9:01
 * @description
 */
@Getter
public class BatchNoOperate {

    private ItemCleanEnums.BatchType batchType;

    private ItemCleanEnums.MaterialResource materialResource;

    private String materialCode; //物料编码

    public BatchNoOperate(ItemCleanEnums.BatchType batchType, ItemCleanEnums.MaterialResource materialResource, String materialCode) {
        if (batchType.getKey() == ItemCleanEnums.BatchType.原料生产.getKey()){
            throw new RuntimeException("该构造方法不能传【原料生产】");
        }
        this.batchType = batchType;
        this.materialResource = materialResource;
        this.materialCode = materialCode;
    }

    public BatchNoOperate(ItemCleanEnums.BatchType batchType, String materialCode) {
        if (batchType.getKey() != ItemCleanEnums.BatchType.原料生产.getKey()){
            throw new RuntimeException("该构造方法只能传【原料生产】");
        }
        this.batchType = batchType;
        this.materialCode = materialCode;
    }
}
