瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatMenuController.java
wangzhinan 4 年之前
父節點
當前提交
03a0ecd2f2

+ 15 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -151,6 +151,14 @@ public class XzzxEntranceService{
        return url;
    }
    public String getOperateSmsUrl(){
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("xzzxWebOperateSmsService");
        String url = list.get(0).getDictCode();
        return url;
    }
    public String getWXTokenUrl(){
        WlyyHospitalSysDictDO sysDictDO = wlyyHospitalSysDictDao.findById("getXzToken");
        return sysDictDO.getDictCode();
@ -661,6 +669,7 @@ public class XzzxEntranceService{
    }
    /**
     *
     *  发送短信验证码
@ -676,11 +685,12 @@ public class XzzxEntranceService{
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+"bvvsf3JA0mUXMU+mVnMaOQ=="+"</certificate> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (!StringUtils.isEmpty(json)){
            condition = "<content>"+json+"</content>";
            JSONObject object = JSONObject.parseObject(json);
            condition = "<content>"+object+"</content>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
@ -692,7 +702,7 @@ public class XzzxEntranceService{
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("SendSms params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,"http://192.168.102.195:1906/services/WSInterface?wsdl");
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateSmsUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String jsonObject = xmlSerializer.read(xml).toString();
@ -700,8 +710,8 @@ public class XzzxEntranceService{
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("短信验证码发送");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("SendSms json:"+json);
        return json;
        logger.info("SendSms json:"+jsonObject);
        return jsonObject;
    }

文件差異過大導致無法顯示
+ 913 - 812
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java


+ 59 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -34,7 +34,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections.map.HashedMap;
import org.apache.el.lang.ELArithmetic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -510,6 +509,62 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        throw new IllegalStateException("验证码发送失败!");
    }
    /**
     * 心脏医院短信接口
     * @param parameters
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/sendXZCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendXZCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        if (username.length()>12){
            throw new InvalidRequestException("请输入正确的手机号!");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, username)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
        }
        //发送短信获取验证码
        String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
        JSONObject object = new JSONObject();
        object.put("operatetel","18788888888");
        object.put("interfaceid","jcpt");
        object.put("interfacepwd","jcpt");
        object.put("operator","xxgwxgzh");
        object.put("operateid","xxgwxgzh");
        JSONArray array = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("content","您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。");
        jsonObject.put("sendtel",username);
        jsonObject.put("sendtime",DateUtil.dateToStrLong(new Date()));
        array.add(jsonObject);
        object.put("messageinfo",array);
        int result =  xzzxService.SendSms(object.toJSONString());
        if (0 == result) {
            Captcha _captcha = new Captcha();
            _captcha.setCode(captcha);
            _captcha.setExpiresIn(300);
            wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
            Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, null);
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }
        throw new IllegalStateException("验证码发送失败!");
    }
    @RequestMapping(value = "/oauth/sendCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String wxId = parameters.get("wxId");
@ -517,12 +572,14 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
           return sendYKCaptcha(parameters);
        }else if("xm_zsyy_wx".equals(wxId)){
           return sendZSCaptcha(parameters);
        }else if ("xm_xzzx_wx".equals(wxId)){
            return sendXZCaptcha(parameters);
        }
        throw new IllegalStateException("验证码发送失败");
    }
    //眼科医院短信验证码
        @RequestMapping(value = "/oauth/sendYKCaptcha", method = RequestMethod.GET)
    @RequestMapping(value = "/oauth/sendYKCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendYKCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");

+ 31 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/XzzxService.java

@ -1,5 +1,6 @@
package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
@ -8,6 +9,7 @@ import com.yihu.jw.security.dao.OauthCaConfigDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 心脏中心医院
@ -34,6 +37,7 @@ public class XzzxService {
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    /**
     * OAuth登陆-认证请求接口
@ -158,4 +162,31 @@ public class XzzxService {
        return null;
    }
    /**
     * 发送短信验证码
     * @return
     * @throws Exception
     */
    public Integer SendSms(String json) throws Exception {
        int result = 0;
        String response="";
        String url = entranceUrl+"SendSms";
        Map<String,String> map = new HashedMap();
        map.put("json",json);
        response = httpClientUtil.httpPost(url,map);
        logger.info("返回参数:"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            JSONArray jsonArray= JSONArray.parseArray(object.getString("obj"));
            if (jsonArray!=null&&jsonArray.size()!=0){
                JSONObject jsonObject = jsonArray.getJSONObject(0);
                if (jsonObject.getString("code").equalsIgnoreCase("10000")){
                    result=0;
                }
            }
        }
        return result;
    }
}

+ 1 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -108,7 +108,7 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/SendSms")
    @PostMapping(value = "/SendSms")
    @ApiOperation(value = "发送短信验证码", notes = "发送短信验证码")
    public ObjEnvelop SendSms(@ApiParam(name = "json", value = "验证码内容", required = false)
                                  @RequestParam(value = "json",required = false)String json)throws Exception{

+ 1 - 7
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/ykyy/UnSettledHISPrescriptionJob.java

@ -1,13 +1,7 @@
package com.yihu.jw.job.ykyy;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.service.channel.UnSettledHISPrescriptionService;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
import com.yihu.jw.wechat.service.WxTemplateService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;

+ 18 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -226,9 +226,15 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					String rsCode = "";
					String mes = "";
					if("xm_xzzx_wx".equals(wxId)){ //心脏中心挂号
						JSONObject res = xzyyPrescriptionService.registerOutPatient(outpatientCode,doctorCode);
						rsCode = res.getString("@RESULT");
						mes = res.getString("@MSG");
						if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
							JSONObject res = xzyyPrescriptionService.registerOutPatient(outpatientCode,doctorCode);
							rsCode = res.getString("@RESULT");
							mes = res.getString("@MSG");
						}else {
							rsCode="0";
							mes="已挂号";
						}
						if (type==2){
							prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
						}
@ -237,9 +243,15 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							rsCode="0";
							mes="已挂号";
						}else {
							net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
							rsCode = (String)res.get("@RESULT");
							mes = (String)res.get("@MSG");
							if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
								net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
								rsCode = (String)res.get("@RESULT");
								mes = (String)res.get("@MSG");
							}else {
								rsCode="0";
								mes="已挂号";
							}
						}
					}