package cn.iocoder.yudao.module.mes.controller.admin.pro.batch.vo; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @Schema(description = "管理后台 - MES 生产批次新增/修改 Request VO") @Data public class MesProBatchSaveReqVO { @Schema(description = "编号", example = "1024") private Long id; @Schema(description = "品种(产品物料)编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "品种不能为空") private Long itemId; @Schema(description = "产线编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "产线不能为空") private Long lineId; @Schema(description = "生产日期", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "生产日期不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime produceDate; @Schema(description = "计划数量", example = "1000") private BigDecimal planQuantity; @Schema(description = "责任人用户编号(责任落实到人)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "责任人不能为空") private Long ownerUserId; @Schema(description = "备注", example = "加急批次") private String remark; @Schema(description = "生产人员配置列表", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "生产人员配置不能为空") @Valid private List workers; @Schema(description = "生产人员配置") @Data public static class Worker { @Schema(description = "编号(更新时传入)", example = "1024") private Long id; @Schema(description = "生产人员用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "生产人员不能为空") private Long userId; @Schema(description = "岗位类型(字典 mes_pro_batch_worker_type)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @NotNull(message = "岗位类型不能为空") private Integer workerType; @Schema(description = "备注") private String remark; } }