From b9076f4a29bb3b4725df730b8904ffd6fc51b074 Mon Sep 17 00:00:00 2001 From: zch Date: Wed, 24 Jun 2026 17:38:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(oa/erp/task):=20=E6=96=B0=E5=A2=9E=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增任务标题非空校验 2. 新增计划开始/完成时间、实际需求部门非空校验 3. 简化时间先后校验逻辑,移除冗余的非空判断 --- .../erp/service/impl/ErpTempTaskServiceImpl.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpTempTaskServiceImpl.java b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpTempTaskServiceImpl.java index 9b1bc21f..f1218a7c 100644 --- a/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpTempTaskServiceImpl.java +++ b/ruoyi-modules/ruoyi-oa/src/main/java/org/dromara/oa/erp/service/impl/ErpTempTaskServiceImpl.java @@ -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("计划完成时间不能早于计划开始时间"); } }