package com.xmomen.module.beforehandpackagerecord.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xmomen.module.beforehandpackagerecord.entity.BeforehandPackageRecord;
import lombok.Data;
import org.hibernate.validator.constraints.*;

import javax.validation.constraints.*;

import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelTarget;
import org.springframework.beans.BeanUtils;

import java.lang.String;
import java.lang.Integer;
import java.util.Date;
import java.io.Serializable;


@ExcelTarget(value = "BeforehandPackageRecordModel")
public
@Data
class BeforehandPackageRecordModel implements Serializable {

    // id字段，长度限制为32个字符，不能为空
    @NotBlank(message = "为必填项")
    @Length(max = 32, message = "字符长度限制[0,32]")
    private String id;

    // 包装商品，不能为空，数值范围在-999999999到999999999之间
    @Excel(name = "包装商品")
    @NotBlank(message = "包装商品为必填项")
    @Range(max = 999999999, min = -999999999, message = "包装商品数值范围[999999999,-999999999]")
    private Integer cdItemId;

    // 包装商品数，不能为空，数值范围在-999999999到999999999之间
    @Excel(name = "包装商品数")
    @NotBlank(message = "包装商品数为必填项")
    @Range(max = 999999999, min = -999999999, message = "包装商品数数值范围[999999999,-999999999]")
    private Integer packageNum;

    // 创建时间，不能为空
    @Excel(name = "创建时间")
    @NotBlank(message = "创建时间为必填项")
    private Date insertDate;

    // 创建人，不能为空，数值范围在-999999999到999999999之间
    @Excel(name = "创建人")
    @NotBlank(message = "创建人为必填项")
    @Range(max = 999999999, min = -999999999, message = "创建人数值范围[999999999,-999999999]")
    private Integer insertUserId;

    // 更新时间
    @Excel(name = "更新时间")
    private Date updateDate;

    // 更新人，数值范围在-999999999到999999999之间
    @Excel(name = "更新人")
    @Range(max = 999999999, min = -999999999, message = "更新人数值范围[999999999,-999999999]")
    private Integer updateUserId;

    // 商品编码
    private String itemCode;

    // 商品名称
    private String itemName;

    // 包装人
    private String packageUserName;

    // 将BeforehandPackageRecordModel对象转换为BeforehandPackageRecord对象
    @JsonIgnore
    public BeforehandPackageRecord getEntity() {
        BeforehandPackageRecord beforehandPackageRecord = new BeforehandPackageRecord();
        BeanUtils.copyProperties(this, beforehandPackageRecord);
        return beforehandPackageRecord;
    }


}
