|
@@ -238,7 +238,8 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断审核结果:如果两个条件都不满足,判定为审核不通过;至少满足一个条件,算审核通过
|
|
// 判断审核结果:如果两个条件都不满足,判定为审核不通过;至少满足一个条件,算审核通过
|
|
|
- if (!condition1Passed && !condition2Passed) {
|
|
|
|
|
|
|
+ boolean bothConditionFailed = !condition1Passed && !condition2Passed;
|
|
|
|
|
+ if (bothConditionFailed) {
|
|
|
// 两个条件都不满足,判定为审核不通过
|
|
// 两个条件都不满足,判定为审核不通过
|
|
|
if (auditReason == null) {
|
|
if (auditReason == null) {
|
|
|
if (imageUrls.isEmpty()) {
|
|
if (imageUrls.isEmpty()) {
|
|
@@ -265,19 +266,29 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 6. 如果审核不通过(小票审核或打卡审核不通过),发送websocket通知给用户
|
|
|
|
|
- if (commonRating.getAuditStatus() != null && commonRating.getAuditStatus() == 2 && StringUtils.isNotEmpty(auditReason)) {
|
|
|
|
|
|
|
+ // 6. 打卡与小票均未通过(含未上传有效消费凭证)时发送通知:评价审核失败通知 + 引导文案
|
|
|
|
|
+ if (commonRating.getAuditStatus() != null && commonRating.getAuditStatus() == 2 && StringUtils.isNotEmpty(auditReason) && bothConditionFailed) {
|
|
|
try {
|
|
try {
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
LifeUser lifeUser = lifeUserMapper.selectById(commonRating.getUserId());
|
|
LifeUser lifeUser = lifeUserMapper.selectById(commonRating.getUserId());
|
|
|
if (lifeUser != null && StringUtils.isNotEmpty(lifeUser.getUserPhone())) {
|
|
if (lifeUser != null && StringUtils.isNotEmpty(lifeUser.getUserPhone())) {
|
|
|
String receiverId = "user_" + lifeUser.getUserPhone();
|
|
String receiverId = "user_" + lifeUser.getUserPhone();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String storeName = "该";
|
|
|
|
|
+ StoreInfo storeForNotice = storeInfoMapper.selectById(commonRating.getBusinessId());
|
|
|
|
|
+ if (storeForNotice != null && StringUtils.isNotEmpty(storeForNotice.getStoreName())) {
|
|
|
|
|
+ storeName = storeForNotice.getStoreName();
|
|
|
|
|
+ }
|
|
|
|
|
+ String noticeTitle = "评价审核失败通知";
|
|
|
|
|
+ String fullMessage = "您对" + storeName + "店铺的评价未通过审核。失败原因:" + auditReason
|
|
|
|
|
+ + "。您可通过成功发布一条打卡内容,或在评价中上传消费记录两种方式参与店铺评价,审核成功后可在\"我的评价及店铺评价\"中查看。";
|
|
|
|
|
+
|
|
|
// 构建通知内容
|
|
// 构建通知内容
|
|
|
JSONObject contextJson = new JSONObject();
|
|
JSONObject contextJson = new JSONObject();
|
|
|
contextJson.put("ratingId", commonRating.getId());
|
|
contextJson.put("ratingId", commonRating.getId());
|
|
|
contextJson.put("storeId", commonRating.getBusinessId());
|
|
contextJson.put("storeId", commonRating.getBusinessId());
|
|
|
- contextJson.put("message", "您的评价审核未通过:" + auditReason);
|
|
|
|
|
|
|
+ contextJson.put("noticeName", noticeTitle);
|
|
|
|
|
+ contextJson.put("message", fullMessage);
|
|
|
contextJson.put("auditReason", auditReason);
|
|
contextJson.put("auditReason", auditReason);
|
|
|
|
|
|
|
|
// 保存通知到数据库
|
|
// 保存通知到数据库
|
|
@@ -285,7 +296,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
lifeNotice.setSenderId("system");
|
|
lifeNotice.setSenderId("system");
|
|
|
lifeNotice.setReceiverId(receiverId);
|
|
lifeNotice.setReceiverId(receiverId);
|
|
|
lifeNotice.setBusinessId(commonRating.getBusinessId());
|
|
lifeNotice.setBusinessId(commonRating.getBusinessId());
|
|
|
- lifeNotice.setTitle("评价审核通知");
|
|
|
|
|
|
|
+ lifeNotice.setTitle(noticeTitle);
|
|
|
lifeNotice.setContext(contextJson.toJSONString());
|
|
lifeNotice.setContext(contextJson.toJSONString());
|
|
|
lifeNotice.setNoticeType(Constants.Notice.SYSTEM_NOTICE); // 系统通知
|
|
lifeNotice.setNoticeType(Constants.Notice.SYSTEM_NOTICE); // 系统通知
|
|
|
lifeNotice.setIsRead(0);
|
|
lifeNotice.setIsRead(0);
|