|
@@ -9,13 +9,16 @@ import com.huiju.estateagents.common.*;
|
9
|
9
|
import com.huiju.estateagents.entity.*;
|
10
|
10
|
import com.huiju.estateagents.mapper.*;
|
11
|
11
|
import com.huiju.estateagents.service.IMiniAppService;
|
|
12
|
+import com.huiju.estateagents.service.ISysOrgParamsService;
|
12
|
13
|
import com.huiju.estateagents.service.ITaMiniFormidsService;
|
|
14
|
+import com.huiju.estateagents.service.ITaPersonMessageRuleService;
|
13
|
15
|
import lombok.extern.slf4j.Slf4j;
|
14
|
16
|
import me.chanjar.weixin.common.error.WxErrorException;
|
15
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
16
|
18
|
import org.springframework.stereotype.Service;
|
17
|
19
|
|
18
|
20
|
import java.io.File;
|
|
21
|
+import java.time.Duration;
|
19
|
22
|
import java.time.LocalDateTime;
|
20
|
23
|
import java.util.ArrayList;
|
21
|
24
|
import java.util.List;
|
|
@@ -42,6 +45,12 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
42
|
45
|
@Autowired
|
43
|
46
|
SysSmsSettingMapper sysSmsSettingMapper;
|
44
|
47
|
|
|
48
|
+ @Autowired
|
|
49
|
+ ITaPersonMessageRuleService iTaPersonMessageRuleService;
|
|
50
|
+
|
|
51
|
+ @Autowired
|
|
52
|
+ ISysOrgParamsService iSysOrgParamsService;
|
|
53
|
+
|
45
|
54
|
@Autowired
|
46
|
55
|
WxUtils wxUtils;
|
47
|
56
|
|
|
@@ -81,33 +90,76 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
81
|
90
|
log.error("小程序 {} 不存在", toUser.getMiniappId());
|
82
|
91
|
return ;
|
83
|
92
|
}
|
84
|
|
- String[] smsParams = { name, miniapp.getName() + "小程序" };
|
85
|
93
|
|
86
|
|
- TaMiniappTemplate tpl = getTplByType(CommConstant.MINIAPP_TPL_NOTICE, toUser.getMiniappId());
|
|
94
|
+ // 消息内容类型
|
|
95
|
+ String contentType = CommConstant.MESSAGE_CONTENT_OF_NOTICE;
|
|
96
|
+
|
|
97
|
+ // 查询消息类型, 优先选择订阅消息发送
|
|
98
|
+ TaMiniappTemplate tpl = getTplByType(contentType, toUser.getMiniappId());
|
|
99
|
+
|
|
100
|
+ boolean isSubscribe = null != tpl && (null == tpl.getIsSubscribe() ? false : tpl.getIsSubscribe());
|
|
101
|
+
|
|
102
|
+ // 入库的消息类型使用的是 MESSAGE_TYPE_OF_SOMEWAY, 不能使用真正的类型
|
|
103
|
+ // 因为 通知消息 只注重内容, 不在乎 发送方式
|
|
104
|
+ String messageType = CommConstant.MESSAGE_TYPE_OF_SOMEWAY;
|
|
105
|
+
|
|
106
|
+ // 消息发送间隔, -1 代表不限制
|
|
107
|
+ float interval = -1f;
|
|
108
|
+
|
|
109
|
+ // 获取系统设置, 单位分钟
|
|
110
|
+ SysOrgParams sysOrgParams = iSysOrgParamsService.getParamByCode(CommConstant.SYSPARAM_NOTICE_MESSAGE_INTERVAL, toUser.getOrgId());
|
|
111
|
+ if (null != sysOrgParams && !StringUtils.isEmpty(sysOrgParams.getParamValue())) {
|
|
112
|
+ interval = Float.parseFloat(sysOrgParams.getParamValue());
|
|
113
|
+ }
|
|
114
|
+
|
|
115
|
+ // 获取用户消息发送记录
|
|
116
|
+ TaPersonMessageRule taPersonMessageRule = iTaPersonMessageRuleService.getByPersonAndType(toUser.getPersonId(), messageType, contentType, toUser.getOrgId());
|
|
117
|
+ if (null == taPersonMessageRule) {
|
|
118
|
+ interval = -1f;
|
|
119
|
+ }
|
|
120
|
+
|
|
121
|
+ // 如果需要判断间隔
|
|
122
|
+ if (interval > 0 && null != taPersonMessageRule.getLastSendTime()) {
|
|
123
|
+ LocalDateTime now = LocalDateTime.now();
|
|
124
|
+ // 间隔时间
|
|
125
|
+ Duration diff = Duration.between(taPersonMessageRule.getLastSendTime(), now);
|
|
126
|
+
|
|
127
|
+ // 统一转换为 秒 比较
|
|
128
|
+ // 如果间隔时间小于设定时间, 就不发送消息
|
|
129
|
+ if ((diff.toMillis() / 1000) < (interval * 60)) {
|
|
130
|
+ log.info("通知消息间隔小于设定值, 不变发送消息");
|
|
131
|
+ return;
|
|
132
|
+ }
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ String[] smsParams = { name, miniapp.getName() + "小程序" };
|
87
|
136
|
if (null == tpl) {
|
88
|
|
- log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), CommConstant.MINIAPP_TPL_NOTICE);
|
|
137
|
+ log.error("小程序 {} 不存在 或者 无通知消息模板 {}", toUser.getMiniappId(), contentType);
|
89
|
138
|
|
90
|
139
|
// 短信发送
|
91
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_NOTICE, smsParams);
|
92
|
|
- };
|
93
|
|
-
|
94
|
|
- if (((Boolean) true).equals(tpl.getIsSubscribe())) {
|
95
|
|
- String[] data = new String[] { name, phone, content, DateUtils.cutSecond(dt) };
|
96
|
|
- ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
97
|
|
- if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
98
|
|
- // 使用短信发送
|
99
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_NOTICE, smsParams);
|
100
|
|
- }
|
|
140
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
101
|
141
|
} else {
|
102
|
|
- List<WxMaTemplateData> data = new ArrayList<>();
|
103
|
|
- data.add(new WxMaTemplateData("keyword1", name, "#fffff"));
|
104
|
|
- data.add(new WxMaTemplateData("keyword2", phone, "#fffff"));
|
105
|
|
- data.add(new WxMaTemplateData("keyword3", content, "#fffff"));
|
106
|
|
- data.add(new WxMaTemplateData("keyword4", DateUtils.cutSecond(dt), "#fffff"));
|
107
|
142
|
|
108
|
|
- sendMessage(CommConstant.MINIAPP_TPL_NOTICE, toUser, link, data);
|
109
|
|
- return;
|
|
143
|
+ if (isSubscribe) {
|
|
144
|
+ String[] data = new String[] { name, phone, content, DateUtils.cutSecond(dt) };
|
|
145
|
+ ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
|
146
|
+ if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
|
147
|
+ // 使用短信发送
|
|
148
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
|
149
|
+ }
|
|
150
|
+ } else {
|
|
151
|
+ List<WxMaTemplateData> data = new ArrayList<>();
|
|
152
|
+ data.add(new WxMaTemplateData("keyword1", name, "#fffff"));
|
|
153
|
+ data.add(new WxMaTemplateData("keyword2", phone, "#fffff"));
|
|
154
|
+ data.add(new WxMaTemplateData("keyword3", content, "#fffff"));
|
|
155
|
+ data.add(new WxMaTemplateData("keyword4", DateUtils.cutSecond(dt), "#fffff"));
|
|
156
|
+
|
|
157
|
+ sendMessage(contentType, toUser, link, data);
|
|
158
|
+ }
|
110
|
159
|
}
|
|
160
|
+
|
|
161
|
+ // 更新消息发送时间
|
|
162
|
+ iTaPersonMessageRuleService.saveOrUpdateByPersonAndMessage(toUser.getPersonId(), messageType, contentType, toUser.getOrgId());
|
111
|
163
|
}
|
112
|
164
|
|
113
|
165
|
@Override
|
|
@@ -117,31 +169,49 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
117
|
169
|
log.error("小程序 {} 不存在", toUser.getMiniappId());
|
118
|
170
|
return ;
|
119
|
171
|
}
|
|
172
|
+
|
|
173
|
+ // 消息内容类型
|
|
174
|
+ String contentType = CommConstant.MESSAGE_CONTENT_OF_HELP;
|
|
175
|
+
|
|
176
|
+ TaMiniappTemplate tpl = getTplByType(contentType, toUser.getMiniappId());
|
|
177
|
+
|
|
178
|
+ boolean isSubscribe = null != tpl && (null == tpl.getIsSubscribe() ? false : tpl.getIsSubscribe());
|
|
179
|
+
|
|
180
|
+ // 消息发送类型
|
|
181
|
+ String messageType = null == tpl ? CommConstant.MESSAGE_TYPE_OF_SMS :
|
|
182
|
+ isSubscribe ? CommConstant.MESSAGE_TYPE_OF_MINIAPP_SUBSCRIBE : CommConstant.MESSAGE_TYPE_OF_MINIAPP_TEMPLATE;
|
|
183
|
+
|
120
|
184
|
String[] smsParams = { miniapp.getName() + "小程序-" + activityName };
|
121
|
185
|
|
122
|
|
- TaMiniappTemplate tpl = getTplByType(CommConstant.MINIAPP_TPL_HELP, toUser.getMiniappId());
|
123
|
186
|
if (null == tpl) {
|
124
|
|
- log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), CommConstant.MINIAPP_TPL_HELP);
|
|
187
|
+ log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), contentType);
|
125
|
188
|
|
126
|
189
|
// 短信发送
|
127
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_HELP, smsParams);
|
128
|
|
- };
|
129
|
|
-
|
130
|
|
- if (((Boolean) true).equals(tpl.getIsSubscribe())) {
|
131
|
|
- String[] data = new String[] { activityName, result };
|
132
|
|
- ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
133
|
|
- if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
134
|
|
- // 使用短信发送
|
135
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_HELP, smsParams);
|
136
|
|
- }
|
|
190
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
137
|
191
|
} else {
|
138
|
|
- List<WxMaTemplateData> data = new ArrayList<>();
|
139
|
|
- data.add(new WxMaTemplateData("keyword1", result, "#fffff"));
|
140
|
|
- data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
|
141
|
|
- data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
|
142
|
|
- sendMessage(CommConstant.MINIAPP_TPL_HELP, toUser, link, data);
|
143
|
|
- return;
|
|
192
|
+
|
|
193
|
+ if (isSubscribe) {
|
|
194
|
+ String[] data = new String[] { activityName, result };
|
|
195
|
+ ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
|
196
|
+ if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
|
197
|
+ // 使用短信发送
|
|
198
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
|
199
|
+
|
|
200
|
+ messageType = CommConstant.MESSAGE_TYPE_OF_SMS;
|
|
201
|
+ }
|
|
202
|
+ } else {
|
|
203
|
+ List<WxMaTemplateData> data = new ArrayList<>();
|
|
204
|
+ data.add(new WxMaTemplateData("keyword1", result, "#fffff"));
|
|
205
|
+ data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
|
|
206
|
+ data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
|
|
207
|
+ sendMessage(contentType, toUser, link, data);
|
|
208
|
+ }
|
144
|
209
|
}
|
|
210
|
+
|
|
211
|
+ // TODO 写消息发送日志
|
|
212
|
+
|
|
213
|
+ // 更新消息发送时间
|
|
214
|
+ iTaPersonMessageRuleService.saveOrUpdateByPersonAndMessage(toUser.getPersonId(), messageType, contentType, toUser.getOrgId());
|
145
|
215
|
}
|
146
|
216
|
|
147
|
217
|
@Override
|
|
@@ -151,91 +221,49 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
151
|
221
|
log.error("小程序 {} 不存在", toUser.getMiniappId());
|
152
|
222
|
return ;
|
153
|
223
|
}
|
154
|
|
- String[] smsParams = { miniapp.getName() + "小程序-" + activityName };
|
155
|
224
|
|
156
|
|
- TaMiniappTemplate tpl = getTplByType(CommConstant.MINIAPP_TPL_GROUP, toUser.getMiniappId());
|
157
|
|
- if (null == tpl) {
|
158
|
|
- log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), CommConstant.MINIAPP_TPL_GROUP);
|
|
225
|
+ // 消息内容类型
|
|
226
|
+ String contentType = CommConstant.MESSAGE_CONTENT_OF_GROUP;
|
159
|
227
|
|
160
|
|
- // 短信发送
|
161
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_GROUP, smsParams);
|
162
|
|
- };
|
163
|
|
-
|
164
|
|
- if (((Boolean) true).equals(tpl.getIsSubscribe())) {
|
165
|
|
- String[] data = new String[] { activityName, result };
|
166
|
|
- ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
167
|
|
- if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
168
|
|
- // 使用短信发送
|
169
|
|
- sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), CommConstant.MINIAPP_TPL_GROUP, smsParams);
|
170
|
|
- }
|
171
|
|
- } else {
|
172
|
|
- List<WxMaTemplateData> data = new ArrayList<>();
|
173
|
|
- data.add(new WxMaTemplateData("keyword1", result, "#fffff"));
|
174
|
|
- data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
|
175
|
|
- data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
|
176
|
|
- sendMessage(CommConstant.MINIAPP_TPL_GROUP, toUser, link, data);
|
177
|
|
- return;
|
178
|
|
- }
|
179
|
|
- }
|
|
228
|
+ TaMiniappTemplate tpl = getTplByType(contentType, toUser.getMiniappId());
|
180
|
229
|
|
181
|
|
- @Override
|
182
|
|
- public void sendMainBizMessage(TaPerson toUser, String link, String custName, String phone, String sex, String fromName, String bizType, String content) {
|
183
|
|
- TaMiniappTemplate tpl = getTplByType("mainbiz", toUser.getMiniappId());
|
184
|
|
- if (null == tpl) {
|
185
|
|
- log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), "mainbiz");
|
|
230
|
+ boolean isSubscribe = null != tpl && (null == tpl.getIsSubscribe() ? false : tpl.getIsSubscribe());
|
186
|
231
|
|
187
|
|
- // TODO
|
188
|
|
- // 短信发送
|
189
|
|
- };
|
190
|
|
-
|
191
|
|
- if (((Boolean) true).equals(tpl.getIsSubscribe())) {
|
192
|
|
- String[] data = new String[] { custName, phone, sex, fromName, bizType, content };
|
193
|
|
- ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
194
|
|
- if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
195
|
|
- // TODO
|
196
|
|
- // 使用短信发送
|
197
|
|
- }
|
198
|
|
- } else {
|
199
|
|
- List<WxMaTemplateData> data = new ArrayList<>();
|
200
|
|
- data.add(new WxMaTemplateData("keyword1", custName, "#fffff"));
|
201
|
|
- data.add(new WxMaTemplateData("keyword2", StringUtils.ifNull(phone, "未知"), "#fffff"));
|
202
|
|
- data.add(new WxMaTemplateData("keyword3",StringUtils.ifNull(sex, "未知"), "#fffff"));
|
203
|
|
- data.add(new WxMaTemplateData("keyword4", fromName, "#fffff"));
|
204
|
|
- data.add(new WxMaTemplateData("keyword5", bizType, "#fffff"));
|
205
|
|
- data.add(new WxMaTemplateData("keyword6", content, "#fffff"));
|
206
|
|
-
|
207
|
|
- sendMessage("mainbiz", toUser, link, data);
|
208
|
|
- return;
|
209
|
|
- }
|
210
|
|
- }
|
|
232
|
+ // 消息发送类型
|
|
233
|
+ String messageType = null == tpl ? CommConstant.MESSAGE_TYPE_OF_SMS :
|
|
234
|
+ isSubscribe ? CommConstant.MESSAGE_TYPE_OF_MINIAPP_SUBSCRIBE : CommConstant.MESSAGE_TYPE_OF_MINIAPP_TEMPLATE;
|
|
235
|
+
|
|
236
|
+ String[] smsParams = { miniapp.getName() + "小程序-" + activityName };
|
211
|
237
|
|
212
|
|
- @Override
|
213
|
|
- public void sendNewCustomerMessage(TaPerson toUser, String link, String custName, String phone, String sex, String fromName) {
|
214
|
|
- TaMiniappTemplate tpl = getTplByType("newCustomer", toUser.getMiniappId());
|
215
|
238
|
if (null == tpl) {
|
216
|
|
- log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), "newCustomer");
|
|
239
|
+ log.error("小程序 {} 无通知消息模板 {}", toUser.getMiniappId(), contentType);
|
217
|
240
|
|
218
|
|
- // TODO
|
219
|
241
|
// 短信发送
|
220
|
|
- };
|
221
|
|
-
|
222
|
|
- if (((Boolean) true).equals(tpl.getIsSubscribe())) {
|
223
|
|
- String[] data = new String[] { custName, phone, sex, fromName };
|
224
|
|
- ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
225
|
|
- if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
226
|
|
- // TODO
|
227
|
|
- // 使用短信发送
|
228
|
|
- }
|
|
242
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
229
|
243
|
} else {
|
230
|
|
- List<WxMaTemplateData> data = new ArrayList<>();
|
231
|
|
- data.add(new WxMaTemplateData("keyword1", custName, "#fffff"));
|
232
|
|
- data.add(new WxMaTemplateData("keyword2", StringUtils.ifNull(phone, "未知"), "#fffff"));
|
233
|
|
- data.add(new WxMaTemplateData("keyword3",StringUtils.ifNull(sex, "未知"), "#fffff"));
|
234
|
|
- data.add(new WxMaTemplateData("keyword4", fromName, "#fffff"));
|
235
|
244
|
|
236
|
|
- sendMessage("newCustomer", toUser, link, data);
|
237
|
|
- return;
|
|
245
|
+ if (isSubscribe) {
|
|
246
|
+ String[] data = new String[] { activityName, result };
|
|
247
|
+ ResponseBean res = sendSubscribeMessage(tpl, toUser, link, data);
|
|
248
|
+ if (res.getCode() != ResponseBean.CODE_SUCCESS) {
|
|
249
|
+ // 使用短信发送
|
|
250
|
+ sendSmsMessage(StringUtils.ifNull(toUser.getTel(), toUser.getPhone()), contentType, smsParams);
|
|
251
|
+
|
|
252
|
+ messageType = CommConstant.MESSAGE_TYPE_OF_SMS;
|
|
253
|
+ }
|
|
254
|
+ } else {
|
|
255
|
+ List<WxMaTemplateData> data = new ArrayList<>();
|
|
256
|
+ data.add(new WxMaTemplateData("keyword1", result, "#fffff"));
|
|
257
|
+ data.add(new WxMaTemplateData("keyword2", activityName, "#fffff"));
|
|
258
|
+ data.add(new WxMaTemplateData("keyword3", DateUtils.cutSecond(dt), "#fffff"));
|
|
259
|
+ sendMessage(contentType, toUser, link, data);
|
|
260
|
+ }
|
238
|
261
|
}
|
|
262
|
+
|
|
263
|
+ // TODO 写消息发送日志
|
|
264
|
+
|
|
265
|
+ // 更新消息发送时间
|
|
266
|
+ iTaPersonMessageRuleService.saveOrUpdateByPersonAndMessage(toUser.getPersonId(), messageType, contentType, toUser.getOrgId());
|
239
|
267
|
}
|
240
|
268
|
|
241
|
269
|
@Override
|
|
@@ -358,6 +386,8 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
358
|
386
|
} catch (WxErrorException e) {
|
359
|
387
|
e.printStackTrace();
|
360
|
388
|
}
|
|
389
|
+
|
|
390
|
+ // TODO 写消息发送日志
|
361
|
391
|
}
|
362
|
392
|
|
363
|
393
|
private ResponseBean sendSubscribeMessage(TaMiniappTemplate tpl, TaPerson toUser, String link, String[] data) {
|
|
@@ -388,9 +418,14 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
388
|
418
|
WxMaService wxService = wxUtils.getMiniApp(appid);
|
389
|
419
|
wxService.getMsgService().sendSubscribeMsg(message);
|
390
|
420
|
|
|
421
|
+ // TODO 写消息发送日志
|
|
422
|
+
|
391
|
423
|
return ResponseBean.success("消息发送成功");
|
392
|
424
|
} catch (WxErrorException e) {
|
393
|
425
|
e.printStackTrace();
|
|
426
|
+
|
|
427
|
+ // TODO 写消息发送日志
|
|
428
|
+
|
394
|
429
|
return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
|
395
|
430
|
}
|
396
|
431
|
}
|
|
@@ -407,10 +442,16 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
407
|
442
|
|
408
|
443
|
SysSmsSetting smsSetting = sysSmsSettingMapper.selectOne(query);
|
409
|
444
|
if (null == smsSetting) {
|
|
445
|
+
|
|
446
|
+ // TODO 写消息发送日志
|
|
447
|
+
|
410
|
448
|
return "没有设置有效的【" + type + "】短信模板";
|
411
|
449
|
}
|
412
|
450
|
|
413
|
451
|
boolean success = smsUtils.sendMessage(smsSetting.getTplCode(), tel, params);
|
|
452
|
+
|
|
453
|
+ // TODO 写消息发送日志
|
|
454
|
+
|
414
|
455
|
return success ? null : "短信发送失败";
|
415
|
456
|
}
|
416
|
457
|
|
|
@@ -420,7 +461,7 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
420
|
461
|
|
421
|
462
|
String[] fileds = fieldsStr.split("\\|");
|
422
|
463
|
|
423
|
|
- int length = fileds.length > list.length ? list.length : fileds.length;
|
|
464
|
+ int length = Math.min(fileds.length, list.length);
|
424
|
465
|
for (int i = 0; i < length; i++) {
|
425
|
466
|
data.add(new WxMaSubscribeData(fileds[i], list[i], "#fffff"));
|
426
|
467
|
}
|