package org.dromara.ems.info.domain;

import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.DateTimeFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.HashMap;
import java.util.Map;

/**
 * 备件库记录导入导出VO对象
 * 
 * @author Yinq
 * @date 2024-12-13
 */
@ExcelIgnoreUnannotated
public class SparePartsInventoryExportVO
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long objid;

    /** 入库时间 */
    @DateTimeFormat("yyyy/MM/dd")
    @ExcelProperty(value = "入库时间")
    private String warehouseDate;

    /** 采购方式 */
    @ExcelProperty(value = "采购方式")
    private String purchaseMethod;

    /** 库存位置 */
    @ExcelProperty(value = "库存位置")
    private String storageLocation;

    /** 物品名称 */
    @ExcelProperty(value = "物品名称")
    private String itemName;

    /** 原厂编号 */
    @ExcelProperty(value = "原厂编号")
    private String originalPartNumber;

    /** 型号 */
    @ExcelProperty(value = "型号")
    private String model;

    /** 入库数量 */
    @ExcelProperty(value = "入库数量")
    private Long warehouseQuantity;

    /** 剩余数量 */
    @ExcelProperty(value = "剩余数量")
    private Long remainingQuantity;

    /** 库存阈值 */
    // @Excel(name = "库存阈值", cellType = Excel.ColumnType.NUMERIC)
    private Long threshold;

    /** 备注 */
    @ExcelProperty(value = "备注")
    private String remarks;

    /** 动态盘点数据 - 用于存储各种盘点列的值 */
    private Map<String, Long> checkData = new HashMap<>();

    // Getter和Setter方法
    public Long getObjid() { return objid; }
    public void setObjid(Long objid) { this.objid = objid; }

    public String getWarehouseDate() { return warehouseDate; }
    public void setWarehouseDate(String warehouseDate) { this.warehouseDate = warehouseDate; }

    public String getPurchaseMethod() { return purchaseMethod; }
    public void setPurchaseMethod(String purchaseMethod) { this.purchaseMethod = purchaseMethod; }

    public String getStorageLocation() { return storageLocation; }
    public void setStorageLocation(String storageLocation) { this.storageLocation = storageLocation; }

    public String getItemName() { return itemName; }
    public void setItemName(String itemName) { this.itemName = itemName; }

    public String getOriginalPartNumber() { return originalPartNumber; }
    public void setOriginalPartNumber(String originalPartNumber) { this.originalPartNumber = originalPartNumber; }

    public String getModel() { return model; }
    public void setModel(String model) { this.model = model; }

    public Long getWarehouseQuantity() { return warehouseQuantity; }
    public void setWarehouseQuantity(Long warehouseQuantity) { this.warehouseQuantity = warehouseQuantity; }

    public Long getRemainingQuantity() { return remainingQuantity; }
    public void setRemainingQuantity(Long remainingQuantity) { this.remainingQuantity = remainingQuantity; }

    public Long getThreshold() { return threshold; }
    public void setThreshold(Long threshold) { this.threshold = threshold; }

    public String getRemarks() { return remarks; }
    public void setRemarks(String remarks) { this.remarks = remarks; }

    public Map<String, Long> getCheckData() { return checkData; }
    public void setCheckData(Map<String, Long> checkData) { this.checkData = checkData; }

    /** 动态设置盘点数据 */
    public void setCheckValue(String checkName, Long value) {
        this.checkData.put(checkName, value);
    }

    /** 动态获取盘点数据 */
    public Long getCheckValue(String checkName) {
        return this.checkData.get(checkName);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("objid", getObjid())
            .append("warehouseDate", getWarehouseDate())
            .append("purchaseMethod", getPurchaseMethod())
            .append("storageLocation", getStorageLocation())
            .append("itemName", getItemName())
            .append("originalPartNumber", getOriginalPartNumber())
            .append("model", getModel())
            .append("warehouseQuantity", getWarehouseQuantity())
            .append("remainingQuantity", getRemainingQuantity())
            .append("threshold", getThreshold())
            .append("remarks", getRemarks())
            .append("checkData", getCheckData())
            .toString();
    }
} 
