package com.hys.app.model.erp.dos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hys.app.framework.database.mybatisplus.base.BaseDO;
import com.hys.app.model.erp.enums.DamageinventoryEnum;
import com.hys.app.model.erp.enums.StockDamageReportTypeEnum;
import com.hys.app.model.erp.vo.StockDamageReportAllowable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 库存报损单实体
 *
 * @author dmy
 * 2023-12-05
 */
@TableName("es_stock_damage_report")
@ApiModel
@Data
public class StockDamageReport extends BaseDO implements Serializable {

    private static final long serialVersionUID = -2812668888351646009L;

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(hidden = true)
    private Long id;
    /**
     * 编号
     */
    @ApiModelProperty(name = "sn", value = "编号")
    private String sn;
    /**
     * 部门ID
     */
    @ApiModelProperty(name = "dept_id", value = "部门ID")
    private Long deptId;
    /**
     * 部门名称
     */
    @ApiModelProperty(name = "dept_name", value = "部门名称")
    private String deptName;
    /**
     * 仓库ID
     */
    @ApiModelProperty(name = "warehouse_id", value = "仓库ID")
    private Long warehouseId;
    /**
     * 仓库名称
     */
    @ApiModelProperty(name = "warehouse_name", value = "仓库名称")
    private String warehouseName;
    /**
     * 制单人ID
     */
    @ApiModelProperty(name = "creator_id", value = "制单人ID")
    private Long creatorId;
    /**
     * 制单人
     */
    @ApiModelProperty(name = "creator", value = "制单人")
    private String creator;

    @ApiModelProperty(name = "report_time", value = "报损时间", required = true)
    @NotNull(message = "报损时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date reportTime;
    /**
     * 报损类型（键）
     */
    @ApiModelProperty(name = "damage_type_key", value = "报损类型（键）")
    private String damageTypeKey;
    /**
     * 报损类型（值） {@link StockDamageReportTypeEnum}
     */
    @ApiModelProperty(name = "damage_type_value", value = "报损类型（值）")
    private StockDamageReportTypeEnum damageTypeValue;
    /**
     * 报损说明
     */
    @ApiModelProperty(name = "report_desc", value = "报损说明")
    private String reportDesc;
    /**
     * 创建时间
     */
    @ApiModelProperty(name = "create_time", value = "创建时间")
    private Long createTime;
    /**
     * 状态
     * @see com.hys.app.model.erp.enums.StockDamageReportStatusEnum
     */
    @ApiModelProperty(name = "status", value = "状态")
    private DamageinventoryEnum status = DamageinventoryEnum.NOT_HANDLE;
    /**
     * 审核驳回原因
     */
    @ApiModelProperty(name = "reject_reason", value = "审核驳回原因")
    private String rejectReason;
    /**
     * 审核时间
     */
    @ApiModelProperty(name = "audit_time", value = "审核时间")
    private Long auditTime;
    /**
     * 库存报损单允许进行的操作
     */
    @TableField(exist = false)
    @ApiModelProperty(name = "allowable", value = "库存报损单允许进行的操作")
    private StockDamageReportAllowable allowable;
}
