Browse Source

代码修改

LAPTOP-KB9HII50\70708 2 years ago
parent
commit
3e81c6a3f4

+ 187 - 0
business/base-service/src/main/java/com/yihu/jw/message/service/WxMessageUtil.java

@ -1,13 +1,19 @@
package com.yihu.jw.message.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxPushLogDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.jw.entity.healthUpload.BaseDoctorHealthUploadDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxPushLogDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
@ -16,6 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -40,6 +47,186 @@ public class WxMessageUtil {
    private WeixinMessagePushUtils weixinMessagePushUtils;
    @Value("${wechat.id}")
    private String wechatId;
    @Resource
    private BasePatientWechatDao basePatientWechatDao;
    @Resource
    private BaseOrgDao orgDao;
    /**
     * 批量异步发送微信模板消息
     */
    @Async
    public void sengdWxTemplates(List<RecruitStudentsRecordDO> list){
        String orgMobile = "";
        String orgId = "";
        for (RecruitStudentsRecordDO recordDO:list){
            if("".equals(orgId)){
                BaseOrgDO orgDO = orgDao.findByCode(recordDO.getOrgCode());
                orgMobile = orgDO.getMobile();
                orgId = orgDO.getId();
            }
            /**
             * 学生被录取的时候推送一个录取成功通知微信模板消息
             dc--ecFzT5vrnUFTNdVB6Sg4wXBnv14IX5sFP3jCFfk
             您好,恭喜您已被【机构名】成功录取
             姓名:【报名人姓名】
             手机号:【报名人手机号】
             请及时前往托育机构完成报名,如有疑问请联系招生热线【机构联系方式】
             (点击进入对应报名的机构详情页)
             */
            String first = "您好,恭喜您已被"+recordDO.getOrgName()+"成功录取";
            String remark = "请及时前往托育机构完成报名,如有疑问请联系招生热线"+orgMobile;
            JSONObject json = new JSONObject();
            json.put("orgId",orgId);
            List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,recordDO.getPatient());
            if(basePatientWechatDos.size()>0){
                String openId = basePatientWechatDos.get(0).getOpenid();
                putTemplateWxMessage(wechatId,"template_success_notice","cgrxtz",openId,first,null,remark,2,json,
                        recordDO.getPatientName(),recordDO.getMobile());
            }
        }
    }
    /**
     *
     * @param wechatId
     * @param templateName
     * @param scene
     * @param openId
     * @param first
     * @param url 跳转链接
     * @param remark
     * @param type  模板通知类型
     * @param json 用于对跳转连接的修改,
     * @param keywords
     */
    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first
            ,String url, String remark, Integer type,JSONObject json,String ...keywords) {
        try {
            System.out.println(wechatId);
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            if (wxAccessTokenDO == null) {
                logger.info("wx_access_token表获取为空,wechatId" + wechatId);
                return;
            }
            WxTemplateConfigDO templateConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1);
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            BeanUtils.copyProperties(templateConfig,newConfig);
            if (newConfig == null) {
                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene);
                return;
            }
            logger.info("微信模板推送前");
            if (StringUtils.isNoneBlank(first)){
                newConfig.setFirst(first);
            }
            if (StringUtils.isNoneBlank(url)){
                newConfig.setUrl(url);
            }
            if (StringUtils.isNoneBlank(remark)){
                newConfig.setRemark(remark);
            }
            newConfig = setTemPlateUrl(newConfig,type,openId,json);
            int keyLength = keywords.length;
            if (keyLength >= 1) {
                if(StringUtils.isNoneBlank(keywords[0])){
                    newConfig.setKeyword1(keywords[0]);
                }
            }
            if (keyLength >= 2) {
                if(StringUtils.isNoneBlank(keywords[1])){
                    newConfig.setKeyword2(keywords[1]);
                }
            }
            if (keyLength >= 3) {
                if(StringUtils.isNoneBlank(keywords[2])){
                    newConfig.setKeyword3(keywords[2]);
                }
            }
            if (keyLength >= 4) {
                if(StringUtils.isNoneBlank(keywords[3])){
                    newConfig.setKeyword4(keywords[3]);
                }
            }
            if (keyLength >= 5) {
                if(StringUtils.isNoneBlank(keywords[4])){
                    newConfig.setKeyword5(keywords[4]);
                }
            }
            if (keyLength >= 6) {
                if(StringUtils.isNoneBlank(keywords[5])){
                    newConfig.setKeyword6(keywords[5]);
                }
            }
            if (keyLength >= 7) {
                if(StringUtils.isNoneBlank(keywords[6])){
                    newConfig.setKeyword7(keywords[6]);
                }
            }
            //发起微信消息模板推送
            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), openId, newConfig);
            logger.info("微信模板消息推送后");
        } catch (Exception e) {
            logger.info("微信模板推送异常");
            e.printStackTrace();
        }
    }
    public WxTemplateConfigDO setTemPlateUrl(WxTemplateConfigDO wxTemplateConfigDO,Integer type,String openid,JSONObject json){
        String url =  "/";
        if (json==null){
            return wxTemplateConfigDO;
        }
        switch (type){
            case 1:
                //咨询回复
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?sessionId=" + json.getString("sessionId")
                        +"&type="+json.getString("consultType"));
                break;
            case 2:
                //入学成功通知
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?id=" + json.getString("orgId")
                        +"&openid="+openid);
                break;
            case 19:
                String urlStr= wxTemplateConfigDO.getUrl();
                boolean status = urlStr.contains("openid=");
                if(!status){
                    urlStr=json.getString("url")+"?openid=" + openid;
                }
                wxTemplateConfigDO.setUrl(url + urlStr );
                break;
            case 30:
                //反馈通知 测试 TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
                if(json.containsKey("consult")) {
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&consult=" + json.getString("consult"));
                }else if (json.containsKey("id")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&id=" + json.getString("id"));
                }else if(json.containsKey("relationCode")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid );
                }else if(json.containsKey("resultCode")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?resultCode=" + json.getString("resultCode"));
                }
                break;
            case 31:
                //上门服务医生评分
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&id=" + json.getString("id")+ "&finish=" + json.getString("finish"));
                break;
            case 32:
                String url1 = "wx/common/";
                wxTemplateConfigDO.setUrl(url1 + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&consult=" + json.getString("consult") + "&status=" + json.getInteger("status"));
                break;
            case 34:
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&orderId=" + json.getString("orderId")+ "&authorizeImage=" + json.getString("authorizeImage"));
                break;
            case 35:
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+json.getString("orderId")+"&isMask=1");
                break;
        }
        return wxTemplateConfigDO;
    }
    /**
     * 发送健康上报微信模板

+ 2 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/processGuidance/BaseProcessGuidanceEndpoint.java

@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
@ -32,7 +33,7 @@ import java.util.List;
@Api(value = "全流程指引", tags = {"全流程指引"})
public class BaseProcessGuidanceEndpoint extends EnvelopRestEndpoint {
    @Resource
    @Autowired
    private BaseProcessGuidanceService processGuidanceService;
    @Resource
    private BaseProcessGuidanceDao processGuidanceDao;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsRecordService.java

@ -4,10 +4,10 @@ import com.yihu.jw.base.dao.course.PatientOrderRefundDao;
import com.yihu.jw.base.dao.course.RecruitStudentsDao;
import com.yihu.jw.base.dao.course.RecruitStudentsRecordDao;
import com.yihu.jw.base.util.EntranceUtil;
import com.yihu.jw.base.util.WxMessageUtil;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.jw.message.service.WxMessageUtil;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;

+ 0 - 244
svr/svr-base/src/main/java/com/yihu/jw/base/util/WxMessageUtil.java

@ -1,244 +0,0 @@
package com.yihu.jw.base.util;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.List;
/**
 * Created by liub on 2020/12/28.
 */
@Component
public class WxMessageUtil {
    private static Logger logger = LoggerFactory.getLogger(MessageUtil.class);
    @Autowired
    private WxAccessTokenService wxAccessTokenService;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private WeixinMessagePushUtils weixinMessagePushUtils;
    @Autowired
    private WxTemplateConfigDao wxTemplateConfigDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @Autowired
    private WxAccessTokenDao wxAccessTokenDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BasePatientDao basePatientDao;
    @Value("${wechat.id}")
    private String wechatId;
    @Value("${wechat.url}")
    private String serviceUrl;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private BaseOrgDao orgDao;
    /**
     * 批量异步发送微信模板消息
     */
    @Async
    public void sengdWxTemplates(List<RecruitStudentsRecordDO> list){
        String orgMobile = "";
        String orgId = "";
        for (RecruitStudentsRecordDO recordDO:list){
            if("".equals(orgId)){
                BaseOrgDO orgDO = orgDao.findByCode(recordDO.getOrgCode());
                orgMobile = orgDO.getMobile();
                orgId = orgDO.getId();
            }
            /**
             * 学生被录取的时候推送一个录取成功通知微信模板消息
             dc--ecFzT5vrnUFTNdVB6Sg4wXBnv14IX5sFP3jCFfk
             您好,恭喜您已被【机构名】成功录取
             姓名:【报名人姓名】
             手机号:【报名人手机号】
             请及时前往托育机构完成报名,如有疑问请联系招生热线【机构联系方式】
             (点击进入对应报名的机构详情页)
             */
            String first = "您好,恭喜您已被"+recordDO.getOrgName()+"成功录取";
            String remark = "请及时前往托育机构完成报名,如有疑问请联系招生热线"+orgMobile;
            JSONObject json = new JSONObject();
            json.put("orgId",orgId);
            List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,recordDO.getPatient());
            if(basePatientWechatDos.size()>0){
                String openId = basePatientWechatDos.get(0).getOpenid();
                putTemplateWxMessage(wechatId,"template_success_notice","cgrxtz",openId,first,null,remark,2,json,
                        recordDO.getPatientName(),recordDO.getMobile());
            }
        }
    }
    /**
     *
     * @param wechatId
     * @param templateName
     * @param scene
     * @param openId
     * @param first
     * @param url 跳转链接
     * @param remark
     * @param type  模板通知类型
     * @param json 用于对跳转连接的修改,
     * @param keywords
     */
    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first
            ,String url, String remark, Integer type,JSONObject json,String ...keywords) {
        try {
            System.out.println(wechatId);
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            if (wxAccessTokenDO == null) {
                logger.info("wx_access_token表获取为空,wechatId" + wechatId);
                return;
            }
            WxTemplateConfigDO templateConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1);
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            BeanUtils.copyProperties(templateConfig,newConfig);
            if (newConfig == null) {
                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene);
                return;
            }
            logger.info("微信模板推送前");
            if (StringUtils.isNoneBlank(first)){
                newConfig.setFirst(first);
            }
            if (StringUtils.isNoneBlank(url)){
               newConfig.setUrl(url);
            }
            if (StringUtils.isNoneBlank(remark)){
                newConfig.setRemark(remark);
            }
            newConfig = setTemPlateUrl(newConfig,type,openId,json);
            int keyLength = keywords.length;
            if (keyLength >= 1) {
               if(StringUtils.isNoneBlank(keywords[0])){
                   newConfig.setKeyword1(keywords[0]);
                }
            }
            if (keyLength >= 2) {
                if(StringUtils.isNoneBlank(keywords[1])){
                    newConfig.setKeyword2(keywords[1]);
                }
            }
            if (keyLength >= 3) {
                if(StringUtils.isNoneBlank(keywords[2])){
                    newConfig.setKeyword3(keywords[2]);
                }
            }
            if (keyLength >= 4) {
                if(StringUtils.isNoneBlank(keywords[3])){
                    newConfig.setKeyword4(keywords[3]);
                }
            }
            if (keyLength >= 5) {
                if(StringUtils.isNoneBlank(keywords[4])){
                    newConfig.setKeyword5(keywords[4]);
                }
            }
            if (keyLength >= 6) {
                if(StringUtils.isNoneBlank(keywords[5])){
                    newConfig.setKeyword6(keywords[5]);
                }
            }
            if (keyLength >= 7) {
                if(StringUtils.isNoneBlank(keywords[6])){
                    newConfig.setKeyword7(keywords[6]);
                }
            }
            //发起微信消息模板推送
            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), openId, newConfig);
            logger.info("微信模板消息推送后");
        } catch (Exception e) {
            logger.info("微信模板推送异常");
            e.printStackTrace();
        }
    }
    public WxTemplateConfigDO setTemPlateUrl(WxTemplateConfigDO wxTemplateConfigDO,Integer type,String openid,JSONObject json){
        String url =  "/";
        if (json==null){
            return wxTemplateConfigDO;
        }
        switch (type){
            case 1:
                //咨询回复
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?sessionId=" + json.getString("sessionId")
                        +"&type="+json.getString("consultType"));
                break;
            case 2:
                //入学成功通知
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?id=" + json.getString("orgId")
                        +"&openid="+openid);
                break;
            case 19:
                String urlStr= wxTemplateConfigDO.getUrl();
                boolean status = urlStr.contains("openid=");
                if(!status){
                    urlStr=json.getString("url")+"?openid=" + openid;
                }
                wxTemplateConfigDO.setUrl(url + urlStr );
                break;
            case 30:
                //反馈通知 测试 TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
                if(json.containsKey("consult")) {
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&consult=" + json.getString("consult"));
                }else if (json.containsKey("id")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&id=" + json.getString("id"));
                }else if(json.containsKey("relationCode")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid );
                }else if(json.containsKey("resultCode")){
                    wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?resultCode=" + json.getString("resultCode"));
                }
                break;
            case 31:
                //上门服务医生评分
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&id=" + json.getString("id")+ "&finish=" + json.getString("finish"));
                break;
            case 32:
                String url1 = "wx/common/";
                wxTemplateConfigDO.setUrl(url1 + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&consult=" + json.getString("consult") + "&status=" + json.getInteger("status"));
                break;
            case 34:
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&orderId=" + json.getString("orderId")+ "&authorizeImage=" + json.getString("authorizeImage"));
                break;
            case 35:
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+json.getString("orderId")+"&isMask=1");
                break;
        }
        return wxTemplateConfigDO;
    }
}

+ 6 - 13
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/booking/PatientBookingEndpoint.java

@ -12,7 +12,6 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.entity.ServiceException;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.service.WechatUtilService;
import io.swagger.annotations.Api;
@ -55,8 +54,6 @@ public class PatientBookingEndpoint extends EnvelopRestEndpoint {
    private WechatUtilService wechatUtilService;
    @Resource
    private JwSmjkEntranceService jwSmjkService;
    @Autowired
    private HttpClientUtil HttpClientUtil;
//    @Autowired
//    private SMSDao smsDao;
    @Autowired
@ -170,11 +167,11 @@ public class PatientBookingEndpoint extends EnvelopRestEndpoint {
    public String getRegDeptSpeDoctorList(
            @ApiParam(name="hospitalId",value="医院编码") @RequestParam(name="hospitalId",required = false) String hospitalId,
            @ApiParam(name="hosDeptId",value="科室编码",defaultValue = "1040610") @RequestParam(name="hosDeptId",required = true) String hosDeptId,
            @ApiParam(name = "filter", value = "过滤条件", defaultValue = "")
            @ApiParam(name = "filter", value = "过滤条件")
            @RequestParam(value = "filter", required = false) String filter,
            @ApiParam(name = "page", value = "第几页", defaultValue = "")
            @ApiParam(name = "page", value = "第几页")
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
            @ApiParam(name = "size", value = "每页记录数")
            @RequestParam(value = "size", required = false) Integer size){
        try {
@ -189,10 +186,8 @@ public class PatientBookingEndpoint extends EnvelopRestEndpoint {
    @RequestMapping(value = "GetDoctorArrangeSimple", method = RequestMethod.POST)
    @ApiOperation("获取医生排班接口(一级)")
    public Envelop GetDoctorArrangeSimple(@ApiParam(name = "city", value = "城市编码", defaultValue = "350200")
                                         @RequestParam(value = "city", required = false) String city,
                                         @ApiParam(name = "hospitalId", value = "医院ID", defaultValue = "350211A1001")
                                         @RequestParam(value = "hospitalId", required = true) String hospitalId,
    public Envelop GetDoctorArrangeSimple(@ApiParam(name = "hospitalId", value = "医院ID", defaultValue = "350211A1001")
                                         @RequestParam(value = "hospitalId", required = false) String hospitalId,
                                         @ApiParam(name = "hosDeptId", value = "科室ID", defaultValue = "1010210")
                                         @RequestParam(value = "hosDeptId", required = true) String hosDeptId,
                                         @ApiParam(name = "doctorId", value = "医生ID", defaultValue = "03101")
@ -271,9 +266,7 @@ public class PatientBookingEndpoint extends EnvelopRestEndpoint {
                              @ApiParam(name = "key", value = "验证码key")
                              @RequestParam(value = "key", required = true) String key,
                              @ApiParam(name = "text", value = "text")
                              @RequestParam(value = "text", required = true) String text
    ) {
                              @RequestParam(value = "text", required = true) String text) {
        try{
            boolean pass = false;
            key = key.replaceFirst(":",":"+patient+"_");