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

import cn.estsh.i3plus.pojo.mes.bean.*;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Description : 条码补打Model
 * @Reference :
 * @Author : junsheng.li
 * @CreateDate 2024/6/13 15:48
 * @Modify:
 **/
@Data
public class MesProduceSnPrintModel {

    @ApiParam("工厂代码")
    private String organizeCode;

    @ApiParam("物料号")
    private String partNo;

    @ApiParam("物料名称")
    private String partName;

    @ApiParam("条码")
    private String productSn;

    @ApiParam("包装条码")
    private String packageNo;

    @ApiParam("打印数量")
    private Integer printQty;

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

    @ApiParam("打印模板")
    private String printTemplate;

    @ApiParam("条码规则")
    private String snRule;

    @ApiParam(name = "包装规则代码")
    private String packCode;

    @ApiParam(name = "用户名")
    private String userName;

    @ApiParam(value = "打印机")
    private String printer;

    @ApiParam("客户物料号")
    private String custPartNo;

    @ApiParam(value = "产线代码")
    private String workCenterCode;

    @ApiParam("班次代码")
    private String shiftCode;

    @ApiParam(name = "包装定义维护")
    List<MesPackingDefine> mesPackingDefineList;

    @ApiParam(name = "打印模板信息")
    private MesLabelTemplate mesLabelTemplate;

    @ApiParam(name = "产出条码")
    private List<MesProduceSn> mesProduceSnList = new ArrayList<>();

    @ApiParam(name = "产出包装")
    private List<MesPackage> packageList = new ArrayList<>();

    @ApiParam(name = "打印日志信息")
    private List<MesPrintedSnLog> mesPrintedSnLogList = new ArrayList<>();

    @ApiParam(name = "产品条码打印信息")
    private List<MesProduceSnPrintDataModel> mesProduceSnPrintDataModelList = new ArrayList<>();

    @ApiParam(name = "源数据 使用功能：1-裁片")
    private Object sourceData;

    @ApiParam(name = "打印内容 使用功能：1-裁片")
    List<Map<String, Object>> printContextList = new ArrayList<>();

    public Double getQty() {
        return qty == null || qty <= 0d ? 1d : qty;
    }
}
