Commit 171749c7 by 程裕兵

feat:env check settle

parent 92a5b3f1
......@@ -84,6 +84,7 @@ import javax.annotation.Resource;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
......@@ -98,6 +99,9 @@ public class PayServiceImpl implements PayService {
private static final BigDecimal MAX_AMOUNT = new BigDecimal("10000000");
@Value("${spring.profiles.active}")
private String env;
@Resource
private PayChannelProperties config;
......@@ -334,9 +338,9 @@ public class PayServiceImpl implements PayService {
// 钉钉消息
if (failCount.get() > 0) {
DingUtil.sendCheckSettleFail(failCount.get());
DingUtil.sendCheckSettleFail(env, failCount.get());
} else {
DingUtil.sendCheckSettleSuccess();
DingUtil.sendCheckSettleSuccess(env);
}
}
......
......@@ -16,11 +16,11 @@ public class DingUtil {
public static final String URL = "https://oapi.dingtalk.com/robot/send?access_token=1d52fb498b3d23687dec5aebf5907fb73acde3f29709fc672386d67451c9dfb7";
private static final String CHECK_SETTLE_SUCCESS = "【告警】【乐动收银自动结算记录对账】全部对账成功";
private static final String CHECK_SETTLE_FAIL = "【告警】【乐动收银自动结算记录对账】有%s家对账失败,请人工跟进";
private static final String CHECK_SETTLE_SUCCESS = "%s【告警】【乐动收银自动结算记录对账】全部对账成功";
private static final String CHECK_SETTLE_FAIL = "%s【告警】【乐动收银自动结算记录对账】有%s家对账失败,请人工跟进";
public static void sendCheckSettleFail(Integer total) {
Message message = new TextMessage(String.format(CHECK_SETTLE_FAIL, total));
public static void sendCheckSettleFail(String env, Integer total) {
Message message = new TextMessage(String.format(CHECK_SETTLE_FAIL, env, total));
try {
DingtalkChatbotClient.send(URL, message);
} catch (IOException e) {
......@@ -28,8 +28,8 @@ public class DingUtil {
}
}
public static void sendCheckSettleSuccess() {
Message message = new TextMessage(CHECK_SETTLE_SUCCESS);
public static void sendCheckSettleSuccess(String env) {
Message message = new TextMessage(String.format(CHECK_SETTLE_SUCCESS, env));
try {
DingtalkChatbotClient.send(URL, message);
} catch (IOException 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