package cn.estsh.i3plus.ext.mes.pcn.pojo.context;

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

import java.io.Serializable;

/**
 * 生产过程打包数据
 */
@Data
public class MesPackageDataContext extends MesPackageRuleContext implements Serializable {

    private static final long serialVersionUID = 8644214903859925217L;

    @ApiParam("包装信息ID")
    private Long packageId;

    @ApiParam("明细ID")
    private Long detailId;

    @ApiParam("包装编号")
    private String packageNo;

    @ApiParam("数量")
    private Double qty;

    @ApiParam("产品条码")
    private String serialNumber;

    @ApiParam("打包开始时间")
    private String createDatetime;

    @ApiParam("打包结束时间")
    private String modifyDatetime;

    @ApiParam("业务操作类型")
    private String busiType;

    @ApiParam("加工单号")
    private String workOrderNo;

    public MesPackageDataContext() {}

    public MesPackageDataContext(String partNo, String partName, String packageNo, Double qty, Double packSpecQty, String createDatetime, String modifyDatetime, Integer generateType) {
        this.partNo = partNo;
        this.partName = partName;
        this.packageNo = packageNo;
        this.qty = qty;
        this.packSpecQty = packSpecQty;
        this.createDatetime = createDatetime;
        this.modifyDatetime = modifyDatetime;
        this.generateType = generateType;
    }

    public MesPackageDataContext qty(Double qty, String modifyDatetime) {
        this.qty = qty;
        this.modifyDatetime = modifyDatetime;
        return this;
    }
}
