Преглед на файлове

Merge branch 'dev' of huangzhanpeng/wlyy_management into dev

lyr преди 8 години
родител
ревизия
410cba3cfc
променени са 1 файла, в които са добавени 47 реда и са изтрити 7 реда
  1. 47 7
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

+ 47 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -3,7 +3,6 @@ package com.yihu.wlyy.web.third;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientReservation;
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.GuahaoDoctor;
@ -57,8 +56,6 @@ public class BookingController extends WeixinBaseController {
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private SMSService smsService;
    /**
     * 根据城市编码获取相应挂号服务
     *
@ -75,7 +72,7 @@ public class BookingController extends WeixinBaseController {
    /**
     * 发送短信参数
     */
    private static List<NameValuePair> buildSmsParams(String content, String mobile) {
    private List<NameValuePair> buildSmsParams(String content, String mobile) {
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new BasicNameValuePair("SpCode", SystemConf.getInstance().getSmsCode()));
        params.add(new BasicNameValuePair("LoginName", SystemConf.getInstance().getSmsName()));
@ -88,6 +85,24 @@ public class BookingController extends WeixinBaseController {
        return params;
    }
    private JSONObject toJson(String result) {
        JSONObject json = new JSONObject();
        try {
            String[] temps = result.split("&");
            for (String temp : temps) {
                if (temp.split("=").length != 2) {
                    continue;
                }
                String key = temp.split("=")[0];
                String value = temp.split("=")[1];
                json.put(key, value);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return json;
    }
    /**
     * 获取时间
     */
@ -355,6 +370,29 @@ public class BookingController extends WeixinBaseController {
    /****************************************** 内网预约 ***************************************************************/
/*    @RequestMapping(value = "sendMessage", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("发送短信测试")
    public String sendMessage()
    {
        try {
            //发送短信消息,调用总部发送信息的接口
            String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams("测试", "13559207522"), "GBK");
            System.out.print(result);
            *//*JSONObject json = toJson(result);
            JSONObject result = smsService.sendMsg("13559207522", "测试");
            if (result != null && result.getInt("result") != 0) {
                System.out.print("短信提醒失败!(原因:" + result.getString("description") + ")");
            }*//*
            return error(-1, "创建挂号单失败!"+result);
        }
        catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }*/
    @RequestMapping(value = "CreateOrderByDoctor", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("(内网)转诊预约挂号")
@ -397,9 +435,11 @@ public class BookingController extends WeixinBaseController {
                            obj.getDeptName() + obj.getDeptName() + "医生的号源。您可直接前往医院就诊。";
                    //发送短信消息,调用总部发送信息的接口
                    JSONObject result = smsService.sendMsg(patientPhone, msg);
                    if (result != null && result.getInt("result") != 0) {
                        des = "短信提醒失败!(原因:"+result.getString("description")+")";
                    String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, patientPhone), "GBK");
                    System.out.print(result);
                    JSONObject resultJson = toJson(result);
                    if (resultJson != null && resultJson.getInt("result") != 0) {
                        des = "短信提醒失败!(原因:"+resultJson.getString("description")+")";
                    }
                    // 推送消息给微信端