/*
 * Copyright ©2023 CJB-CNIT Team. All rights reserved
 */
package com.openhis.web.departmentmanage.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.common.annotation.Dict;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 物资信息
 *
 * @author  yuxj
 * @date 2025-07-22
 */
@Data
@Accessors(chain = true)
public class DepartmentDeviceInfoDto implements Serializable {

    /** 物品id */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 物品编号 */
    private String busNo;

    /** 物品名称 */
    private String name;

    /** 拼音码 */
    private String pyStr;

    /** 规格 */
    private String totalVolume;

    /** 包装单位 */
    @Dict(dictCode = "unit_code")
    private String unitCode;
    private String unitCode_dictText;

    /** 最小单位 */
    @Dict(dictCode = "unit_code")
    private String minUnitCode;
    private String minUnitCode_dictText;

    /** 拆零比 */
    private BigDecimal partPercent;

    /** 产品批号 */
    private String lotNumber;


//    /** 价格单位 */
//    @Dict(dictCode = "unit_code")
//    private String conditionUnitCode;
//    private String conditionUnitCode_dictText;

    /** 单价 */
    private BigDecimal price;

    /** 零售价 */
    private BigDecimal retailPrice;

    /** 厂家/产地 */
    private String manufacturerText;

    /** 批准文号 */
    private String approvalNumber;

    /** 库存最小警戒线 */
    private BigDecimal itemMinQuantity;

    /** 批次库存 */
    private BigDecimal batchInventory;
    /** 规格库存 */
    private BigDecimal specificationInventory;

    /** 供应商 */
    @Dict(dictCode = "id", dictText = "name", dictTable = "adm_supplier")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long supplierId;
    private String supplierId_dictText;

    /** 仓库 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long locationId;

    /** 生产日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date productionDate;

    /** 失效日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expirationDate;

    /**
     * 单位列表
     */
    private List<Option> unitList;

    @Data
    public static class Option {
        @Dict(dictCode = "unit_code")
        private String value;
        private String value_dictText;
        public Option(String value, String value_dictText) {
            this.value = value;
            this.value_dictText = value_dictText;
        }
    }
}
