|
@ -8,7 +8,6 @@ import com.yihu.wlyy.repository.message.SMSDao;
|
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
import com.yihu.wlyy.service.app.consult.ConsultService;
|
|
|
import com.yihu.wlyy.service.app.reservation.PatientReservationService;
|
|
import com.yihu.wlyy.service.app.reservation.PatientReservationService;
|
|
|
import com.yihu.wlyy.service.common.SMSService;
|
|
import com.yihu.wlyy.service.common.SMSService;
|
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoXMService;
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoXMService;
|
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoYihuService;
|
|
import com.yihu.wlyy.service.third.guahao.GuahaoYihuService;
|
|
@ -381,15 +380,29 @@ public class BookingController extends WeixinBaseController {
|
|
|
//调用总部发送信息的接口
|
|
//调用总部发送信息的接口
|
|
|
String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
|
|
String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
|
|
|
JSONObject r = toJson(result);
|
|
JSONObject r = toJson(result);
|
|
|
|
|
SMS sms = new SMS();
|
|
|
|
|
sms.setContent(msg);
|
|
|
|
|
sms.setCaptcha(null);
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
sms.setDeadline(date);
|
|
|
|
|
sms.setCzrq(date);
|
|
|
|
|
sms.setMobile(patientPhone);
|
|
|
|
|
sms.setIp(NetworkUtil.getIpAddress(request));
|
|
|
|
|
sms.setType(6);
|
|
|
if (r == null) {
|
|
if (r == null) {
|
|
|
// 发送失败
|
|
// 发送失败
|
|
|
logger.error("短信发送失败!");
|
|
logger.error("短信发送失败!");
|
|
|
|
|
sms.setStatus(0);
|
|
|
//throw new Exception("短信发送失败!");
|
|
//throw new Exception("短信发送失败!");
|
|
|
} else if (r.getInt("result") != 0) {
|
|
} else if (r.getInt("result") != 0) {
|
|
|
|
|
sms.setStatus(0);
|
|
|
|
|
smsDao.save(sms);
|
|
|
return r.getString("description");
|
|
return r.getString("description");
|
|
|
} else {
|
|
} else {
|
|
|
//发送成功,保存到数据库
|
|
//发送成功,保存到数据库
|
|
|
|
|
sms.setStatus(1);
|
|
|
}
|
|
}
|
|
|
|
|
smsDao.save(sms);
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.appointment, getUID(), p.getCode(), new JSONObject(obj));
|
|
BusinessLogs.info(BusinessLogs.BusinessType.appointment, getUID(), p.getCode(), new JSONObject(obj));
|
|
|
return write(200, "创建挂号单成功!");
|
|
return write(200, "创建挂号单成功!");
|
|
|
} else {
|
|
} else {
|