|
|
@@ -162,31 +162,27 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
// 4. 内容审核通过后,检查是否满足以下条件之一(满足任意一个即可):
|
|
|
// 条件1:当前用户必须在这个店铺打过卡
|
|
|
// 条件2:当前用户上传的图片中包含该店铺的小票(调用AI审核)
|
|
|
- // 注意:小票审核和打卡审核不通过时,允许创建评论,但审核状态设为不通过并记录审核原因
|
|
|
+ // 注意:小票审核不通过时,允许创建评论,但审核状态设为不通过并记录审核原因(打卡仅要求存在记录,不校验审核状态)
|
|
|
|
|
|
boolean condition1Passed = false; // 条件1:打过卡
|
|
|
boolean condition2Passed = false; // 条件2:有小票
|
|
|
String auditReason = null; // 审核原因
|
|
|
|
|
|
- // 检查条件1:用户是否在该店铺打过卡(只统计审核通过的打卡)
|
|
|
- // checkFlag: 0-未审核, 1-审核中, 2-审核通过, 3-审核拒绝
|
|
|
- // 只有审核通过的打卡(checkFlag=2)才算成功打卡
|
|
|
+ // 检查条件1:用户是否在该店铺有过打卡(未删除即可,不区分打卡内容审核是否通过)
|
|
|
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) {
|