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