Commit 0caba177 by 吴一龙

钉钉群报警@

parent f27582c8
package com.jiejing.fitness.finance.service.utils;
import com.google.common.collect.Lists;
import com.jiejing.common.dingtalk.chatbot.DingtalkChatbotClient;
import com.jiejing.common.dingtalk.chatbot.message.MarkdownMessage;
import com.jiejing.common.dingtalk.chatbot.message.Message;
import com.jiejing.common.dingtalk.chatbot.message.TextMessage;
import java.io.IOException;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
......@@ -20,8 +22,14 @@ public class DingUtil {
private static final String CHECK_SETTLE_FAIL = "%s【告警】【乐动收银自动结算记录对账】有%s家对账失败,请人工跟进";
private static final String CREATE_COMMODITY_TEMPLATE_FAIL = "【%s】【告警】场馆id%s,先享后付商品创建失败,商品id为%s,请立即处理";
/**
* 报警器@人,邵之涛,宾哥,一龙
*/
private static final List<String> AT_WARNING_MOBILES = Lists.newArrayList("15356694625", "15868150199", "13073663323");
public static void sendCheckSettleFail(String env, Integer total) {
Message message = new TextMessage(String.format(CHECK_SETTLE_FAIL, env, total));
TextMessage message = new TextMessage(String.format(CHECK_SETTLE_FAIL, env, total));
message.setAtMobiles(AT_WARNING_MOBILES);
try {
DingtalkChatbotClient.send(URL, message);
} catch (IOException e) {
......@@ -30,7 +38,8 @@ public class DingUtil {
}
public static void sendCheckSettleSuccess(String env) {
Message message = new TextMessage(String.format(CHECK_SETTLE_SUCCESS, env));
TextMessage message = new TextMessage(String.format(CHECK_SETTLE_SUCCESS, env));
message.setAtMobiles(AT_WARNING_MOBILES);
try {
DingtalkChatbotClient.send(URL, message);
} catch (IOException e) {
......@@ -42,6 +51,7 @@ public class DingUtil {
try {
String text = String.format(CREATE_COMMODITY_TEMPLATE_FAIL, env, studioId, id);
TextMessage textMessage = new TextMessage(text);
textMessage.setAtMobiles(AT_WARNING_MOBILES);
DingtalkChatbotClient.send(URL, textMessage);
} catch (IOException e) {
log.error("sendCreateCommodityTemplateFail {}, {}", studioId, id, e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment