|
|
@@ -17,12 +17,12 @@ import java.util.HashMap;
|
|
|
public class Sms extends BaseClass {
|
|
|
public static void main(String[] args) {
|
|
|
Sms sms = new Sms();
|
|
|
- // sms.sendout("13732579910", "12345");
|
|
|
- System.err.println(sms.queryBalance());
|
|
|
+ sms.sendOutMsg("13732579910","123112" );
|
|
|
+ //System.err.println(sms.queryBalance());
|
|
|
}
|
|
|
|
|
|
public void sendOutMsg(String phone, String msg) {
|
|
|
- msg = "【布万家】您好,您的验证码是" + msg;
|
|
|
+ msg = "【布万家】您好,您的验证码为" + msg;
|
|
|
sendout(msg, phone);
|
|
|
}
|
|
|
|
|
|
@@ -38,6 +38,7 @@ public class Sms extends BaseClass {
|
|
|
map.put("extend", "");//自定义扩展码
|
|
|
JSONObject js = (JSONObject) JSONObject.toJSON(map);
|
|
|
String result = sendSmsByPost(sendUrl, js.toString());
|
|
|
+ System.err.println(result);
|
|
|
PaoSetRemote tsmslogSet = null;
|
|
|
try {
|
|
|
JSONObject json = JSONObject.parseObject(result);
|
|
|
@@ -46,28 +47,28 @@ public class Sms extends BaseClass {
|
|
|
String time = json.getString("time");
|
|
|
String errorMsg = json.getString("errorMsg");
|
|
|
|
|
|
- tsmslogSet = getP2ServerSystemPaoSet("tsmslog");
|
|
|
- PaoRemote pao = tsmslogSet.addAtEnd();
|
|
|
- pao.setValue("createdate", Calendar.getInstance().getTime(), 11L);
|
|
|
- pao.setValue("fmsg", msg, 11L);
|
|
|
- pao.setValue("fphonenumber", phone, 11L);
|
|
|
- pao.setValue("code", code, 11L);
|
|
|
- pao.setValue("msgid", msgid, 11L);
|
|
|
- pao.setValue("time", time, 11L);
|
|
|
- pao.setValue("errorMsg", errorMsg, 11L);
|
|
|
-
|
|
|
- tsmslogSet.save();
|
|
|
+// tsmslogSet = getP2ServerSystemPaoSet("tsmslog");
|
|
|
+// PaoRemote pao = tsmslogSet.addAtEnd();
|
|
|
+// pao.setValue("createdate", Calendar.getInstance().getTime(), 11L);
|
|
|
+// pao.setValue("fmsg", msg, 11L);
|
|
|
+// pao.setValue("fphonenumber", phone, 11L);
|
|
|
+// pao.setValue("code", code, 11L);
|
|
|
+// pao.setValue("msgid", msgid, 11L);
|
|
|
+// pao.setValue("time", time, 11L);
|
|
|
+// pao.setValue("errorMsg", errorMsg, 11L);
|
|
|
+//
|
|
|
+// tsmslogSet.save();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
try {
|
|
|
- tsmslogSet.close();
|
|
|
+ //tsmslogSet.close();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public String queryBalance() {
|
|
|
//查询余额
|
|
|
String balanceUrl = "https://smssh1.253.com/msg/balance/json";
|