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

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.openhis.administration.domain.Organization;
import com.openhis.web.common.dto.LocationDto;

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

/**
 * 单据初期信息
 *
 * @author yuxj
 * @date 2025-07-22
 */
@Data
@Accessors(chain = true)
public class MaterialInitDto implements Serializable {

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

    /**
     * 库房类型列表
     */
    private List<WarehouseOption> warehouseTypeOption;

    /**
     * 库房列表
     */
    private List<LongOption> warehouseOption;

    /**
     * 供应商列表
     */
     private List<SupplierOption> supplierOption;

    /**
     * 人员列表
     */
    private List<LongOption> practitionerOption;
    /**
     * 审批状态
     */
    private List<IntegerOption> supplyStatusOptions;

    /**
     * 单据类型
     */
    private List<IntegerOption> supplyTypeOptions;

    /**
     * 单据分类
     */
    private List<IntegerOption> supplyCategoryOptions;
    /**
     * 包装情况
     */
    private List<IntegerOption> packagingConditionOptions;
    /**
     * 包装情况
     */
    private List<IntegerOption> acceptanceResultoryOptions;

    /**
     * 仓库
     */
    private List<LocationDto> WarehouseListOptions;
    /**
     * 科室
     */
    private  List<Organization> departmentListOptions;

    @Data
    public static class LongOption {
        @JsonSerialize(using = ToStringSerializer.class)
        private Long value;
        private String label;

        public LongOption(Long value, String label) {
            this.value = value;
            this.label = label;
        }
    }

    @Data
    public static class SupplierOption {
        @JsonSerialize(using = ToStringSerializer.class)
        private Long value;
        private String label;
        private String phone;

        public SupplierOption(Long value, String label, String phone) {
            this.value = value;
            this.label = label;
            this.phone = phone;
        }
    }

    @Data
    public static class IntegerOption {
        private Integer value;
        private String label;

        public IntegerOption(Integer value, String label) {
            this.value = value;
            this.label = label;
        }
    }

    @Data
    public static class WarehouseOption {
        private Integer value;
        private String label;
        private List<LocationDto> locationOption;
        private List<WarehouseItemOption> orderOption;

        public WarehouseOption(Integer value, String label,List<LocationDto> locationOption,List<WarehouseItemOption> orderOption) {
            this.value = value;
            this.label = label;
            this.locationOption = locationOption;
            this.orderOption = orderOption;
        }
    }

    @Data
    public static class WarehouseItemOption {
        private Integer value;
        private String label;

        public WarehouseItemOption(Integer value, String label) {
            this.value = value;
            this.label = label;
        }
    }


}
