|
@@ -282,11 +282,28 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
282
|
282
|
// 消息发送类型
|
283
|
283
|
String messageType = null == tpl ? CommConstant.MESSAGE_TYPE_OF_SMS :
|
284
|
284
|
isSubscribe ? CommConstant.MESSAGE_TYPE_OF_MINIAPP_SUBSCRIBE : CommConstant.MESSAGE_TYPE_OF_MINIAPP_TEMPLATE;
|
285
|
|
- if (isSubscribe) {
|
286
|
|
- String[] data = new String[]{name, result, programName, remark, failReason, DateUtils.cutSecond(dt)};
|
287
|
|
- sendSubscribeMessage(tpl, toUser, link, data);
|
288
|
|
- }
|
289
|
285
|
|
|
286
|
+ String[] smsParams = {miniapp.getName() + "小程序-" + name};
|
|
287
|
+
|
|
288
|
+ if (null == tpl) {
|
|
289
|
+ log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), contentType);
|
|
290
|
+
|
|
291
|
+ // 短信发送
|
|
292
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
|
293
|
+ } else {
|
|
294
|
+ if (isSubscribe) {
|
|
295
|
+ String[] data = new String[]{name, result, programName, remark, failReason, DateUtils.cutSecond(dt)};
|
|
296
|
+ ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
|
297
|
+ if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
|
298
|
+ // 使用短信发送
|
|
299
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
|
300
|
+ messageType = CommConstant.MESSAGE_TYPE_OF_SMS;
|
|
301
|
+ }
|
|
302
|
+ } else {
|
|
303
|
+ log.info("发送模板消息");
|
|
304
|
+
|
|
305
|
+ }
|
|
306
|
+ }
|
290
|
307
|
// TODO 写消息发送日志
|
291
|
308
|
// 更新消息发送时间
|
292
|
309
|
iTaPersonMessageRuleService.saveOrUpdateByPersonAndMessage(toUser.getPersonId(), messageType, contentType, toUser.getOrgId());
|