Browse Source

no message

FengChaoYu 4 months ago
parent
commit
779e4ea65e

+ 32 - 20
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/AppraiseRelaLogic.java

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

+ 2 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseLogic.java

@@ -230,6 +230,8 @@ public class OrderBaseLogic {
                     continue;
                 }
                 if (!(record.getOrderStatus().getKey().equals(OrderBaseStatusEnum.YWG.getKey())
+                        || record.getOrderStatus().equals(OrderBaseStatusEnum.GCSZX.getKey())
+                        || record.getOrderStatus().equals(OrderBaseStatusEnum.WDWG.getKey())
                         || record.getOrderStatus().getKey().equals(OrderBaseStatusEnum.YJS.getKey()))) {
                     record.setAppraiseApplyId("1");
                     continue;