Jelajahi Sumber

注销用户发送系统站内信+撤销注销站内信+申述差评系统通知+申述评价+打卡审核通知 +差评通过通知+审核结果通知

liudongzhi 2 jam lalu
induk
melakukan
d3698cbf17

+ 20 - 0
alien-store/src/main/java/shop/alien/store/service/impl/CommonRatingServiceImpl.java

@@ -44,6 +44,8 @@ import shop.alien.util.common.constant.CommentSourceTypeEnum;
 import shop.alien.util.common.constant.RatingBusinessTypeEnum;
 import shop.alien.util.common.safe.TextModerationUtil;
 import shop.alien.util.common.safe.TextReviewServiceEnum;
+import shop.alien.util.type.PhoneTypeIdResult;
+import shop.alien.util.type.TypeUtil;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -93,6 +95,8 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
     private final StoreClockInMapper storeClockInMapper;
     private final OrderReviewService orderReviewService;
 
+    private TypeUtil typeUtil;
+
     public static final List<String> SERVICES_LIST = ImmutableList.of(
             TextReviewServiceEnum.COMMENT_DETECTION_PRO.getService(),
             TextReviewServiceEnum.LLM_QUERY_MODERATION.getService()
@@ -291,6 +295,14 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                         LifeNotice lifeNotice = new LifeNotice();
                         lifeNotice.setSenderId("system");
                         lifeNotice.setReceiverId(receiverId);
+
+                        if (receiverId.contains("_")){
+                            PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(receiverId);
+                            lifeNotice.setReceiverUserType(phoneTypeIdResult.getType());
+                            lifeNotice.setReceiverRefId(phoneTypeIdResult.getId());
+                        }
+
+
                         lifeNotice.setBusinessId(commonRating.getBusinessId());
                         lifeNotice.setTitle(noticeTitle);
                         lifeNotice.setContext(contextJson.toJSONString());
@@ -498,6 +510,14 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                 String commonDate = simpleDateFormat.format(new Date());
                 LifeNotice lifeMessage = new LifeNotice();
                 lifeMessage.setReceiverId("store_" + storeUser.getPhone());
+
+                if (lifeMessage.getReceiverId().contains("_")){
+                        PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(lifeMessage.getReceiverId());
+                        lifeMessage.setReceiverUserType(phoneTypeIdResult.getType());
+                        lifeMessage.setReceiverRefId(phoneTypeIdResult.getId());
+                }
+
+
                 String text = "在"+commonDate+",您的店铺有一条差评记录,您可查看评价内容是否属实,如不属实,可向平台进行申诉。";
                 JSONObject jsonObject = new JSONObject();
                 jsonObject.put("message", text);

+ 4 - 0
alien-store/src/main/java/shop/alien/store/service/impl/LifeMessageServiceImpl.java

@@ -20,6 +20,7 @@ import shop.alien.store.service.LifeMessageService;
 import shop.alien.store.service.LifeUserService;
 import shop.alien.util.common.JwtUtil;
 import shop.alien.util.common.constant.LawyerStatusEnum;
+import shop.alien.util.type.TypeUtil;
 
 import java.util.ArrayList;
 import java.util.Comparator;
@@ -47,6 +48,9 @@ public class LifeMessageServiceImpl extends ServiceImpl<LifeMessageMapper, LifeM
     private final LawyerUserMapper lawyerUserMapper;
     private final LawyerConsultationOrderMapper lawyerConsultationOrderMapper;
 
+
+    private TypeUtil typeUtil;
+
     @Override
     public List<LifeMessageVo> getMessageList(String receiverId, int friendType, String search ,String userName) throws Exception {
         try {

+ 9 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreClockInServiceImpl.java

@@ -439,7 +439,16 @@ public class StoreClockInServiceImpl extends ServiceImpl<StoreClockInMapper, Sto
             LifeNotice lifeNotice = new LifeNotice();
             lifeNotice.setSenderId("system");
             lifeNotice.setBusinessId(clockInId);
+
             lifeNotice.setReceiverId(phoneId);
+
+            if (phoneId.contains("_")){
+                PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(phoneId);
+                lifeNotice.setReceiverUserType(phoneTypeIdResult.getType());
+                lifeNotice.setReceiverRefId(phoneTypeIdResult.getId());
+            }
+
+
             lifeNotice.setTitle("打卡审核通知");
             lifeNotice.setNoticeType(1); // 1-系统通知
             lifeNotice.setIsRead(0);

+ 13 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentAppealServiceImpl.java

@@ -44,6 +44,8 @@ import shop.alien.util.common.safe.TextModerationResultVO;
 import shop.alien.util.common.safe.TextModerationUtil;
 import shop.alien.util.common.safe.TextReviewServiceEnum;
 import shop.alien.util.common.constant.CommentSourceTypeEnum;
+import shop.alien.util.type.PhoneTypeIdResult;
+import shop.alien.util.type.TypeUtil;
 
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
@@ -110,6 +112,9 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
     @Value("${third-party-ai-resultUrl.base-url}")
     private String resultUrl;
 
+
+    private TypeUtil typeUtil;
+
     /**
      * 懒得查, 留着导出Excel
      */
@@ -678,6 +683,14 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
 
         LifeNotice lifeMessage = new LifeNotice();
         lifeMessage.setReceiverId("store_" + storeUser.getPhone());
+
+        if (lifeMessage.getReceiverId().contains("_")){
+            PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(lifeMessage.getReceiverId());
+            lifeMessage.setReceiverUserType(phoneTypeIdResult.getType());
+            lifeMessage.setReceiverRefId(phoneTypeIdResult.getId());
+        }
+
+
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("message", text);
         lifeMessage.setContext(jsonObject.toJSONString());

+ 14 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -52,6 +52,8 @@ import shop.alien.util.common.constant.CouponStatusEnum;
 import shop.alien.util.common.constant.CouponTypeEnum;
 import shop.alien.util.common.constant.OcrTypeEnum;
 import shop.alien.util.common.constant.OrderStatusEnum;
+import shop.alien.util.type.PhoneTypeIdResult;
+import shop.alien.util.type.TypeUtil;
 
 import javax.annotation.Resource;
 import java.io.File;
@@ -160,6 +162,8 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
 
     private final StoreOfficialAlbumMapper storeOfficialAlbumMapper;
 
+    private TypeUtil typeUtil;
+
     /**
      * 运营活动数据访问对象
      */
@@ -2210,6 +2214,16 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         LifeNotice lifeNotice = new LifeNotice();
         lifeNotice.setSenderId("system");
         lifeNotice.setReceiverId("store_" + storeUser.getPhone());
+
+
+        if (lifeNotice.getReceiverId().contains("_")){
+            PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(lifeNotice.getReceiverId());
+            lifeNotice.setReceiverUserType(phoneTypeIdResult.getType());
+            lifeNotice.setReceiverRefId(phoneTypeIdResult.getId());
+        }
+
+
+
         lifeNotice.setBusinessId(storeInfo.getId());
         lifeNotice.setTitle("店铺审核通知");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

+ 21 - 0
alien-store/src/main/java/shop/alien/store/service/impl/StoreUserServiceImpl.java

@@ -34,6 +34,8 @@ import shop.alien.store.util.FunctionMagic;
 import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.DateUtils;
 import shop.alien.util.common.JwtUtil;
+import shop.alien.util.type.PhoneTypeIdResult;
+import shop.alien.util.type.TypeUtil;
 
 import java.io.File;
 import java.io.IOException;
@@ -82,6 +84,9 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
 
     private final WebSocketProcess webSocketProcess;
 
+
+    private TypeUtil typeUtil;
+
     @Value("${spring.web.resources.excel-path}")
     private String excelPath;
 
@@ -1047,6 +1052,13 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
                 lifeMessage.setSenderId("system");
                 lifeMessage.setIsRead(0);
                 lifeMessage.setNoticeType(1);
+
+                if (lifeMessage.getReceiverId().contains("_")){
+                    PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(lifeMessage.getReceiverId());
+                    lifeMessage.setReceiverUserType(phoneTypeIdResult.getType());
+                    lifeMessage.setReceiverRefId(phoneTypeIdResult.getId());
+                }
+
                 lifeNoticeMapper.insert(lifeMessage);
 
                 WebSocketVo websocketVo = new WebSocketVo();
@@ -1088,6 +1100,15 @@ public class StoreUserServiceImpl extends ServiceImpl<StoreUserMapper, StoreUser
             // 发送通知
             LifeNotice lifeMessage = new LifeNotice();
             lifeMessage.setReceiverId("store_" + storeUser.getPhone());
+
+
+            if (lifeMessage.getReceiverId().contains("_")){
+                PhoneTypeIdResult phoneTypeIdResult =typeUtil.resolveTypeAndId(lifeMessage.getReceiverId());
+                lifeMessage.setReceiverUserType(phoneTypeIdResult.getType());
+                lifeMessage.setReceiverRefId(phoneTypeIdResult.getId());
+            }
+
+
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String storeDate = simpleDateFormat.format(storeUser.getCreatedTime());
             String text = "您在" + storeDate + "撤销了注销账号,所有数据均已保留,您可继续在平台使用。";