SmsUtil.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. package com.ssm.util.sms;
  2. import java.io.BufferedReader;
  3. import java.io.IOException;
  4. import java.io.InputStreamReader;
  5. import java.net.HttpURLConnection;
  6. import java.net.URL;
  7. import java.util.ArrayList;
  8. import java.util.HashMap;
  9. import java.util.List;
  10. import java.util.Map;
  11. import java.util.regex.Matcher;
  12. import java.util.regex.Pattern;
  13. import com.alibaba.fastjson.JSON;
  14. import org.apache.http.HttpEntity;
  15. import org.apache.http.HttpResponse;
  16. import org.apache.http.NameValuePair;
  17. import org.apache.http.client.HttpClient;
  18. import org.apache.http.client.entity.UrlEncodedFormEntity;
  19. import org.apache.http.client.methods.HttpPost;
  20. import org.apache.http.entity.StringEntity;
  21. import org.apache.http.impl.client.DefaultHttpClient;
  22. import org.apache.http.impl.client.HttpClients;
  23. import org.apache.http.message.BasicNameValuePair;
  24. import com.ssm.util.sms.SmsConst;
  25. import org.apache.http.util.EntityUtils;
  26. public class SmsUtil {
  27. /**
  28. * get请求发送短信
  29. * @param phoen 手机号码
  30. * @param content 发送的内容
  31. * @param count 发送的手机号个数
  32. * @return msgid 编号
  33. */
  34. public static String SendSmsGet(String phoen ,String content, int count) throws Exception{
  35. String url = SmsConst.SENDSMSNEW_URL+"?" +
  36. "userId="+SmsConst.userId+"&password="+SmsConst.password+
  37. "&pszMobis="+phoen+"&pszMsg=" +content+
  38. "&iMobiCount="+count+"&pszSubPort=*";
  39. String urlutf = new String(url.getBytes("utf-8"),"ISO-8859-1");
  40. URL getUrl =new URL(urlutf);
  41. HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
  42. connection.connect();
  43. BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  44. String lines=reader.readLine();
  45. String msgid = "";
  46. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  47. Matcher ageMatcher = agePattern.matcher(lines);
  48. if(ageMatcher.find()){
  49. msgid = ageMatcher.group(1);
  50. }
  51. reader.close();
  52. connection.disconnect();
  53. return msgid;
  54. }
  55. /**
  56. * post请求发送短信
  57. * @param phoen 手机号码
  58. * @param content 发送的内容
  59. * @param count 发送的手机号个数
  60. * @return msgid 编号
  61. */
  62. public static String SendSmsPost(String phoen ,String content, int count) throws IOException {
  63. HttpClient httpclient = new DefaultHttpClient();
  64. HttpPost httppost = new HttpPost(SmsConst.SENDSMSNEW_URL);
  65. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
  66. nameValuePairs.add(new BasicNameValuePair("userId", SmsConst.userId));
  67. nameValuePairs.add(new BasicNameValuePair("password", SmsConst.password));
  68. nameValuePairs.add(new BasicNameValuePair("pszMobis", phoen));
  69. content = new String(content.getBytes("utf-8"),"ISO-8859-1");
  70. nameValuePairs.add(new BasicNameValuePair("pszMsg", content));
  71. nameValuePairs.add(new BasicNameValuePair("iMobiCount", count+""));
  72. nameValuePairs.add(new BasicNameValuePair("pszSubPort","*"));
  73. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  74. HttpResponse response = httpclient.execute(httppost);
  75. BufferedReader reader = new BufferedReader(new InputStreamReader(
  76. response.getEntity().getContent()));
  77. String lines = reader.readLine();
  78. String msgid = "";
  79. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  80. Matcher ageMatcher = agePattern.matcher(lines);
  81. if(ageMatcher.find()){
  82. msgid = ageMatcher.group(1);
  83. }
  84. reader.close();
  85. return msgid;
  86. }
  87. /**
  88. * post请求发送短信(新)
  89. *
  90. * @param phones 手机号码
  91. * @param content 发送的内容
  92. * @return res json返回值
  93. */
  94. public static String sendNewSmsPost(String phones, String content) throws IOException {
  95. HttpClient httpClient = HttpClients.createDefault();
  96. HttpPost httpPost = new HttpPost("https://api.4321.sh/sms/send");
  97. httpPost.addHeader("Content-Type", "application/json");
  98. Map<String, Object> map = new HashMap<>();
  99. map.put("apikey", "N11727b332");// api接口账号
  100. map.put("secret", "1172799e3242ebe1");// api接口秘钥
  101. map.put("sign_id", "101760");// 签名id
  102. map.put("mobile", phones);// 手机号
  103. map.put("content", content);// 短信内容
  104. String json = JSON.toJSONString(map);
  105. httpPost.setEntity(new StringEntity(json, "UTF-8"));
  106. HttpResponse response = httpClient.execute(httpPost);
  107. HttpEntity entity = response.getEntity();
  108. String res = EntityUtils.toString(entity);
  109. return res;
  110. }
  111. /**
  112. * post请求发送短信(新)
  113. *
  114. * @param phones 手机号码
  115. * @param content 发送的内容
  116. * @param templateId 模板id
  117. * @return res json返回值
  118. */
  119. public static String sendNewTemplateSmsSmsPost(String phones, String content, String templateId) throws IOException {
  120. HttpClient httpClient = HttpClients.createDefault();
  121. HttpPost httpPost = new HttpPost("https://api.4321.sh/sms/template");
  122. httpPost.addHeader("Content-Type", "application/json");
  123. Map<String, Object> map = new HashMap<>();
  124. map.put("apikey", "N11727b332");// api接口账号
  125. map.put("secret", "1172799e3242ebe1");// api接口秘钥
  126. map.put("sign_id", 101760);// 签名id
  127. map.put("template_id", templateId);// 模板id
  128. map.put("mobile", phones);// 手机号
  129. map.put("content", content);// 短信内容
  130. String json = JSON.toJSONString(map);
  131. httpPost.setEntity(new StringEntity(json, "UTF-8"));
  132. HttpResponse response = httpClient.execute(httpPost);
  133. HttpEntity entity = response.getEntity();
  134. String res = EntityUtils.toString(entity);
  135. return res;
  136. }
  137. /**
  138. * get请求发送的状态(根据发送信息时返回成功的编号查询)
  139. * @param msgid 编号
  140. * @return
  141. * 返回值:
  142. Null:短信还在发送队列中或短信被下级网关拒绝
  143. 接收状态报告内容返回格式(一次返回一条): 时间,流水号,通道号,手机号,*,*,状态值,详细错误原因
  144. 例:2008-01-23 15:43:34,4143567542310872314,10657999,13265661403,*,*,0,DELIVRD
  145. 状态值:
  146. 0 发送成功,并接收到成功的状态报告
  147. 1 已提交运营商,正在等待运营商状态报告
  148. 2 发送失败,并接收到失败的状态报告
  149. * 注:格式中*是备用字段
  150. */
  151. public static String StatusReportGet(String msgid) throws Exception{
  152. String url = SmsConst.STATUSREPORT_URL+ "?" +
  153. "userId="+SmsConst.userId+"&password="+SmsConst.password+
  154. "&msgid="+msgid;
  155. URL getUrl =new URL(url);
  156. HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
  157. connection.connect();
  158. BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  159. StringBuffer strBuf = new StringBuffer();
  160. String line = null;
  161. while ((line = reader.readLine()) != null) {
  162. strBuf.append(line).append("\n");
  163. }
  164. reader.close();
  165. connection.disconnect();
  166. return strBuf.toString();
  167. }
  168. /**
  169. * post请求发送的状态(根据发送信息时返回成功的编号查询)
  170. * @param msgid 编号
  171. * @return
  172. * 返回值:
  173. Null:短信还在发送队列中或短信被下级网关拒绝
  174. 接收状态报告内容返回格式(一次返回一条): 时间,流水号,通道号,手机号,*,*,状态值,详细错误原因
  175. 例:2008-01-23 15:43:34,4143567542310872314,10657999,13265661403,*,*,0,DELIVRD
  176. 状态值:
  177. 0 发送成功,并接收到成功的状态报告
  178. 1 已提交运营商,正在等待运营商状态报告
  179. 2 发送失败,并接收到失败的状态报告
  180. * 注:格式中*是备用字段
  181. */
  182. public static String StatusReportPost(String msgid) throws IOException {
  183. HttpClient httpclient = new DefaultHttpClient();
  184. HttpPost httppost = new HttpPost(SmsConst.STATUSREPORT_URL);
  185. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
  186. nameValuePairs.add(new BasicNameValuePair("userId", SmsConst.userId));
  187. nameValuePairs.add(new BasicNameValuePair("password", SmsConst.password));
  188. nameValuePairs.add(new BasicNameValuePair("msgid", msgid));
  189. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  190. HttpResponse response = httpclient.execute(httppost);
  191. //读取返回值
  192. StringBuffer strBuf = new StringBuffer();
  193. BufferedReader reader = new BufferedReader(new InputStreamReader(
  194. response.getEntity().getContent()));
  195. String line = null;
  196. while ((line = reader.readLine()) != null) {
  197. strBuf.append(line).append("\n");
  198. }
  199. reader.close();
  200. return strBuf.toString();
  201. }
  202. /**
  203. * get获取发送信息的状态报告接口
  204. * return
  205. * 返回值(list集合):
  206. * 1.null 无状态报告
  207. * 2.接收状态报告内容列表(最高维数为500),返回格式:日期,时间,信息编号,*,状态值,详细错误原因
  208. * 例:2008-01-23,15:43:34,0518153837115735,*,123456,234567,0,DELIVRD
  209. * 注:格式中*是备用字段
  210. */
  211. public static List<String> MongateCsGetStatusReportExExGet() throws Exception{
  212. String url = SmsConst.STATUSREPORTEXEX_URL+"?" +
  213. "userId="+SmsConst.userId+"&password="+SmsConst.password;
  214. URL getUrl =new URL(url);
  215. HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
  216. connection.connect();
  217. BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  218. StringBuffer strBuf = new StringBuffer();
  219. String line = null;
  220. while ((line = reader.readLine()) != null) {
  221. strBuf.append(line).append("\n");
  222. }
  223. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  224. Matcher ageMatcher = agePattern.matcher(strBuf);
  225. List<String> list = new ArrayList<String>();
  226. while (ageMatcher.find()) {
  227. list.add(ageMatcher.group(1));
  228. }
  229. reader.close();
  230. connection.disconnect();
  231. return list;
  232. }
  233. /**
  234. * post获取发送信息的状态报告接口
  235. * return
  236. * 返回值(list集合):
  237. * 1.null 无状态报告
  238. * 2.接收状态报告内容列表(最高维数为500),返回格式:日期,时间,信息编号,*,状态值,详细错误原因
  239. * 例:2008-01-23,15:43:34,0518153837115735,*,123456,234567,0,DELIVRD
  240. * 注:格式中*是备用字段
  241. */
  242. public static List<String> MongateCsGetStatusReportExExPost() throws Exception{
  243. HttpClient httpclient = new DefaultHttpClient();
  244. HttpPost httppost = new HttpPost(SmsConst.STATUSREPORTEXEX_URL);
  245. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
  246. nameValuePairs.add(new BasicNameValuePair("userId", SmsConst.userId));
  247. nameValuePairs.add(new BasicNameValuePair("password", SmsConst.password));
  248. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  249. HttpResponse response = httpclient.execute(httppost);
  250. BufferedReader reader = new BufferedReader(new InputStreamReader(
  251. response.getEntity().getContent()));
  252. StringBuffer strBuf = new StringBuffer();
  253. String line = null;
  254. while ((line = reader.readLine()) != null) {
  255. strBuf.append(line).append("\n");
  256. }
  257. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  258. Matcher ageMatcher = agePattern.matcher(strBuf);
  259. List<String> list = new ArrayList<String>();
  260. while (ageMatcher.find()) {
  261. list.add(ageMatcher.group(1));
  262. }
  263. reader.close();
  264. return list;
  265. }
  266. /**
  267. * get获取上行/状态报告等
  268. * @param type 请求类型 (0:上行&状态报告 1:上行 2:状态报告)
  269. * @return
  270. * 返回值:
  271. null 无信息
  272. 接收信息内容列表(最高维数为500)格式说明:
  273. 信息类型(上行标志1),日期,时间,上行源号码,上行目标通道号,上行扩展子号,*,上行信息内容
  274. 信息类型(状态报告标志2),日期,时间,信息编号,通道号,手机号, 发送短信时所填的MsgId, 发送短信时时所填的ModuleId,状态值,详细错误原因
  275. */
  276. public static List<String> MongateGetDeliverGet(int type) throws Exception{
  277. String url = SmsConst.DELIVER_URL+"?" +
  278. "userId="+SmsConst.userId+"&password="+SmsConst.password+
  279. "&iReqType="+type;
  280. URL getUrl =new URL(url);
  281. HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
  282. connection.connect();
  283. BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream()));
  284. StringBuffer strBuf = new StringBuffer();
  285. String line = null;
  286. while ((line = reader.readLine()) != null) {
  287. strBuf.append(line).append("\n");
  288. }
  289. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  290. Matcher ageMatcher = agePattern.matcher(strBuf);
  291. List<String> list = new ArrayList<String>();
  292. while (ageMatcher.find()) {
  293. list.add(ageMatcher.group(1));
  294. }
  295. reader.close();
  296. connection.disconnect();
  297. return list;
  298. }
  299. /**
  300. * post获取上行/状态报告等
  301. * @param type 请求类型 (0:上行&状态报告 1:上行 2:状态报告)
  302. * @return
  303. * 返回值:
  304. null 无信息
  305. 接收信息内容列表(最高维数为500)格式说明:
  306. 信息类型(上行标志1),日期,时间,上行源号码,上行目标通道号,上行扩展子号,*,上行信息内容
  307. 信息类型(状态报告标志2),日期,时间,信息编号,通道号,手机号, 发送短信时所填的MsgId, 发送短信时时所填的ModuleId,状态值,详细错误原因
  308. */
  309. public static List<String> MongateGetDeliverPost(int type) throws Exception{
  310. HttpClient httpclient = new DefaultHttpClient();
  311. HttpPost httppost = new HttpPost(SmsConst.DELIVER_URL);
  312. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
  313. nameValuePairs.add(new BasicNameValuePair("userId", SmsConst.userId));
  314. nameValuePairs.add(new BasicNameValuePair("password", SmsConst.password));
  315. nameValuePairs.add(new BasicNameValuePair("iReqType", type + ""));
  316. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  317. HttpResponse response = httpclient.execute(httppost);
  318. BufferedReader reader = new BufferedReader(new InputStreamReader(
  319. response.getEntity().getContent()));
  320. StringBuffer strBuf = new StringBuffer();
  321. String line = null;
  322. while ((line = reader.readLine()) != null) {
  323. strBuf.append(line).append("\n");
  324. }
  325. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  326. Matcher ageMatcher = agePattern.matcher(strBuf);
  327. List<String> list = new ArrayList<String>();
  328. while (ageMatcher.find()) {
  329. list.add(ageMatcher.group(1));
  330. }
  331. reader.close();
  332. return list;
  333. }
  334. /**
  335. * post 接收上行信息接口
  336. * return
  337. * 返回值:
  338. null 无上行信息
  339. 接收信息内容列表(最高维数为500)格式说明: 日期,时间,上行源号码,上行目标通道号,上行扩展子号,信息内容
  340. 例如:2008-01-23,15:43:34,15986756631,10657302056780408,408,信息内容
  341. */
  342. public static List<String> MongateCsGetSmsExExPost() throws Exception{
  343. HttpClient httpclient = new DefaultHttpClient();
  344. HttpPost httppost = new HttpPost(SmsConst.SMSEXEX_URL);
  345. List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
  346. nameValuePairs.add(new BasicNameValuePair("userId", SmsConst.userId));
  347. nameValuePairs.add(new BasicNameValuePair("password", SmsConst.password));
  348. httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  349. HttpResponse response = httpclient.execute(httppost);
  350. BufferedReader reader = new BufferedReader(new InputStreamReader(
  351. response.getEntity().getContent(),"utf-8"));
  352. StringBuffer strBuf = new StringBuffer();
  353. String line = null;
  354. while ((line = reader.readLine()) != null) {
  355. strBuf.append(line).append("\n");
  356. }
  357. Pattern agePattern = Pattern.compile("<\\s*string\\s*[^>]*?\\s*>(.*?)<\\s*/\\s*string\\s*>");
  358. Matcher ageMatcher = agePattern.matcher(strBuf);
  359. List<String> list = new ArrayList<String>();
  360. while (ageMatcher.find()) {
  361. list.add(ageMatcher.group(1));
  362. }
  363. reader.close();
  364. return list;
  365. }
  366. /**
  367. * @param 错误返回值
  368. * @return
  369. */
  370. public static Map<String,Object> verifyValue(String msgid){
  371. Map<String, Object> map = new HashMap<String, Object>();
  372. if(msgid.equals("-1")){
  373. map.put("status", SmsConst.FAILURE);
  374. map.put("message","参数为空。信息、电话号码等有空指针、登陆失败。");
  375. }else if(msgid.equals("-11")){
  376. map.put("status", SmsConst.FAILURE);
  377. map.put("message","电话号码中有非数字字符");
  378. }else if(msgid.equals("-12")){
  379. map.put("status", SmsConst.FAILURE);
  380. map.put("message","有异常电话号码");
  381. }else if(msgid.equals("-101")){
  382. map.put("status", SmsConst.FAILURE);
  383. map.put("message","发送消息等待超时");
  384. }else if(msgid.equals("-102")){
  385. map.put("status", SmsConst.FAILURE);
  386. map.put("message","发送或接收消息失败");
  387. }else if(msgid.equals("-103")){
  388. map.put("status", SmsConst.FAILURE);
  389. map.put("message","接收消息超时");
  390. }else if(msgid.equals("-200")){
  391. map.put("status", SmsConst.FAILURE);
  392. map.put("message","其他错误");
  393. }else if(msgid.equals("-999")){
  394. map.put("status", SmsConst.FAILURE);
  395. map.put("message","服务器内部错误");
  396. }else if(msgid.equals("-10001")){
  397. map.put("status", SmsConst.FAILURE);
  398. map.put("message","用户登陆不成功(帐号密码错误)");
  399. }else if(msgid.equals("-10002")){
  400. map.put("status", SmsConst.FAILURE);
  401. map.put("message","提交格式不正确");
  402. }else if(msgid.equals("-10003")){
  403. map.put("status", SmsConst.FAILURE);
  404. map.put("message","用户余额不足");
  405. }else if(msgid.equals("-10004")){
  406. map.put("status", SmsConst.FAILURE);
  407. map.put("message","手机号码不正确");
  408. }else if(msgid.equals("-10005")){
  409. map.put("status", SmsConst.FAILURE);
  410. map.put("message","计费用户帐号错误");
  411. }else if(msgid.equals("-10006")){
  412. map.put("status", SmsConst.FAILURE);
  413. map.put("message","计费用户密码错");
  414. }else if(msgid.equals("-10007")){
  415. map.put("status", SmsConst.FAILURE);
  416. map.put("message","账号已经被停用");
  417. }else if(msgid.equals("-10008")){
  418. map.put("status", SmsConst.FAILURE);
  419. map.put("message","账号类型不支持该功能");
  420. }else if(msgid.equals("-10009")){
  421. map.put("status", SmsConst.FAILURE);
  422. map.put("message","其它错误");
  423. }else if(msgid.equals("-10010")){
  424. map.put("status", SmsConst.FAILURE);
  425. map.put("message","企业代码不正确");
  426. }else if(msgid.equals("-10011")){
  427. map.put("status", SmsConst.FAILURE);
  428. map.put("message","信息内容超长");
  429. }else if(msgid.equals("-10012")){
  430. map.put("status", SmsConst.FAILURE);
  431. map.put("message","不能发送联通号码");
  432. }else if(msgid.equals("-10013")){
  433. map.put("status", SmsConst.FAILURE);
  434. map.put("message","操作员权限不够");
  435. }else if(msgid.equals("-10014")){
  436. map.put("status", SmsConst.FAILURE);
  437. map.put("message","费率代码不正确");
  438. }else if(msgid.equals("-10015")){
  439. map.put("status", SmsConst.FAILURE);
  440. map.put("message","服务器繁忙");
  441. }else if(msgid.equals("-10016")){
  442. map.put("status", SmsConst.FAILURE);
  443. map.put("message","企业权限不够");
  444. }else if(msgid.equals("-10017")){
  445. map.put("status", SmsConst.FAILURE);
  446. map.put("message","此时间段不允许发送");
  447. }else if(msgid.equals("-10018")){
  448. map.put("status", SmsConst.FAILURE);
  449. map.put("message","经销商用户名或密码错");
  450. }else if(msgid.equals("-10019")){
  451. map.put("status", SmsConst.FAILURE);
  452. map.put("message","手机列表或规则错误");
  453. }else if(msgid.equals("-10021")){
  454. map.put("status", SmsConst.FAILURE);
  455. map.put("message","没有开停户权限");
  456. }else if(msgid.equals("-10022")){
  457. map.put("status", SmsConst.FAILURE);
  458. map.put("message","没有转换用户类型的权限");
  459. }else if(msgid.equals("-10023")){
  460. map.put("status", SmsConst.FAILURE);
  461. map.put("message","没有修改用户所属经销商的权限");
  462. }else if(msgid.equals("-10024")){
  463. map.put("status", SmsConst.FAILURE);
  464. map.put("message","经销商用户名或密码错");
  465. }else if(msgid.equals("-10025")){
  466. map.put("status", SmsConst.FAILURE);
  467. map.put("message","操作员登陆名或密码错误");
  468. }else if(msgid.equals("-10026")){
  469. map.put("status", SmsConst.FAILURE);
  470. map.put("message","操作员所充值的用户不存在");
  471. }else if(msgid.equals("-10027")){
  472. map.put("status", SmsConst.FAILURE);
  473. map.put("message","操作员没有充值商务版的权限");
  474. }else if(msgid.equals("-10028")){
  475. map.put("status", SmsConst.FAILURE);
  476. map.put("message","该用户没有转正不能充值");
  477. }else if(msgid.equals("-10029")){
  478. map.put("status", SmsConst.FAILURE);
  479. map.put("message","此用户没有权限从此通道发送信息");
  480. }else if(msgid.equals("-10030")){
  481. map.put("status", SmsConst.FAILURE);
  482. map.put("message","不能发送移动号码");
  483. }else if(msgid.equals("-10031")){
  484. map.put("status", SmsConst.FAILURE);
  485. map.put("message","手机号码(字段)非法");
  486. }else if(msgid.equals("-10032")){
  487. map.put("status", SmsConst.FAILURE);
  488. map.put("message","用户使用的费率代码错误");
  489. }else if(msgid.equals("-10033")){
  490. map.put("status", SmsConst.FAILURE);
  491. map.put("message","非法关键词");
  492. }else if(msgid.equals("-10057")){
  493. map.put("status", SmsConst.FAILURE);
  494. map.put("message","非法IP地址");//还有一些暂时不列举出来
  495. }else{
  496. map.put("status", SmsConst.SUCCESS);
  497. map.put("message",msgid);
  498. }
  499. return map;
  500. }
  501. }