package cn.iocoder.yudao.module.mes.controller.admin.plan.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 = "管理后台 - 生产计划 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PlanRespVO {

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

    @Schema(description = "计划编码")
    @ExcelProperty("计划编码")
    private String code;

    @Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21176")
    private Long productId;
    @ExcelProperty("产品")
    private String productName;

    @Schema(description = "任务单明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18938")
    @ExcelProperty("任务单明细ID")
    private Long taskDetailId;

    @Schema(description = "任务单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18331")
    @ExcelProperty("任务单ID")
    private Long taskId;
    @Schema(description = "任务单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18331")
    @ExcelProperty("任务单ID")
    private String taskCode;

    @Schema(description = "计划成型数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("计划成型数量")
    private Long planNumber;
    /**
     * 计划热压数量
     */
    @Schema(description = "计划热压数量")
    @ExcelProperty("计划热压数量")
    private Long reyaNumber;

    @Schema(description = "成品数量")
    @ExcelProperty("成品数量")
    private Long finishNumber;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @DictFormat("mes_plan_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer status;

    @Schema(description = "计划开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("计划开始时间")
    private LocalDateTime planStartTime;

    @Schema(description = "计划结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("计划结束时间")
    private LocalDateTime planEndTime;

    @Schema(description = "实际开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("实际开始时间")
    private LocalDateTime startTime;

    @Schema(description = "实际结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("实际结束时间")
    private LocalDateTime endTime;

    @Schema(description = "生产主管ID", example = "10640")
    private Long productionManagerId;
    @Schema(description = "生产主管", example = "10640")
    @ExcelProperty("生产主管")
    private String productionManager;

    @Schema(description = "领料人ID", example = "10640")
    private Long workerId;
    @Schema(description = "领料人", example = "10640")
    private String worker;

    @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;

    @Schema(description = "生产线")
    private Long feedingPipeline;

    @Schema(description = "生产线名称")
    @ExcelProperty("生产线")
    private String feedingPipelineName;

    /**
     * 对应的派工单ID
     */
    @Schema(description = "派工单ID")
    private Long requisitionId;

    /**
     * 优先级，同种产品的优先级，数字越大，排序越靠前，越早分配完成数量
     */
    @Schema(description = "优先级")
    private Long priorityNum;

    @Schema(description = "组别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "组别", converter = DictConvert.class)
    @DictFormat("mes_group_type")
    private Integer groupType;

    @Schema(description = "是否试生产")
    @ExcelProperty("是否试生产")
    private BigDecimal isPreProduction;

    @Schema(description = "是否完成质检")
    @ExcelProperty("是否完成质检")
    private BigDecimal isZj;

    @Schema(description = "完工数量")
    @ExcelProperty("完工数量")
    private Long wangongNumber;

    @Schema(description = "合格数量")
    @ExcelProperty("合格数量")
    private Long passNumber;

    @Schema(description = "不合格数量")
    @ExcelProperty("不合格数量")
    private Long noPassNumber;

    @Schema(description = "合格率")
    @ExcelProperty("合格率")
    private BigDecimal passRate;
}