fix(oa/erp/task): 新增临时任务参数校验逻辑

1. 新增任务标题非空校验
2. 新增计划开始/完成时间、实际需求部门非空校验
3. 简化时间先后校验逻辑,移除冗余的非空判断
dev
zch 4 days ago
parent 39761d3fad
commit b9076f4a29

@ -582,6 +582,9 @@ public class ErpTempTaskServiceImpl implements IErpTempTaskService {
if (bo == null) {
throw new ServiceException("临时任务数据不能为空");
}
if (StringUtils.isBlank(bo.getTaskTitle())) {
throw new ServiceException("任务标题不能为空");
}
if (StringUtils.isBlank(bo.getTaskDesc())) {
throw new ServiceException("任务描述不能为空");
}
@ -589,14 +592,22 @@ public class ErpTempTaskServiceImpl implements IErpTempTaskService {
if (StringUtils.isBlank(bo.getTaskType())) {
throw new ServiceException("任务类型不能为空");
}
if (bo.getPlanStartTime() == null) {
throw new ServiceException("计划开始时间不能为空");
}
if (bo.getPlanEndTime() == null) {
throw new ServiceException("计划完成时间不能为空");
}
if (bo.getRealRequestDeptId() == null) {
throw new ServiceException("实际需求部门不能为空");
}
if ("3".equals(bo.getTaskType()) && bo.getProjectId() == null) {
throw new ServiceException("项目任务必须关联具体项目");
}
if ("1".equals(bo.getTaskType()) && bo.getDeptId() == null) {
throw new ServiceException("部门任务必须明确归属部门");
}
if (bo.getPlanStartTime() != null && bo.getPlanEndTime() != null
&& bo.getPlanEndTime().before(bo.getPlanStartTime())) {
if (bo.getPlanEndTime().before(bo.getPlanStartTime())) {
throw new ServiceException("计划完成时间不能早于计划开始时间");
}
}

Loading…
Cancel
Save