This commit is contained in:
2026-05-24 16:26:41 +08:00
parent 799d919575
commit b5c16ad096

View File

@@ -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) {