package cn.iocoder.yudao.module.mes.controller.admin.safety.vo.train; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 安全生产 - 事故登记新增/修改 Request VO * * @author 超级管理员 */ @Schema(description = "管理后台 - 事故登记新增/修改 Request VO") @Data public class SafetyAccidentSaveReqVO { private Long id; @Schema(description = "事故名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "10kV 开关柜误操作触电") @NotBlank(message = "事故名称不能为空") @Size(max = 200) private String title; @Schema(description = "事故类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "ELECTRIC_SHOCK") @NotBlank(message = "事故类型不能为空") @Pattern(regexp = "ELECTRIC_SHOCK|FIRE|FALL|OBJECT_STRIKE|MECHANICAL|CHEMICAL|VEHICLE|OTHER", message = "事故类型不合法") private String accidentType; @Schema(description = "事故等级", example = "GENERAL") @Pattern(regexp = "SLIGHT|GENERAL|SEVERE|MAJOR", message = "事故等级不合法") private String level; @Schema(description = "发生时间", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "发生时间不能为空") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime occurTime; @Schema(description = "发生地点") @Size(max = 200) private String location; @Schema(description = "所属车间(关联 mes_md_workshop)") private Long workshopId; @Schema(description = "伤亡情况") @Size(max = 500) private String casualtyDesc; @Schema(description = "直接经济损失(元)") @DecimalMin(value = "0", message = "经济损失不能为负数") private BigDecimal economicLoss; @Schema(description = "涉事人员姓名,逗号分隔") @Size(max = 500) private String involvedPersons; @Schema(description = "事故经过") @Size(max = 2000) private String description; @Schema(description = "原因分析") @Size(max = 2000) private String causeAnalysis; @Schema(description = "处理措施与整改要求") @Size(max = 2000) private String measures; @Schema(description = "登记人(员工编号,关联 hrm_employee)") private Long reporterId; @Schema(description = "登记时间") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime reportTime; @Schema(description = "状态", example = "REPORTED") @Pattern(regexp = "REPORTED|INVESTIGATING|HANDLED|CLOSED", message = "状态不合法") private String status; @Schema(description = "现场照片/调查报告 URL,逗号分隔") @Size(max = 2000) private String attachment; @Schema(description = "备注") @Size(max = 500) private String remark; }