package com.willalp.erms.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 物资库存记录对象 hs_goods_storage_record
 *
 * @author willalp
 * @date 2023-03-08
 */

@TableName("hs_goods_storage_record")
public class HsGoodsStorageRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

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

    /** 库存类型 */
    @Excel(name = "库存类型")
    private String recordType;

    /** 单号 */
    @Excel(name = "单号")
    private String orderNo;

    /** 审批标题 */
    @Excel(name = "审批标题")
    private String title;

    /** 申请部门 */
    @Excel(name = "申请部门")
    private String applyDepartment;

    /** 仓库名称 */
    @Excel(name = "仓库名称")
    private String storageName;

    /** 物资ID */
    @Excel(name = "物资ID")
    private String goodsId;

    /** 物资ID */
    @Excel(name = "物资名称")
    @TableField(exist = false)
    private String goodsName;

    /** 单价 */
    @Excel(name = "单价")
    private BigDecimal unitPrice;

    /** 数量 */
    @Excel(name = "数量")
    private Integer amount;

    /** 总价 */
    @Excel(name = "总价")
    private BigDecimal sumPrice;

    /** 申请人 */
    @Excel(name = "申请人")
    private String applyUserId;

    /** 申请人 */
    @Excel(name = "申请人")
    private String applyUserName;

    /** 申请原因（申请用途） */
    @Excel(name = "申请原因")
    private String applyReason;

    /** 申请日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date applyDate;

    /** 是否删除（0.未删除；1.已删除） */
    @TableLogic
    private Integer isDelete;

    /** 类型 */
    @TableField(exist = false)
    @Excel(name = "类型")
    private String typeRoot;

    /** 分类 */
    @TableField(exist = false)
    @Excel(name = "分类")
    private String typeBranch;

    /** 名称 */
    @TableField(exist = false)
    @Excel(name = "名称")
    private String name;

    /**
     * 备注
     */
    private String remark;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setRecordType(String recordType) {
        this.recordType = recordType;
    }

    public String getRecordType() {
        return recordType;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setApplyDepartment(String applyDepartment) {
        this.applyDepartment = applyDepartment;
    }

    public String getApplyDepartment() {
        return applyDepartment;
    }

    public void setStorageName(String storageName) {
        this.storageName = storageName;
    }

    public String getStorageName() {
        return storageName;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setApplyUserId(String applyUserId) {
        this.applyUserId = applyUserId;
    }

    public String getApplyUserId() {
        return applyUserId;
    }

    public void setApplyUserName(String applyUserName) {
        this.applyUserName = applyUserName;
    }

    public String getApplyUserName() {
        return applyUserName;
    }

    public void setSumPrice(BigDecimal sumPrice) {
        this.sumPrice = sumPrice;
    }

    public BigDecimal getSumPrice() {
        return sumPrice;
    }

    public void setApplyReason(String applyReason) {
        this.applyReason = applyReason;
    }

    public String getApplyReason() {
        return applyReason;
    }

    public void setApplyDate(Date applyDate) {
        this.applyDate = applyDate;
    }

    public Date getApplyDate() {
        return applyDate;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("recordType", getRecordType())
                .append("orderNo", getOrderNo())
                .append("title", getTitle())
                .append("applyDepartment", getApplyDepartment())
                .append("storageName", getStorageName())
                .append("goodsId", getGoodsId())
                .append("unitPrice", getUnitPrice())
                .append("amount", getAmount())
                .append("applyUserId", getApplyUserId())
                .append("applyUserName", getApplyUserName())
                .append("sumPrice", getSumPrice())
                .append("applyReason", getApplyReason())
                .append("applyDate", getApplyDate())
                .append("isDelete", getIsDelete())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getTypeRoot() {
        return typeRoot;
    }

    public void setTypeRoot(String typeRoot) {
        this.typeRoot = typeRoot;
    }

    public String getTypeBranch() {
        return typeBranch;
    }

    public void setTypeBranch(String typeBranch) {
        this.typeBranch = typeBranch;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
