|
@@ -17,28 +17,30 @@ public class SmsUtils {
|
|
private static String URL = "http://112.35.1.155:1992/sms/tmpsubmit";
|
|
private static String URL = "http://112.35.1.155:1992/sms/tmpsubmit";
|
|
private static String ECNAME = "通渭县畜牧兽医服务中心";
|
|
private static String ECNAME = "通渭县畜牧兽医服务中心";
|
|
private static String APID = "admin";
|
|
private static String APID = "admin";
|
|
|
|
+ private static String SecretKey = "XuMu@123";
|
|
private static String SIGN = "SJsLKUNDR";
|
|
private static String SIGN = "SJsLKUNDR";
|
|
|
|
|
|
- public static JSONObject sendSms(String templateId,String mobiles) throws Exception{
|
|
|
|
|
|
+ public static JSONObject sendSms(String templateId,String mobiles,String[] params) throws Exception{
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //
|
|
//String mobiles = "13140429955,13140429955";
|
|
//String mobiles = "13140429955,13140429955";
|
|
// String templateId = "e683346d84234fc1a0816791587a4335";
|
|
// String templateId = "e683346d84234fc1a0816791587a4335";
|
|
|
|
+ // String[] paramss = {"632431"};
|
|
|
|
|
|
HttpHeaders httpHeaders = new HttpHeaders();
|
|
HttpHeaders httpHeaders = new HttpHeaders();
|
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
|
- String[] paramss = {"632431"};
|
|
|
|
|
|
+
|
|
|
|
|
|
SmsVo submit = new SmsVo();
|
|
SmsVo submit = new SmsVo();
|
|
submit.setApId(APID);
|
|
submit.setApId(APID);
|
|
submit.setEcName(ECNAME);
|
|
submit.setEcName(ECNAME);
|
|
- submit.setMobiles("13140429955");
|
|
|
|
|
|
+ submit.setMobiles(mobiles);
|
|
submit.setSign(SIGN);
|
|
submit.setSign(SIGN);
|
|
submit.setAddSerial("");
|
|
submit.setAddSerial("");
|
|
submit.setTemplateId(templateId);
|
|
submit.setTemplateId(templateId);
|
|
- submit.setSecretKey("XuMu@123");
|
|
|
|
- submit.setParams(JSON.toJSONString(paramss));
|
|
|
|
|
|
+ submit.setSecretKey(SecretKey);
|
|
|
|
+ submit.setParams(JSON.toJSONString(params));
|
|
|
|
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
stringBuffer.append(submit.getEcName())
|
|
stringBuffer.append(submit.getEcName())
|