package com.zt.plat.module.qms.resource.material.controller.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - 物料大类 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MaterialProductRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23369")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "父id", example = "7533")
    @ExcelProperty("父id")
    private Long parentId;

    @Schema(description = "分类名称")
    @ExcelProperty("分类名称")
    private String categoryName;

    @Schema(description = "id路径")
    @ExcelProperty("id路径")
    private String idPath;

    @Schema(description = "节点类型,分类|物料", example = "1")
    @ExcelProperty("节点类型,分类|物料")
    private String nodeType;

    @Schema(description = "编码,原始数据编码")
    @ExcelProperty("编码,原始数据编码")
    private String code;

    @Schema(description = "名称", example = "ZT")
    @ExcelProperty("名称")
    private String name;

    @Schema(description = "其他配置")
    @ExcelProperty("其他配置")
    private String customConfig;

    @Schema(description = "自定义表单")
    @ExcelProperty("自定义表单")
    private String customForm;

    @Schema(description = "扩展数据")
    @ExcelProperty("扩展数据")
    private String customData;

    @Schema(description = "标签")
    @ExcelProperty("标签")
    private String tag;

    @Schema(description = "标签模板")
    @ExcelProperty("标签模板")
    private String labelTemplateKey;

    @Schema(description = "型号")
    @ExcelProperty("型号")
    private String modelNo;

    @Schema(description = "规格")
    @ExcelProperty("规格")
    private String specification;

    @Schema(description = "技术参数")
    @ExcelProperty("技术参数")
    private String parameter;

    @Schema(description = "额定容量")
    @ExcelProperty("额定容量")
    private BigDecimal standardCapacity;

    @Schema(description = "制造商")
    @ExcelProperty("制造商")
    private String manufacturer;

    @Schema(description = "单位")
    @ExcelProperty("单位")
    private String unit;

    @Schema(description = "关联的样品大类")
    private String sampleIds;

    @Schema(description = "库存数量")
    @ExcelProperty("库存数量")
    private BigDecimal inventoryQuantity;

    @Schema(description = "允许按量领取,1-领用时输入量，按量领取；0-领用时不能输入量，整个领走")
    @ExcelProperty("允许按量领取,1-领用时输入量，按量领取；0-领用时不能输入量，整个领走")
    private Integer enablePartial;

    @Schema(description = "保质期（天）")
    @ExcelProperty("保质期（天）")
    private Integer due;

    @Schema(description = "开封后保质期是否变化,1-是，0-否")
    @ExcelProperty("开封后保质期是否变化,1-是，0-否")
    @Dict(dicCode = "yes_or_no")
    private Integer openDueFlag;

    @Schema(description = "开封后保质期（天）")
    @ExcelProperty("开封后保质期（天）")
    private Integer openDueAfter;

    @Schema(description = "是否危险品,1-是，0-否")
    @ExcelProperty("是否危险品,1-是，0-否")
    private Integer hazardous;

    @Schema(description = "是否标准溶液,1-是，0-否")
    @ExcelProperty("是否标准溶液,1-是，0-否")
    private Integer standardSolutionFlag;

    @Schema(description = "是否标准物质,1-是，0-否")
    @ExcelProperty("是否标准物质,1-是，0-否")
    private Integer standardMaterialFlag;

    @Schema(description = "复标周期,单位：天。小于等于0-不复标")
    @ExcelProperty("复标周期,单位：天。小于等于0-不复标")
    private Integer reviewDue;

    @Schema(description = "排序号")
    @ExcelProperty("排序号")
    private Integer sortNo;

    @Schema(description = "禁用标识")
    @ExcelProperty("禁用标识")
    private Integer cancelFlag;

    @Schema(description = "是否检化验,1-是，0-否")
    @ExcelProperty("是否检化验,1-是，0-否")
    @Dict(dicCode = "yes_or_no")
    private Integer assayFlag;

    @Schema(description = "是否进行库存预警,1-是，0-否")
    @ExcelProperty("是否进行库存预警,1-是，0-否")
    @Dict(dicCode = "yes_or_no")
    private Integer inventoryAlarmFlag;


    @Schema(description = "库存预警级别,safe-安全，warn-警告，danger")
    @ExcelProperty("库存预警级别,safe-安全，warn-警告，danger")
    @Dict(dicCode = "alarm_level")
    private String inventoryAlarmLevel;

    @Schema(description = "库存预警区间,json格式配置")
    @ExcelProperty("库存预警区间,json格式配置")
    private String inventoryAlarmRange;

    @Schema(description = "所属部门")
    @ExcelProperty("所属部门")
    private String systemDepartmentCode;

    @Schema(description = "备注")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(description = "子物料分类")
    private List<MaterialProductRespVO> children;

    @Schema(description = "附件上传code")
    private String fileUploadBusinessCode = "qms_resource_material_product";

    @Schema(description = "附件对象")
    private List<BusinessFileWithUrlRespDTO> businessFileRet;


}