Kaynağa Gözat

Merge branch 'release_lutong_bug' into sit

lutong 1 ay önce
ebeveyn
işleme
c2f0246a0f

+ 7 - 4
alien-store/src/main/java/shop/alien/store/service/impl/CommonRatingServiceImpl.java

@@ -166,22 +166,25 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
             boolean condition2Passed = false; // 条件2:有小票
             String auditReason = null; // 审核原因
             
-            // 检查条件1:用户是否在该店铺打过卡
+            // 检查条件1:用户是否在该店铺打过卡(只统计审核通过的打卡)
+            // checkFlag: 0-未审核, 1-审核中, 2-审核通过, 3-审核拒绝
+            // 只有审核通过的打卡(checkFlag=2)才算成功打卡
             try {
                 LambdaQueryWrapper<StoreClockIn> clockInWrapper = new LambdaQueryWrapper<>();
                 clockInWrapper.eq(StoreClockIn::getUserId, commonRating.getUserId())
                         .eq(StoreClockIn::getStoreId, commonRating.getBusinessId())
                         .eq(StoreClockIn::getDeleteFlag, 0)
+                        .eq(StoreClockIn::getCheckFlag, 2) // 只统计审核通过的打卡(2-审核通过)
                         .last("LIMIT 1");
                 Integer clockInCount = storeClockInMapper.selectCount(clockInWrapper);
                 condition1Passed = clockInCount != null && clockInCount > 0;
                 if (condition1Passed) {
-                    log.info("评论审核条件1通过:用户在该店铺打卡,userId={}, storeId={}", 
+                    log.info("评论审核条件1通过:用户在该店铺有审核通过的打卡记录,userId={}, storeId={}", 
                             commonRating.getUserId(), commonRating.getBusinessId());
                 } else {
                     // 打卡审核不通过,记录审核原因
-                    auditReason = "用户未在该店铺打过卡";
-                    log.info("评论审核条件1未通过:用户未在该店铺打卡,userId={}, storeId={}", 
+                    auditReason = "用户未在该店铺打过卡或打卡审核未通过";
+                    log.info("评论审核条件1未通过:用户未在该店铺有审核通过的打卡记录,userId={}, storeId={}", 
                             commonRating.getUserId(), commonRating.getBusinessId());
                 }
             } catch (Exception e) {