|
|
|
@ -9,6 +9,7 @@ import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
|
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -54,15 +55,14 @@ public class NoticeRefundAuditListener implements ApplicationListener<NewRefundA
|
|
|
|
|
|
|
|
|
|
for (JSONObject account : accounts) {
|
|
|
|
|
String wechatOpenid = account.getString("wechat_openid");
|
|
|
|
|
if (wechatOpenid == null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(wechatOpenid);
|
|
|
|
|
if (api != null) {
|
|
|
|
|
String templateId = api.getTemplateId("refund-audit-notice");
|
|
|
|
|
if (templateId != null) {
|
|
|
|
|
String templateId = api.getTemplateId("refund-audit-notice");
|
|
|
|
|
if (api != null && StringUtils.isNotEmpty(templateId)) {
|
|
|
|
|
try {
|
|
|
|
|
TemplateMessage notice = initMessage(newRefundAuditEvent, operatorName, remark, client, order, templateId, wechatOpenid);
|
|
|
|
|
api.sendTemplateMessage(notice);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|