Commit c2387863 authored by hezhen's avatar hezhen

123

parent 9e2bac91
...@@ -125,7 +125,7 @@ public class AliYunSmsBiz { ...@@ -125,7 +125,7 @@ public class AliYunSmsBiz {
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_D); SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_D);
break; break;
case 14 : case 14 :
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_E); SmsService.sendTemplateToJson14(phoneNumbers,params,TEMPLATE_ID_PAY_E);
break; break;
case 15 : case 15 :
SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_F); SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_F);
......
...@@ -211,6 +211,31 @@ public class SmsService { ...@@ -211,6 +211,31 @@ public class SmsService {
} }
public static void sendTemplateToJson14(String PhoneNumbers,String[] params,String templateCode){
try {
JSONObject jsonParams=new JSONObject();
for (int i=0;i<params.length;i++){
String para=params[i];
if (para.contains("【")){
para=para.replaceAll("【","");
}
if (para.contains("】")){
para=para.replaceAll("】","");
}
if (i>3){
jsonParams.put(param+(i+2),para);
}else {
jsonParams.put(param+(i+1),para);
}
}
sendTemplate(PhoneNumbers,jsonParams.toJSONString(),templateCode);
}catch (Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) throws ClientException, InterruptedException { public static void main(String[] args) throws ClientException, InterruptedException {
SmsService smsService=new SmsService(); SmsService smsService=new SmsService();
//发短信 //发短信
......
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