Commit 03962140 authored by qinxunjia's avatar qinxunjia

修改格式

parent 53c312a4
......@@ -291,7 +291,7 @@ public class MessageServiceImpl implements MessageService {
api = "SendNotifySMS";
}
response = bgySmsService.sendSms(mobile, content, areaId,api);
response = bgySmsService.sendSms(mobile, content, areaId, api);
//4.短信发送记录
SysRecordInfo sysRecordInfo = new SysRecordInfo();
......@@ -343,7 +343,7 @@ public class MessageServiceImpl implements MessageService {
codeInfo.setMobile(mobile);
codeInfo.setDateCreated(new Date());
dmCodeService.insert(codeInfo);
response = bgySmsService.sendSms(mobile, content, BgySMSConfig.areaId,null);
response = bgySmsService.sendSms(mobile, content, BgySMSConfig.areaId, null);
String retCode = response.getCode();
if (retCode.equals(ResponseCode.SUCCESS.getCode())) {
return new DmHubResponse(ResponseCode.SUCCESS);
......@@ -383,7 +383,7 @@ public class MessageServiceImpl implements MessageService {
return new DmHubResponse("999", "短信插件未获取到模板信息");
}
if (templateInfo.getTemplateRecordId() == null){
if (templateInfo.getTemplateRecordId() == null) {
return new DmHubResponse("1001", "当前模板暂未审核,请重新选择");
}
......@@ -479,21 +479,19 @@ public class MessageServiceImpl implements MessageService {
sysRecordInfo.setAreaId(channelAccount);
if (paramsArr == null || paramsArr.isEmpty()) {
// List<JSONObject> list = new ArrayList<>();
List<Map<String,String>> list = new ArrayList<>();
List<JSONObject> list = new ArrayList<>();
StringBuilder mobiles = new StringBuilder();
String content = templateInfo.getUpContent();
for (String mobile : mobileList) {
//JSONObject jsonObject = new JSONObject();
Map<String,String> jsonObject = new HashMap<>();
JSONObject jsonObject = new JSONObject();
mobiles.append(mobile + ",");
jsonObject.put("mobile", mobile);
jsonObject.put("content", content);
jsonObject.put("Mobile", mobile);
jsonObject.put("Content", content);
list.add(jsonObject);
}
try {
if (!list.isEmpty()) {
response = bgySmsService.sendbatchSms(list.toString(), areaId,api,templateRecordId);
response = bgySmsService.sendbatchSms(JSONObject.toJSONString(list), areaId, api, templateRecordId);
String code = response.getCode();
if (code.equals(ResponseCode.SUCCESS.getCode())) {
sysRecordInfo.setChargeNum(list.size());
......@@ -527,7 +525,7 @@ public class MessageServiceImpl implements MessageService {
// 变量短信
Set<Map.Entry<String, List<String>>> entries = paramsMap.entrySet();
// List<JSONObject> list = new ArrayList<>();
List<Map<String,String>> list = new ArrayList<>();
List<JSONObject> list = new ArrayList<>();
StringBuilder mobiles = new StringBuilder();
String content = templateInfo.getUpContent();
for (Map.Entry<String, List<String>> entry : entries) {
......@@ -535,8 +533,7 @@ public class MessageServiceImpl implements MessageService {
List<String> paramsList = entry.getValue();
String sendMsg = getMsg(templateInfo.getUpContent(), paramsList);
// JSONObject jsonObject = new JSONObject();
Map<String,String> jsonObject = new HashMap<>();
JSONObject jsonObject = new JSONObject();
mobiles.append(mobile + ",");
jsonObject.put("Mobile", mobile);
jsonObject.put("Content", sendMsg);
......@@ -544,7 +541,7 @@ public class MessageServiceImpl implements MessageService {
}
try {
response = bgySmsService.sendbatchSms(list.toString(), areaId,api,templateRecordId);
response = bgySmsService.sendbatchSms(JSONObject.toJSONString(list), areaId, api, templateRecordId);
String code = response.getCode();
if (code.equals(ResponseCode.SUCCESS.getCode())) {
sysRecordInfo.setChargeNum(list.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment