package com.ruoyi.inventory.domain;

import java.util.Date;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 库存对象 inventory
 *
 * @author ruoyi
 * @date 2025-12-03
 */
@Data
public class Inventory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编号 */
    private String id;

    /** 库存类别1普通2退库 */
    @Excel(name = "库存类别1普通2退库")
    private Long inventoryType;

    /** 入库单号 */
    @Excel(name = "入库单号")
    private String orderId;

    /** 货物名称 */
    private String orderName;
    /** 物料ID 检索条件 */
    @Excel(name = "物料ID 检索条件")
    private String materialId;
    /** 货物名称 */
    private String materialName;

    /** 批次ID 检索条件 */
    @Excel(name = "批次ID 检索条件")
    private String batchId;
    /** 批次ID 检索条件 */
    @Excel(name = "仓库ID ")
    private String warehousesId;
    /** 仓库编码 检索条件 */
    private String warehousesCode;
    /** 仓库编码 检索条件 */
    private String warehousesName;

    /** 库位ID 检索条件 */
    @Excel(name = "库位ID 检索条件")
    private String locationId;
    /** 库位名称 */
    private String locationName;

    /** 货主ID 检索条件 */
    @Excel(name = "货主ID 检索条件")
    private String ownerId;

    private String ownerName;
    /** 库存数量 */
    @Excel(name = "库存数量")
    private Long quantity;

    /** 锁定数量 */
    @Excel(name = "锁定数量")
    private Long lockedQuantity;

    /** 单位重量 */
    @Excel(name = "单位重量")
    private Double unitWeight;

    /** 总重量 暂无用 */
    @Excel(name = "总重量 暂无用")
    private Long totalWeight;

    /** 总体积 暂无用 */
    @Excel(name = "总体积 暂无用")
    private Long totalVolume;

    /** 生产日期 暂无用 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生产日期 暂无用", width = 30, dateFormat = "yyyy-MM-dd")
    private Date productionDate;

    /** 失效日期 暂无用 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "失效日期 暂无用", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationDate;

    /** 库存状态 0-已出库 1-正常 字典，检索条件 */
    @Excel(name = "库存状态 0-已出库 1-正常 字典，检索条件")
    private Long inventoryStatus;

    /** 最后入库时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后入库时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastInboundTime;

    /** 最后出库时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后出库时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastOutboundTime;

    /** 应用数据1使用0删除 删除用 */
    @Excel(name = "应用数据1使用0删除 删除用")
    private Long isUsed;

    /** 排序 */
    @Excel(name = "排序")
    private Long sortNo;

    /** 创建日期 */
    @Excel(name = "创建日期")
    private String createUserCode;

    /** 排序号 */
    @Excel(name = "排序号")
    private String updateUserCode;

    /** 预警类型 */
    private String alertType;

    public String getWarehousesId() {
        return warehousesId;
    }

    public void setWarehousesId(String warehousesId) {
        this.warehousesId = warehousesId;
    }

    /** 最低库存 */
    private Long minStockLevel;
    /** 最高库存 */
    private Long maxStockLevel;

    /** SAP物料号 */
    @Excel(name = "SAP物料号")
    private String sapNo;

    /** TS Code */
    @Excel(name = "TS Code")
    private String tsCode;

    /** 危险类别 */
    private String hazardId;

    /** 危险类别 */
    @Excel(name = "危险类别")
    private String hazard;

    /** 规格型号 */
    @Excel(name = "规格型号")
    private String specification;

    /** 计量单位 */
    @Excel(name = "计量单位")
    private String materialUnit;

    /** 包装重量 */
//    @Excel(name = "包装重量")
    private Double packageWeight;

    /** 体积 */
    private Double volume;

    /** 保质期天数 */
    private Integer shelfLifeDays;

    /** 存储温度要求 */
//    @Excel(name = "存储温度要求")
    private String storageTemperature;

    /** 特殊存储要求 */
//    @Excel(name = "特殊存储要求")
    private String specialRequirements;

    private Double unitPrice;
    private String inboundOrderId;

    public Inventory() {
    }
    /**
     * 入库导入批量新增库存映射字段
     * */
    public Inventory(Long inventoryType, String orderId,String materialId,  String batchId, String warehousesId,  String locationId,  String ownerId, Long quantity,  Double unitWeight,  Long inventoryStatus, Double unitPrice) {
        this.inventoryType = inventoryType;
        this.orderId = orderId;
        this.materialId = materialId;
        this.batchId = batchId;
        this.warehousesId = warehousesId;
        this.locationId = locationId;
        this.ownerId = ownerId;
        this.quantity = quantity;
        this.unitWeight = unitWeight;
        this.inventoryStatus = inventoryStatus;
        this.unitPrice = unitPrice;
    }
}
