|
@ -29,6 +29,8 @@ import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -48,6 +50,7 @@ import java.util.*;
|
|
|
@Api(description = "预约挂号接口")
|
|
|
public class BookingController extends WeixinBaseController {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(BookingController.class);
|
|
|
@Autowired
|
|
|
private GuahaoXMService guahaoXM;
|
|
|
|
|
@ -370,18 +373,19 @@ public class BookingController extends WeixinBaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
//发送短信小时
|
|
|
// 调用总部发送信息的接口
|
|
|
//String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
|
|
|
//JSONObject json = toJson(result);
|
|
|
// if (json == null) {
|
|
|
// // 发送失败
|
|
|
// throw new Exception("短信发送失败!");
|
|
|
// } else if (json.getInt("result") != 0) {
|
|
|
// return json.getString("description");
|
|
|
// } else {
|
|
|
// //发送成功,保存到数据库
|
|
|
// }
|
|
|
//发送短信消息
|
|
|
//调用总部发送信息的接口
|
|
|
String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
|
|
|
JSONObject r = toJson(result);
|
|
|
if (r == null) {
|
|
|
// 发送失败
|
|
|
logger.error("短信发送失败!");
|
|
|
//throw new Exception("短信发送失败!");
|
|
|
} else if (r.getInt("result") != 0) {
|
|
|
return r.getString("description");
|
|
|
} else {
|
|
|
//发送成功,保存到数据库
|
|
|
}
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.appointment, getUID(), p.getCode(), new JSONObject(obj));
|
|
|
return write(200, "创建挂号单成功!");
|
|
|
} else {
|