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

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

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-06-03
 */
@Data
@Accessors(chain = true)
public class MedicineSummaryDto {

    /**
     * 单据号
     */
    private String busNo;

    /** 供应请求id */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long requestId;

    /** 供应发放id */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long deliveryId;

    /**
     * 项目表
     */
    private String itemTable;
    /**
     * 项目名
     */
    private String itemName;

    /** 项目id */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long itemId;

    /**
     * 规格
     */
    private String totalVolume;

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

    /**
     * 请求数
     */
    private BigDecimal quantity;

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

    /** 常规单位 */
    @Dict(dictCode = "unit_code")
    private String maxUnitCode;
    private String maxUnitCode_dictText;

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

    /** 发放地点 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sourceLocationId;
    private String sourceLocationName;

    /** 申请科室 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orgId;
    private String orgName;

    /** 领药人 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long applicantId;
    private String applicantName;

    /** 申请时间 */
    private Date applyTime;

    /**
     * 状态
     */
    private Integer statusEnum;
    private String statusEnum_enumText;

    /** 患者信息 */
    private String patientInfo;
    /**
     * 单位列表
     */
    private List<MedicineSummaryDto.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;
        }

        public Option() {}
    }
}
