package com.scm.contract.model.print;

import com.scm.contract.model.apply.LabelApplicationDetail;
import lombok.Data;

/**
 * 正在打印的数据对象
 *
 * @author zuo
 * @date 2024/8/1 10:12
 */

@Data
public class Printing {

    /**
     * id
     */
    private String id;

    /**
     * labelApplicationId
     */
    private String labelApplicationId;

    /**
     * 是否打印 0未打印 1打印中 2打印完成
     */
    private Integer isPrint;

    /**
     * 打印狀態，答应机返回的状态id
     */
    private Integer printStatus;

    /**
     * 需求数量
     */
    private Long number;

    /**
     * 标签类型id（对应字典表）
     */
    private String tagTypeId;

    /**
     * 物料id
     */
    private String materielId;

    /**
     * 物料编码
     */
    private String materielCode;

    /**
     * 物料描述
     */
    private String materielDescribe;

    /**
     * 商品编码
     */
    private String goodsCode;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 最小包装单元數量
     */
    private Integer minimumPackingNumber;

    /**
     * 最小包装单元单位
     */
    private String minimumPackingUnit;

    /**
     * 是否是重新打印
     */
    private Boolean isReprint;

    public Printing() {
    }

    public Printing(ReprintCode reprintCode) {
        this.id = reprintCode.getId();
        this.labelApplicationId = reprintCode.getLabelApplicationId();
        this.isPrint = reprintCode.getIsPrint();
        this.printStatus = reprintCode.getPrintStatus();
        this.number = reprintCode.getNumber();
        this.tagTypeId = reprintCode.getTagTypeId();
        this.materielId = reprintCode.getMaterielId();
        this.materielCode = reprintCode.getMaterielCode();
        this.materielDescribe = reprintCode.getMaterielDescribe();
        this.goodsCode = reprintCode.getGoodsCode();
        this.goodsName = reprintCode.getGoodsName();
        this.minimumPackingNumber = reprintCode.getMinimumPackingNumber();
        this.minimumPackingUnit = reprintCode.getMinimumPackingUnit();
        this.isReprint = true;
    }

    public Printing(LabelApplicationDetail detail) {
        this.id = detail.getId();
        this.labelApplicationId = detail.getLabelApplicationId();
        this.isPrint = detail.getIsPrint();
        this.printStatus = detail.getPrintStatus();
        this.number = detail.getNumber();
        this.tagTypeId = detail.getTagTypeId();
        this.materielId = detail.getMaterielId();
        this.materielCode = detail.getMaterielCode();
        this.materielDescribe = detail.getMaterielDescribe();
        this.goodsCode = detail.getGoodsCode();
        this.goodsName = detail.getGoodsName();
        this.minimumPackingNumber = detail.getMinimumPackingNumber();
        this.minimumPackingUnit = detail.getMinimumPackingUnit();
        this.isReprint = false;
    }
}
