Explorar el Código

Merge branch 'dev-xym-add-gh-interface' into dev-xym-add-alerts

# Conflicts:
#	common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/LarkRobotUtil.java
xueyiming hace 4 meses
padre
commit
4ce5e31299

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

@@ -19,6 +19,9 @@ public class LarkRobotUtil {
 
     private static final String TIP_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/0eb8793a-5bb3-43d7-aa74-fed1c91e3d9b";
 
+    private static final String WE_COM_NOT_PUSH_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/6fa54ed6-12f7-45c1-a33b-020d4f4483ef";
+
+
     private static final String AUTO_REPLY_VIDEO_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/0d80b7dc-47d1-4c27-a7e1-97f2fb6ba26e";
 
     private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(3000, 10000, 20, 100, 3, 3000);
@@ -76,6 +79,20 @@ public class LarkRobotUtil {
         }
     }
 
+    public static void sendNotPushMessage(String msg) {
+        try {
+            JSONObject param = new JSONObject();
+            param.put("msg_type", "text");
+            JSONObject content = new JSONObject();
+            content.put("text", msg);
+            param.put("content", content);
+            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"+密钥当做签名字符串
         String stringToSign = timestamp + "\n" + SECRET;

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

@@ -155,13 +155,13 @@ public class WeComHistoryDataJob {
             }
             stringBuilder.append(sendDetail.getRemark());
             long count = sendCountList.get(0) + sendCountList.get(1) + sendCountList.get(2) + sendCountList.get(3);
-            Long notSentCount = sendCountList.get(0);
-            if (notSentCount != 0) {
+            if (count != 0 && count == sendCountList.get(0)) {
                 LarkRobotUtil.sendMessage("@薛一鸣 存在未发送记录,请检查");
                 if (sendDetail.getStaffId() == 3) {
                     LarkRobotUtil.sendTipMessage("@王钧灏 存在未发送记录,请检查");
                 } else {
-                    LarkRobotUtil.sendTipMessage("@孟庆红 存在未发送记录,请检查");
+                    LarkRobotUtil.sendNotPushMessage("@孟孟 " + sendDetail.getRemark() + " 存在未发送记录,请检查");
+                    LarkRobotUtil.sendNotPushMessage("@邓峰 " + sendDetail.getRemark() + " 存在未发送记录,请检查");
                 }
             }
             stringBuilder.append("总发送数量:").append(count).append("   ");