You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
Java
50 lines
1.2 KiB
Java
2 years ago
|
package com.glxp.api.req.dev;
|
||
|
|
||
|
import cn.hutool.core.util.StrUtil;
|
||
|
import com.glxp.api.exception.JsonException;
|
||
|
import lombok.Data;
|
||
|
|
||
|
import javax.validation.constraints.NotBlank;
|
||
|
import javax.validation.constraints.NotNull;
|
||
|
|
||
|
@Data
|
||
|
public class DeviceRepairApplyDetailDiagnosisParam {
|
||
|
|
||
|
@NotNull(message = "报修单标识不能为空")
|
||
|
Long applyId;
|
||
|
|
||
|
@NotBlank(message = "设备标识不能为空")
|
||
|
String deviceCode;
|
||
|
|
||
|
@NotNull(message = "请选择是否维修")
|
||
|
Boolean repairFlag;
|
||
|
|
||
|
@NotBlank(message = "诊断信息不能为空")
|
||
|
String diagnosisInfo;
|
||
|
|
||
|
Boolean innerFlag;
|
||
|
|
||
|
String repairUserName;
|
||
|
|
||
|
String repairUserPhone;
|
||
|
|
||
|
public void valid() {
|
||
|
if (repairFlag) {
|
||
|
if (innerFlag == null) {
|
||
|
throw new JsonException("请选择维修方式");
|
||
|
}
|
||
|
if (StrUtil.isBlank(repairUserName)) {
|
||
|
throw new JsonException("维修人姓名不能为空");
|
||
|
}
|
||
|
if (StrUtil.isBlank(repairUserPhone)) {
|
||
|
throw new JsonException("维修人电话不能为空");
|
||
|
}
|
||
|
} else {
|
||
|
innerFlag = null;
|
||
|
repairUserName = null;
|
||
|
repairUserPhone = null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|