Selaa lähdekoodia

新增发送短信记录

yeshijie 8 vuotta sitten
vanhempi
commit
edb6ce6d15

+ 14 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/BookingController.java

@ -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.reservation.PatientReservationService;
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.third.guahao.GuahaoXMService;
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");
                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) {
					// 发送失败
                    logger.error("短信发送失败!");
                    sms.setStatus(0);
					//throw new Exception("短信发送失败!");
				} else if (r.getInt("result") != 0) {
                    sms.setStatus(0);
                    smsDao.save(sms);
					return r.getString("description");
				} else {
					//发送成功,保存到数据库
                    sms.setStatus(1);
				}
                smsDao.save(sms);
                BusinessLogs.info(BusinessLogs.BusinessType.appointment, getUID(), p.getCode(), new JSONObject(obj));
                return write(200, "创建挂号单成功!");
            } else {