package cn.iocoder.yudao.module.mes.controller.admin.producereportplan.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 ReportPlanViewRespVO {

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

    @Schema(description = "报工单id", example = "27172")
    @ExcelProperty("报工单id")
    private Long reportId;

    @Schema(description = "计划id", example = "30035")
    private Long planId;
    @Schema(description = "计划id", example = "30035")
    @ExcelProperty("计划")
    private String planCode;

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

    @Schema(description = "成品数量")
    @ExcelProperty("成品数量")
    private BigDecimal qualityNumberPlan;

    @Schema(description = "废品数量")
    @ExcelProperty("废品数量")
    private BigDecimal wasteNumberPlan;

    @Schema(description = "计件时间")
    @ExcelProperty("计件时间")
    private BigDecimal reportTimePlan;

    @Schema(description = "总时长")
    @ExcelProperty("总时长")
    private BigDecimal totalTimePlan;

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



    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23386")
    private Long userId;
    @Schema(description = "用户", requiredMode = Schema.RequiredMode.REQUIRED, example = "23386")
    @ExcelProperty("用户")
    private String userName;

    @Schema(description = "组织ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1329")
    private Long orgId;
    @Schema(description = "工位", requiredMode = Schema.RequiredMode.REQUIRED, example = "1329")
    @ExcelProperty("工位")
    private String orgName;

    @Schema(description = "总时长")
    @ExcelProperty("总时长")
    private BigDecimal totalTime;

    @Schema(description = "成品数量")
    @ExcelProperty("成品数量")
    private BigDecimal qualityNumber;

    @Schema(description = "废品数量")
    @ExcelProperty("废品数量")
    private BigDecimal wasteNumber;

    @Schema(description = "总数量")
    @ExcelProperty("总数量")
    private BigDecimal totalNumber;

    @Schema(description = "报工日期")
    @ExcelProperty("报工日期")
    private LocalDateTime reportDate;

    @Schema(description = "计件时间")
    @ExcelProperty("计件时间")
    private BigDecimal reportTime;

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

    /**
     * 工序类型
     */
    @Schema(description = "工序类型")
    @ExcelProperty("工序类型")
    private String orgType;
    /**
     * 报工类型
     */
    @Schema(description = "报工类型")
    @ExcelProperty("报工类型")
    private String reportType;

    @Schema(description = "班别", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @ExcelProperty(value = "班别", converter = DictConvert.class)
    @DictFormat("mes_group_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer groupType;
}