diff --git a/src/main/java/com/hotwj/platform/config/vehicleThreeInspect/service/impl/HotVehicleThreeInspectServiceImpl.java b/src/main/java/com/hotwj/platform/config/vehicleThreeInspect/service/impl/HotVehicleThreeInspectServiceImpl.java index a7bc1bc..eb0d581 100644 --- a/src/main/java/com/hotwj/platform/config/vehicleThreeInspect/service/impl/HotVehicleThreeInspectServiceImpl.java +++ b/src/main/java/com/hotwj/platform/config/vehicleThreeInspect/service/impl/HotVehicleThreeInspectServiceImpl.java @@ -427,6 +427,7 @@ public class HotVehicleThreeInspectServiceImpl implements IHotVehicleThreeInspec @Override @Transactional(rollbackFor = Exception.class) public void batchAudit(HotVehicleThreeInspectBatchAuditBo bo) { + validateBatchAuditAuditor(bo); for (HotVehicleThreeInspectBo item : bo.getAuditItems()) { if (item == null) { continue; @@ -435,6 +436,32 @@ public class HotVehicleThreeInspectServiceImpl implements IHotVehicleThreeInspec } } + private void validateBatchAuditAuditor(HotVehicleThreeInspectBatchAuditBo bo) { + Long expectedAuditorId = null; + String expectedAuditorName = null; + for (HotVehicleThreeInspectBo item : bo.getAuditItems()) { + if (item == null) { + continue; + } + if (item.getAuditorId() == null) { + throw new ServiceException("批量审核时审核人不能为空"); + } + String currentAuditorName = StringUtils.trimToNull(item.getAuditorName()); + if (StringUtils.isBlank(currentAuditorName)) { + throw new ServiceException("批量审核时审核人姓名不能为空"); + } + if (expectedAuditorId == null) { + expectedAuditorId = item.getAuditorId(); + expectedAuditorName = currentAuditorName; + continue; + } + if (!Objects.equals(expectedAuditorId, item.getAuditorId()) + || !StringUtils.equals(expectedAuditorName, currentAuditorName)) { + throw new ServiceException("批量审核时审核人必须是同一个人"); + } + } + } + private void doAudit(HotVehicleThreeInspectBo bo) { // 1. 校验参数 if (bo.getTaskId() == null) {