package cn.iocoder.yudao.module.mes.controller.admin.producereport.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 org.springframework.format.annotation.DateTimeFormat;

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

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
//缺少品验工序，品验是拿机器印墨，
/***
 * 需要知道每天投料和成型产出的重量比例
 * **/
@Schema(description = "管理后台 - 生产报工明细 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ProduceReportDetailRespVO {

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

    @Schema(description = "报工单id", example = "10253")
    private Long reportId;
    @Schema(description = "报工单", example = "10253")
    private String reportCode;
    @Schema(description = "生产计划ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22861")
    private Long planId;
    @Schema(description = "报工日期")
    @ExcelProperty("报工日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDateTime reportDate;

    @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 = "用户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 qualityNumber;

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

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

    @Schema(description = "成品率")
    @ExcelProperty("成品率")
    private BigDecimal qualityRate;

    @Schema(description = "备注", example = "不好")
    @ExcelProperty("废品原因")
    private String wasteReason;

    @Schema(description = "打包数量")
    @ExcelProperty("打包数量")
    private BigDecimal packageNumber;

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

    @Schema(description = "报工状态", example = "1")
    @ExcelProperty(value = "单据状态", converter = DictConvert.class)
    @DictFormat("mes_record_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer reportStatus;
    /**
     * 工序类型
     */
    @Schema(description = "工序类型")
    @ExcelProperty("工序")
    @DictFormat("mes_org_type")
    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;

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

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean isEnable;

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