feat(REQ-3300): 表单校验模型调整
This commit is contained in:
parent
ed0586ce8c
commit
b0a8fe2455
@ -47,7 +47,15 @@ public class CheckVisaWithVisaIdReq {
|
||||
AssertUtil.notEmpty(item.getRelationPersonList(), "确认人不能为空");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void check() {
|
||||
AssertUtil.notNull(this.getCreatFormData().getRelationWorkspaceId(), "关联项目不能为空");
|
||||
AssertUtil.notNull(this.getCreatFormData().getType(), "单据类型不能为空");
|
||||
AssertUtil.notEmpty(this.getCreatFormData().getNo(), "单号不能为空");
|
||||
AssertUtil.notEmpty(this.getCreatFormData().getTopic(), "主题不能为空");
|
||||
AssertUtil.notNull(this.getCreatFormData().getRelationProject(), "关联工程不能为空");
|
||||
AssertUtil.notNull(this.getCreatFormData().getHappenTime(), "提出时间不能为空");
|
||||
AssertUtil.notEmpty(this.getCreatFormData().getReason(), "发生原因不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class VisaChangeTempCreateReq {
|
||||
/**
|
||||
* 提出时间
|
||||
*/
|
||||
@NotNull(message = "请选择提交日期")
|
||||
@NotNull(message = "请选择提出时间")
|
||||
private Date happenTime;
|
||||
|
||||
/**
|
||||
|
||||
@ -2009,9 +2009,15 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
*/
|
||||
@Override
|
||||
public void checkVisaWithVisaId(CheckVisaWithVisaIdReq req) {
|
||||
VisaDetailByIdResponse response = this.detailById(req.getVisaId());
|
||||
req.check(response);
|
||||
this.validVisaChangeForm(Objects.requireNonNull(this.buildVisaChangeApproveCreateReqByVisaId(req.getVisaId())));
|
||||
if (NumberUtil.isPositiveNumber(req.getVisaId())) {
|
||||
VisaDetailByIdResponse response = this.detailById(req.getVisaId());
|
||||
AssertUtil.notNull(response, "单据不存在");
|
||||
req.check(response);
|
||||
this.validVisaChangeForm(Objects.requireNonNull(this.buildVisaChangeApproveCreateReqByVisaId(req.getVisaId())));
|
||||
} else {
|
||||
req.check();
|
||||
this.validVisaChangeForm(BeanUtil.copyProperties(req.getCreatFormData(), VisaChangeApproveCreateReq.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user