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