1000078
This commit is contained in:
@@ -427,6 +427,7 @@ public class HotVehicleThreeInspectServiceImpl implements IHotVehicleThreeInspec
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void batchAudit(HotVehicleThreeInspectBatchAuditBo bo) {
|
public void batchAudit(HotVehicleThreeInspectBatchAuditBo bo) {
|
||||||
|
validateBatchAuditAuditor(bo);
|
||||||
for (HotVehicleThreeInspectBo item : bo.getAuditItems()) {
|
for (HotVehicleThreeInspectBo item : bo.getAuditItems()) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
continue;
|
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) {
|
private void doAudit(HotVehicleThreeInspectBo bo) {
|
||||||
// 1. 校验参数
|
// 1. 校验参数
|
||||||
if (bo.getTaskId() == null) {
|
if (bo.getTaskId() == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user