package cn.iocoder.yudao.module.mes.controller.admin.bom.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "管理后台 - 产品BOM明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class BomDetailRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22516")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "原料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17312")
    @ExcelProperty("原料ID")
    private Long productId;
    @Schema(description = "原料", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
    @ExcelProperty("原料")
    private String productName;

    @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24169")
    @ExcelProperty("单位ID")
    private Long unitId;
    @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "个")
    @ExcelProperty("单位")
    private String unitName;
    @Schema(description = "BOM ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30665")
    @ExcelProperty("BOM ID")
    private Long bomId;

    @Schema(description = "用量", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("用量")
    private BigDecimal usageNumber;

    @Schema(description = "损耗率%")
    @ExcelProperty("损耗率%")
    private BigDecimal yieldRate;

    @Schema(description = "备注", example = "你说的对")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "是否启用")
    @ExcelProperty(value = "是否启用", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean isEnable;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}