package com.scm.contract.model.print;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.Data;

/**
 * @author zuo
 * @date 2024/7/31 16:09
 */
@Data
@TableName(value = "reprint_code_detail")
public class ReprintCodeDetail {

    /**
     * id
     */
    @TableId
    private String id;

    /**
     * 重打订单id
     */
    @TableField(value = "`reprintCodeId`")
    private String reprintCodeId;

    /**
     * 重打对应的printCodeId
     */
    @TableField(value = "`printCodeId`")
    private String printCodeId;

    /**
     * 重打前流水号
     */
    @TableField(value = "`oldSerialNumber`")
    private String oldSerialNumber;

    /**
     * 重打前EPC编码
     */
    @TableField(value = "`oldQrCode`")
    private String oldQrCode;

    /**
     * 重打新生成的流水号
     */
    @TableField(value = "`oldSerialNumber`")
    private String newSerialNumber;

    /**
     * 重打新生成的EPC编码
     */
    @TableField(value = "`oldQrCode`")
    private String newQrCode;

    public ReprintCodeDetail() {
    }

    public ReprintCodeDetail(String reprintCodeId, PrintCode newPrintCode, PrintCode oldPrintCode) {
        this.id = IdWorker.getIdStr();
        this.reprintCodeId = reprintCodeId;
        this.printCodeId = newPrintCode.getId();
        this.oldSerialNumber = oldPrintCode.getSerialNumber();
        this.oldQrCode = oldPrintCode.getQrCode();
        this.newSerialNumber = newPrintCode.getSerialNumber();
        this.newQrCode = newPrintCode.getQrCode();
    }
}
