|
@@ -503,6 +503,15 @@ public class AppraiseRelaLogic {
|
|
|
.in(PgAppraiseApply::getId, ids)
|
|
|
.list();
|
|
|
|
|
|
+ final Integer count = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .in(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT.getKey(), AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
|
+ .in(PgAppraiseApply::getId, ids)
|
|
|
+ .count();
|
|
|
+
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("有“待申诉”或“待中心审核”申诉记录,不能操作“驳回可再申诉”");
|
|
|
+ }
|
|
|
+
|
|
|
for (PgAppraiseApply apply : applyList) {
|
|
|
if (Objects.nonNull(apply.getRejectTime())) {
|
|
|
throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录有“驳回可重申诉信息”,不能操作“驳回可再申诉”");
|
|
@@ -583,30 +592,33 @@ public class AppraiseRelaLogic {
|
|
|
.orderByAsc(PgAppraiseApply::getApplyTime)
|
|
|
.list();
|
|
|
|
|
|
- if (CollectionUtil.isNotEmpty(applyList)) {
|
|
|
- final List<String> orderIds = applyList.stream().map(PgAppraiseApply::getOrderBaseId).collect(Collectors.toList());
|
|
|
- final Map<String, PgAppraiseApply> applyMap = applyList.stream().collect(Collectors.toMap(PgAppraiseApply::getOrderBaseId, Function.identity(), (key1, key2) -> key2));
|
|
|
- for (PgAppraiseApply apply : applyList) {
|
|
|
- if (!(apply.getStatus().equals(AppraiseApplyStatusEnum.OK.getKey())
|
|
|
- || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER.getKey())
|
|
|
- || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER_APPLY.getKey()))) {
|
|
|
- throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
- }
|
|
|
- apply.setExamineResult(apply.getAppraiseStatus());
|
|
|
+ if (CollectionUtil.isEmpty(applyList)) {
|
|
|
+ throw new RemoteServiceException("未找到申诉记录为“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
+ }
|
|
|
+
|
|
|
+ final List<String> orderIds = applyList.stream().map(PgAppraiseApply::getOrderBaseId).collect(Collectors.toList());
|
|
|
+ final Map<String, PgAppraiseApply> applyMap = applyList.stream().collect(Collectors.toMap(PgAppraiseApply::getOrderBaseId, Function.identity(), (key1, key2) -> key2));
|
|
|
+ for (PgAppraiseApply apply : applyList) {
|
|
|
+ if (!(apply.getStatus().equals(AppraiseApplyStatusEnum.OK.getKey())
|
|
|
+ || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER.getKey())
|
|
|
+ || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER_APPLY.getKey()))) {
|
|
|
+ throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
}
|
|
|
- pgAppraiseApplyService.saveOrUpdateBatch(applyList);
|
|
|
-
|
|
|
- for (String orderId : orderIds) {
|
|
|
- final PgAppraiseApply apply = applyMap.get(orderId);
|
|
|
- if (Objects.nonNull(apply)) {
|
|
|
- pgOrderBaseService.lambdaUpdate()
|
|
|
- .set(PgOrderBase::getAppraiseApplyResult, apply.getAppraiseStatus())
|
|
|
- .eq(PgOrderBase::getId, orderId)
|
|
|
- .update();
|
|
|
- }
|
|
|
+ apply.setExamineResult(apply.getAppraiseStatus());
|
|
|
+ }
|
|
|
+ pgAppraiseApplyService.saveOrUpdateBatch(applyList);
|
|
|
+
|
|
|
+ for (String orderId : orderIds) {
|
|
|
+ final PgAppraiseApply apply = applyMap.get(orderId);
|
|
|
+ if (Objects.nonNull(apply)) {
|
|
|
+ pgOrderBaseService.lambdaUpdate()
|
|
|
+ .set(PgOrderBase::getAppraiseApplyResult, apply.getAppraiseStatus())
|
|
|
+ .eq(PgOrderBase::getId, orderId)
|
|
|
+ .update();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
pgAppraiseApplyService.lambdaUpdate()
|
|
|
.set(PgAppraiseApply::getCloseBy, adminUser.getNickName())
|
|
|
.set(PgAppraiseApply::getCloseTime, DateUtil.date())
|