wangyunpeng 3 minggu lalu
induk
melakukan
156e406bec

+ 8 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/LarkRobotUtil.java

@@ -121,6 +121,14 @@ public class LarkRobotUtil {
         }
     }
 
+    public static void sendNotPushMessage(JSONObject param) {
+        try {
+            HTTP_POOL_CLIENT_UTIL_DEFAULT.post(WE_COM_NOT_PUSH_URL, param.toJSONString());
+        } catch (Exception e) {
+            log.error("Lark sendMessage error", e);
+        }
+    }
+
 
     private static String getSign(long timestamp) throws NoSuchAlgorithmException, InvalidKeyException {
         //把timestamp+"\n"+密钥当做签名字符串

+ 23 - 18
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComHistoryDataJob.java

@@ -31,7 +31,6 @@ 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;
@@ -168,14 +167,14 @@ public class WeComHistoryDataJob {
             successSendCount += sendCountList.get(1);
             notFriendCount += sendCountList.get(2);
             failSendCount += sendCountList.get(3);
-            if (sendCountList.get(0) > 0 && !specialStaffIdList.contains(sendDetail.getStaffId())) {
-                //LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
-                //LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
-                //8点前报警
-                if (DateUtil.getHourOfDay() < 8 && (corpId == 1 || corpId == 3)) {
-                    LarkRobotUtil.sendNotPushMessage("<at user_id=\"g6732afb\">王云鹏</at> " + sendDetail.getRemark() + " 存在未发送记录,请检查");
-                }
-            }
+            //if (sendCountList.get(0) > 0 && !specialStaffIdList.contains(sendDetail.getStaffId())) {
+            //    LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
+            //    LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
+            //    //8点前报警
+            //    if (DateUtil.getHourOfDay() < 9 && (corpId == 1 || corpId == 3)) {
+            //        LarkRobotUtil.sendNotPushMessage("<at user_id=\"all\">所有人</at> " + sendDetail.getRemark() + " 存在未发送记录,请检查");
+            //    }
+            //}
 
             JSONObject row = new JSONObject();
             row.put("name", sendDetail.getRemark());
@@ -199,13 +198,16 @@ public class WeComHistoryDataJob {
             JSONObject bodyParam = buildCheckQWMsg(corpName, rows);
             LarkRobotUtil.sendMessage(bodyParam);
             LarkRobotUtil.sendTipMessage(bodyParam);
+            if (DateUtil.getHourOfDay() < 9 && (corpId == 1 || corpId == 3)) {
+                LarkRobotUtil.sendNotPushMessage(bodyParam);
+            }
         }
         return notSendCount;
     }
 
     private JSONObject buildCheckQWMsg(String corpName, List<JSONObject> rows) {
         List<FeishuTableDTO.Column> columns = buildCheckQWMsgSendColumns();
-        FeishuTableDTO tableDTO = FeishuTableDTO.createTable(corpName, columns, rows, false);
+        FeishuTableDTO tableDTO = FeishuTableDTO.createTable(corpName, columns, rows, true);
         JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
         JSONObject bodyParam = new JSONObject();
         bodyParam.put("msg_type", "interactive");
@@ -316,14 +318,14 @@ public class WeComHistoryDataJob {
             }
 
 
-            if (count == sendCountList.get(0)) {
-                //LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
-                if (sendDetail.getStaffId() == 3) {
-                    //LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
-                } else {
-                    LarkRobotUtil.sendNotPushMessage("<at user_id=\"g6732afb\">王云鹏</at> " + sendDetail.getRemark() + " 存在未发送记录,请检查");
-                }
-            }
+            //if (count == sendCountList.get(0)) {
+            //    //LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
+            //    if (sendDetail.getStaffId() == 3) {
+            //        //LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
+            //    } else {
+            //        LarkRobotUtil.sendNotPushMessage("<at user_id=\"all\">所有人</at> " + sendDetail.getRemark() + " 存在未发送记录,请检查");
+            //    }
+            //}
             JSONObject row = new JSONObject();
             row.put("name", sendDetail.getRemark());
             row.put("totalCount", count);
@@ -336,6 +338,9 @@ public class WeComHistoryDataJob {
         JSONObject bodyParam = buildCheckQWMsg(corpName, rows);
         LarkRobotUtil.sendMessage(bodyParam);
         LarkRobotUtil.sendTipMessage(bodyParam);
+        if (DateUtil.getHourOfDay() < 9 && (corpId == 1 || corpId == 3)) {
+            LarkRobotUtil.sendNotPushMessage(bodyParam);
+        }
     }
 
     private void selectGroupMsgList(Long startTime, Long endTime, Long corpId, Long staffId) {