FengChaoYu před 4 měsíci
rodič
revize
61faffa207

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

@@ -269,7 +269,9 @@ public class AppraiseRelaLogic {
                 .orderByDesc(PgAppraiseApply::getApplyTime)
                 .one();
 
-        final int applyCount = Objects.isNull(beforeApply) ? 0 : 1;
+        final Integer applyCount = pgAppraiseApplyService.lambdaQuery()
+                .eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
+                .count();
 
         // 查询有没有驳回不可申诉人
         final Integer superEndCount = pgAppraiseApplyService.lambdaQuery()
@@ -306,7 +308,7 @@ public class AppraiseRelaLogic {
             // 申诉配置
             final PgAppraiseConfig config = pgAppraiseConfigService.lambdaQuery()
                     .eq(PgAppraiseConfig::getCompanyWechatId, orderBase.getCompanyWechatId())
-                    .eq(PgAppraiseConfig::getType, applyCount == 0 ? AppraiseConfigTypeEnum.FIRST_A.getKey() : AppraiseConfigTypeEnum.SECOND_A.getKey())
+                    .eq(PgAppraiseConfig::getType, applyCount <= 1 ? AppraiseConfigTypeEnum.FIRST_A.getKey() : AppraiseConfigTypeEnum.SECOND_A.getKey())
                     .one();
 
             if (config.getType().equals(AppraiseConfigTypeEnum.SECOND_A.getKey())) {
@@ -317,12 +319,12 @@ public class AppraiseRelaLogic {
             final int val = Integer.parseInt(config.getVal());
             endTime = DateUtil.offsetHour(overTime, val);
 
-            String str = applyCount == 0 ? "首次" : "二次";
+            String str = applyCount <= 1 ? "首次" : "二次";
             if (DateUtil.date().after(endTime)) {
                 throw new RemoteServiceException("已超" + str + "申诉时间, 提交失败");
             }
         }
-        bean.setIsSecond(applyCount > 0);
+        bean.setIsSecond(applyCount > 1);
 
         //2、该工单已有中差评申诉数据的,不可再提交;(已申诉、待审核状态的,均不可再创建申诉)
         Integer waitCount = pgAppraiseApplyService.lambdaQuery()