Browse Source

Merge branch 'dev-xym-update-text' of Server/growth-manager into master

xueyiming 3 months ago
parent
commit
96d690690b

+ 10 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/MessageConstant.java

@@ -1,5 +1,8 @@
 package com.tzld.piaoquan.growth.common.common.constant;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public interface MessageConstant {
 
     //推送保底内容
@@ -7,6 +10,13 @@ public interface MessageConstant {
 
     String morningText = "早安,新的一天,愿你拥有最好的心情去迎接一切美好!爆款视频抢先观看,点击下方精彩不断~";
 
+    String specialText = "亲爱的老友好!温水暖胃勤添衣,养生小视频更新啦!点开小程序看看,精彩不断~";
+
+    List<Long> specialStaffIdList = new ArrayList<Long>() {{
+        add(16L);
+        add(17L);
+    }};
+
     //小程序id
     String appid = "wxbdd2a2e93d9a6e25";
 

+ 7 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageServiceImpl.java

@@ -18,8 +18,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
+import static com.tzld.piaoquan.growth.common.common.constant.MessageConstant.specialStaffIdList;
 import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.POST_WE_COM_ADD_MSG_TEMPLATE;
 
 
@@ -36,6 +38,7 @@ public class MessageServiceImpl implements MessageService {
     @Autowired
     private PreSpecialSendMessageMapper preSpecialSendMessageMapper;
 
+
     @Override
     public boolean pushWeComMessage(JSONObject jsonObject, Long corpId) {
         try {
@@ -59,7 +62,10 @@ public class MessageServiceImpl implements MessageService {
 
 
     @Override
-    public String getMessageText() {
+    public String getMessageText(Long staffId) {
+        if (specialStaffIdList.contains(staffId)) {
+            return MessageConstant.specialText;
+        }
         Integer hour = DateUtil.getHourOfDay();
         if (hour < 12) {
             return MessageConstant.morningText;

+ 1 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageService.java

@@ -10,7 +10,7 @@ public interface MessageService {
 
     boolean pushWeComMessage(JSONObject jsonObject, Long corpId);
 
-    String getMessageText();
+    String getMessageText(Long staffId);
 
     CommonResponse<Void> createPreSpecialAssembleSendMessage(List<PreSpecialSendMessage> preSpecialSendMessages);
 }

+ 3 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComHistoryDataJob.java

@@ -3,6 +3,7 @@ package com.tzld.piaoquan.offline.job;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
+import com.tzld.piaoquan.growth.common.common.constant.MessageConstant;
 import com.tzld.piaoquan.growth.common.common.constant.TimeConstant;
 import com.tzld.piaoquan.growth.common.common.enums.MessageAttachmentTypeEnum;
 import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
@@ -35,6 +36,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import static com.tzld.piaoquan.growth.common.common.constant.MessageConstant.MAX_VIDEO_NUM;
+import static com.tzld.piaoquan.growth.common.common.constant.MessageConstant.specialStaffIdList;
 import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.*;
 import static com.tzld.piaoquan.growth.common.common.enums.SourceEnum.HISTORICAL_TOP;
 import static com.tzld.piaoquan.growth.common.common.enums.SourceEnum.MANUAL;
@@ -155,7 +157,7 @@ public class WeComHistoryDataJob {
             long count = sendCountList.get(0) + sendCountList.get(1) + sendCountList.get(2) + sendCountList.get(3);
             allCount += count;
             notSend += sendCountList.get(0);
-            if (count != 0 && sendCountList.get(0) > 0) {
+            if (count != 0 && sendCountList.get(0) > 0 && !specialStaffIdList.contains(sendDetail.getStaffId())) {
                 LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
                 if (sendDetail.getStaffId() == 3) {
                     LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");

+ 1 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java

@@ -509,7 +509,7 @@ public class WeComMessageDataJob {
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("chat_type", "single");
         JSONObject text = new JSONObject();
-        String content = messageService.getMessageText();
+        String content = messageService.getMessageText(staff.getId());
         text.put("content", content);
         jsonObject.put("text", text);
         jsonObject.put("sender", staff.getCarrierId());

+ 1 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComSpecialDataJob.java

@@ -197,7 +197,7 @@ public class WeComSpecialDataJob {
         if (StringUtils.isNotEmpty(specialSendMessage.getContent())) {
             text.put("content", specialSendMessage.getContent());
         } else {
-            text.put("content", messageService.getMessageText());
+            text.put("content", messageService.getMessageText(staff.getId()));
         }
         jsonObject.put("text", text);
         jsonObject.put("sender", staff.getCarrierId());