充值告警-google和payermax

This commit is contained in:
2022-11-07 12:13:19 +08:00
parent f2eedd7890
commit ded242e043
2 changed files with 14 additions and 58 deletions

View File

@@ -78,6 +78,14 @@ public final class ChargeNotifyUtil {
channelName = "微信H5支付";
break;
}
case Constant.ChargeChannel.google_play_billing: {
channelName = "google支付";
break;
}
case Constant.ChargeChannel.payermax: {
channelName = "payermax支付";
break;
}
}
return channelName;
}
@@ -85,12 +93,7 @@ public final class ChargeNotifyUtil {
public String getAppName(String app) {
String appName = "";
if (StringUtils.isNotBlank(app)) {
if (app.contains("PlanetStar")) {
return "66星球";
}
if (app.contains("yinyou")) {
return "平台";
}
return "peko";
}
return appName;
}

View File

@@ -10,6 +10,7 @@
*/
package com.accompany.scheduler.task;
import com.accompany.business.util.ChargeNotifyUtil;
import com.accompany.common.push.MarkdownMessage;
import com.accompany.business.mybatismapper.ChargeNotifyMapper;
import com.accompany.business.service.push.EnterpriseWechatPushService;
@@ -43,6 +44,8 @@ public class ChargeNotifyTask extends BaseTask {
private ChargeNotifyMapper chargeNotifyMapper;
@Autowired
private SysConfService sysConfService;
@Autowired
private ChargeNotifyUtil chargeNotifyUtil;
@Scheduled(cron = "0 0/10 * * * ?")
public void sendChargeNotify() {
@@ -68,60 +71,10 @@ public class ChargeNotifyTask extends BaseTask {
private void sendEnterpriseWechatMsg(ChargeNotifyVO vo) {
MarkdownMessage msg = new MarkdownMessage();
msg.add(MarkdownMessage.getHeaderText(3, "充值服务异常提醒"));
msg.add(MarkdownMessage.getReferenceText(getChannelName(vo.getChargeChannel())));
String appName = getAppName(vo.getChargeApp());
msg.add(MarkdownMessage.getReferenceText(chargeNotifyUtil.getAppName(vo.getChargeChannel())));
String appName = chargeNotifyUtil.getAppName(vo.getChargeApp());
msg.add(MarkdownMessage.getReferenceText("" + appName + "" + "前10分钟支付失败率过高请关注"));
enterpriseWechatPushService.pushMessage(msg);
}
private String getChannelName(String channel) {
String channelName = "";
switch (channel) {
case Constant.ChargeChannel.alipay: {
channelName = "支付宝支付";
break;
}
case Constant.ChargeChannel.alipay_wap: {
channelName = "支付宝H5支付";
break;
}
case Constant.ChargeChannel.ios_pay: {
channelName = "IOS支付";
break;
}
case Constant.ChargeChannel.lucky_tarot: {
channelName = "幸运塔罗充值";
break;
}
case Constant.ChargeChannel.wx: {
channelName = "微信支付";
break;
}
case Constant.ChargeChannel.wx_micro_mall_pub: {
channelName = "微商城微信公众号支付";
break;
}
case Constant.ChargeChannel.wx_mini_app_channel: {
channelName = "小程序支付";
break;
}
case Constant.ChargeChannel.wx_pub: {
channelName = "微信公众号支付";
break;
}
case Constant.ChargeChannel.wx_wap: {
channelName = "微信H5支付";
break;
}
}
return channelName;
}
private String getAppName(String app) {
String appName = "";
if (StringUtils.isNotBlank(app)) {
return "peko";
}
return appName;
}
}