Commit 03962140 authored by qinxunjia's avatar qinxunjia

修改格式

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