Browse Source

眼科版本更改

wangzhinan 1 week ago
parent
commit
2b0c58df0c

+ 33 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.family.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
@ -229,7 +230,21 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                            cardType1="2";
                            cardNo=clinicId;
                        }
                        res = ykyyPrescriptionService.add(familyName,cardType,idCard,phoneNum, dictId,cardType1,cardNo,basePatientDO1.getVerifyCode());
                        String authorization="";
                        String tokenRes=ykyyPrescriptionService.mobileOnly(basePatientDO1.getMobile());
                        if (StringUtils.isNotBlank(tokenRes)){
                            JSONObject object = JSONObject.parseObject(tokenRes);
                            if (object.getString("code").equalsIgnoreCase("200")){
                                JSONObject object1=object.getJSONObject("data");
                                authorization=object1.getString("accessToken");
                            }
                        }
                        if (!StringUtils.isNotBlank(authorization)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("眼科通token失效");
                            return mixEnvelop;
                        }
                        res = ykyyPrescriptionService.add(familyName,cardType,idCard,phoneNum, dictId,cardType1,cardNo,authorization);
                    }
                    if (StringUtils.isNotEmpty(res)){
                        JSONObject jsonObject1 = JSONObject.parseObject(res);
@ -239,7 +254,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
//                            result.setYktFamilyId(yktFamilyId);
                        }else {
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("添加家人关系失败,请核对个人信息.");
                            mixEnvelop.setMessage(jsonObject1.getString("msg"));
                            return mixEnvelop;
                        }
                    }else {
@ -698,7 +713,21 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                            cardType1="2";
                            cardNo=clinicId;
                        }
                        res = ykyyPrescriptionService.add(familyName,cardType,idCard,phoneNum, dictId,cardType1,cardNo,basePatientDO1.getVerifyCode());
                        String authorization="";
                        String tokenRes=ykyyPrescriptionService.mobileOnly(basePatientDO1.getMobile());
                        if (StringUtils.isNotBlank(tokenRes)){
                            JSONObject object = JSONObject.parseObject(tokenRes);
                            if (object.getString("code").equalsIgnoreCase("200")){
                                JSONObject object1=object.getJSONObject("data");
                                authorization=object1.getString("accessToken");
                            }
                        }
                        if (!StringUtils.isNotBlank(authorization)){
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("眼科通token失效");
                            return mixEnvelop;
                        }
                        res = ykyyPrescriptionService.add(familyName,cardType,idCard,phoneNum, dictId,cardType1,cardNo,authorization);
                    }
                    if (StringUtils.isNotEmpty(res)){
                        JSONObject jsonObject1 = JSONObject.parseObject(res);
@ -708,7 +737,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
//                            result.setYktFamilyId(yktFamilyId);
                        }else {
                            mixEnvelop.setStatus(408);
                            mixEnvelop.setMessage("添加家人关系失败,请核对个人信息.");
                            mixEnvelop.setMessage(jsonObject1.getString("msg"));
                            return mixEnvelop;
                        }
                    }else {

+ 80 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -228,7 +228,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                    patientMappingDO.setIdcard(patientDO.getIdcard());
                    patientMappingDO.setPatientName(patientDO.getName());
                }
                patientMappingDao.save(patientMappingDO);
                patientMappingDO= patientMappingDao.save(patientMappingDO);
            }
        } else {
@ -240,7 +240,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            return null;
        }
        logger.info("findOutpatientList patNo " + patNo);
        return ykyyEntranceService.BS30025(patNo, null, startTime, endTime, demoFlag, ksdm);
        return ykyyEntranceService.BS30025(patNo, null, startTime, endTime, demoFlag, ksdm,patientMappingDO.getPatient(),patientMappingDO.getPatientName());
    }
@ -357,8 +357,9 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        if (StringUtils.isBlank(patNo)) {
            return null;
        }
        BasePatientDO patientDO1 = basePatientDao.findById(patient);
        logger.info("findOutpatientList patNo " + patNo);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo, conNo, null, null, demoFlag, ksdm);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo, conNo, null, null, demoFlag, ksdm,patientDO1.getId(),patientDO1.getName());
        if (wlyyOutpatientVOS != null && wlyyOutpatientVOS.size() != 0) {
            WlyyOutpatientVO outpatientVO = wlyyOutpatientVOS.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
@ -1778,6 +1779,20 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        return SignGenerator.requestYkt(params,url);
    }
    /**
     * 手机号登录
     *
     * @param mobile
     * @return
     */
    public String mobileOnly(String mobile){
        String url = newYktUrl+"/api/ext/ykt/open/account/login/mobile-only";
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile);
        return SignGenerator.requestYkt(params,url);
    }
    /**
     * 添加就诊人
     *
@ -1813,6 +1828,37 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        return SignGenerator.requestYktAndHeader(params,headerParams,url);
    }
    /**
     * 调佣眼科通埋点
     *
     *
     * @param source 渠道,1-校筛报告
     * @param eventType 事件类型:view-页面浏览, click-点击
     * @param eventName 事件名称或触发位置(如:校筛扫码、校筛报告结果、浏览首页、浏览资讯列表、点击提交预约等)
     * @param page 事件发生页面
     * @param referPage 来源页面
     * @param hospId 医院ID
     * @param hospName 医院名称
     * @param userName 姓名
     * @param authorization
     * @return
     */
    public String track(String source,String eventType,String eventName,String page,String referPage,String hospId,String hospName,String userName,String authorization){
        String url = newYktUrl+"/api/ext/ykt/track";
        Map<String, Object> params = new HashMap<>();
        params.put("source", source);
        params.put("eventType", eventType);
        params.put("eventName", eventName);
        params.put("page", page);
        params.put("referPage", referPage);
        params.put("hospId", hospId);
        params.put("hospName", hospName);
        params.put("userName", userName);
        Map<String,String> headerParams = new HashMap<>();
        headerParams.put("Authorization","Bearer "+authorization);
        return SignGenerator.requestYktAndHeader(params,headerParams,url);
    }
    /**
     * 获取医院列表
     * @param hospName 名称
@ -2109,4 +2155,35 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    public String replaceHtml(String demoData,String oldChar,String newChar){
        return demoData.replace(oldChar,null==newChar?"无":newChar);
    }
    /**
     * 上传埋点
     * @param patientId
     * @param source
     * @param eventType
     * @param eventName
     * @param page
     * @param referPage
     * @param hospId
     * @param hospName
     * @param userName
     * @return
     * @throws Exception
     */
    public String traceRecharge(String patientId,String source,String eventType,String eventName,String page,String referPage,String hospId,String hospName,String userName) throws Exception {
        BasePatientDO patientDO = basePatientDao.findById(patientId);
        String authorization ="";
        String tokenRes=mobileOnly(patientDO.getMobile());
        if (org.apache.commons.lang.StringUtils.isNotBlank(tokenRes)){
            JSONObject object = JSONObject.parseObject(tokenRes);
            if (object.getString("code").equalsIgnoreCase("200")){
                JSONObject object1=object.getJSONObject("data");
                authorization=object1.getString("accessToken");
            }
        }
        if (!org.apache.commons.lang.StringUtils.isNotBlank(authorization)){
            throw new Exception("获取登录失效");
        }
        return track(source,eventType,eventName,page,referPage,hospId,hospName,userName,authorization);
    }
}

+ 4 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -520,7 +520,7 @@ public class YkyyEntranceService {
     * @return
     * @throws Exception
     */
    public List<WlyyOutpatientVO> BS30025(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag,String ksdm) throws Exception {
    public List<WlyyOutpatientVO> BS30025(String PAT_NO, String conNo, String startTime, String endTime, boolean demoFlag,String ksdm,String patient,String patientName) throws Exception {
        String fid = "BS30025";
        logger.info("EntranceService " + fid + " PAT_NO :" + PAT_NO + " conNo:" + conNo + " startTime:" + startTime + " endTime:" + endTime);
@ -529,12 +529,6 @@ public class YkyyEntranceService {
        String orgCode = "350211A5004";
        String orgName = "厦门大学附属厦门眼科中心";
        //居民id转化
        PatientMappingDO patientMappingDO = patientMappingDao.findByMappingCodeAndSource(PAT_NO,"1");
        if(patientMappingDO == null){
            return null;
        }
//KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
//                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH
        JSONArray jsonArray = new JSONArray();
@ -570,7 +564,7 @@ public class YkyyEntranceService {
            jsonArray.add(jsonObject);
            jsonArray.add(jsonObject2);
        }else {
            jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime,ksdm);
            jsonArray = findV_ZKSG_HZCX_HIS(PAT_NO,conNo,startTime,endTime,ksdm);
        }
        //查找眼科数据
        if (jsonArray.size() == 0) {
@ -589,8 +583,8 @@ public class YkyyEntranceService {
                //wlyyOutpatientVO.setRegisterNo(null == jsonObjectMgsInfo.get("REGISTER_SN") ? "" : jsonObjectMgsInfo.get("REGISTER_SN") + "");
                wlyyOutpatientVO.setDept(null == jsonObjectMgsInfo.get("KSDM") ? "" : jsonObjectMgsInfo.get("KSDM") + "");
                wlyyOutpatientVO.setDeptName(null == jsonObjectMgsInfo.get("KSMC") ? "" : jsonObjectMgsInfo.get("KSMC") + "");
                wlyyOutpatientVO.setPatient(patientMappingDO.getPatient());
                wlyyOutpatientVO.setPatientName(patientMappingDO.getPatientName());
                wlyyOutpatientVO.setPatient(patient);
                wlyyOutpatientVO.setPatientName(patientName);
                wlyyOutpatientVO.setConNo(null == jsonObjectMgsInfo.get("JZXH") ? "" : jsonObjectMgsInfo.get("JZXH") + "");
                String doctor = null == jsonObjectMgsInfo.get("YSDM") ? "" : jsonObjectMgsInfo.get("YSDM") + "";

+ 7 - 7
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java

@ -447,14 +447,14 @@ public class BasicZuulFilter extends ZuulFilter {
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(str)){
            str = str.toLowerCase();//统一转为小写,比较简单的单词加入右边空格,避免单词中包含字段
            String badStr = "exec|execute|insert|select|delete|drop|chr"+
                    "information_schema.columns|table_schema|union|where|order|like|" ;//过滤掉的sql关键字,可以手动添加
                    "information_schema.columns|table_schema|union|where|like" ;//过滤掉的sql关键字,可以手动添加
            String[] badStrs = badStr.split("\\|");
            for (int i = 0; i < badStrs.length; i++) {
                if (str.indexOf(badStrs[i]) >= 0) {
                    logger.info("2222222222222222222"+badStrs[i]);
                    return true;
                }
            }
//            for (int i = 0; i < badStrs.length; i++) {
//                if (str.indexOf(badStrs[i]) >= 0) {
//                    logger.info("2222222222222222222"+badStrs[i]);
//                    return true;
//                }
//            }
            return false;
        }else {
            return true;

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

@ -1242,18 +1242,26 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }else {
            if ("1".equalsIgnoreCase(isDoctor)){
                String res = ykyyService.getResetCode("4",username);
                String resltCode ="";
                String captcha = "";
                if (!StringUtils.isEmpty(res)){
                    JSONObject jsonObject = JSONObject.parseObject(res);
                    if ("10000".equalsIgnoreCase(jsonObject.getString("code"))){
                        captcha = jsonObject.getString("value");
                        resltCode = jsonObject.getString("code");
                        msg = "发送成功";
                    }
                //发送短信获取验证码
                String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
//                String res = ykyyService.getResetCode("4",username);
//                String resltCode ="";
//                String captcha = "";
//                if (!StringUtils.isEmpty(res)){
//                    JSONObject jsonObject = JSONObject.parseObject(res);
//                    if ("10000".equalsIgnoreCase(jsonObject.getString("code"))){
//                        captcha = jsonObject.getString("value");
//                        resltCode = jsonObject.getString("code");
//                        msg = "发送成功";
//                    }
//                }
                ResultMsg result= null;
                if("1".equals(type)){
                    result = ykyyINSMSService.ykyySendSMS(username,"您好,您的手机登录短信验证码是:"+captcha+",5分钟内有效。");
                }else if("2".equals(type)) {
                    result = ykyyINSMSService.ykyySendSMS(username, "您好,您正在进行找回密码操作,您的短信验证码是:" + captcha + ",请勿将验证码告诉他人,5分钟内有效。");
                }
                if ("10000".equalsIgnoreCase(resltCode)) {
                if (result.isSuccess()) {
                    Captcha _captcha = new Captcha();
                    _captcha.setCode(captcha);
@ -2780,17 +2788,26 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/findDoctorPw", method = RequestMethod.POST)
    public Envelop findDoctorPw(String mobile,String client_id,String captcha,String pw) throws Exception{
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String response =  ykyyService.ResetPwd(mobile,pw,captcha);
            if (org.apache.commons.lang3.StringUtils.isNoneBlank(response)){
                JSONObject object = JSONObject.parseObject(response);
                if (object.getString("code").equalsIgnoreCase("10000")){
                    return ObjEnvelop.getSuccess("修改成功!");
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
            if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
                if (captcha.equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){
                }else {
                    return ObjEnvelop.getError("修改失败!");
                    return ObjEnvelop.getError("验证码错误!");
                }
            }else {
                return ObjEnvelop.getError("修改失败!");
                if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
                    //验证码正确
                } else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }
            String rs = registerService.updateDoctorPw(mobile,pw,wechatId);
            if("ok".equals(rs)){
                return ObjEnvelop.getSuccess("修改成功!");
            }
            return ObjEnvelop.getError("手机号未注册!");
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
            if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
@ -3398,32 +3415,33 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                BasePatientDO basePatientDO = new BasePatientDO();
                                if (basePatientDOS==null||basePatientDOS.size()==0){
                                    basePatientDO.setDel("1");
                                    basePatientDO.setName(infoData.getString("userName"));
                                    basePatientDO.setName(infoData.getString("nickName"));
                                    basePatientDO.setCreateTime(new Date());
                                    basePatientDO.setUpdateTime(new Date());
                                    basePatientDO.setYktId(infoData.getString("mainAccountId"));
                                    basePatientDO.setUserId(infoData.getString("mainAccountId"));
                                    basePatientDO.setIdcard(infoData.getString("idNo"));
                                    String salt = UUID.randomUUID().toString().substring(0,5);
                                    String idcard = infoData.getString("idNo");
                                    Integer age = IdCardUtil.getAgeForIdcard(idcard);
                                    String sex = IdCardUtil.getSexForIdcard_new(idcard);
                                    Integer sexx = null;
                                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(sex)){
                                        sexx = Integer.parseInt(sex);
                                    if(org.apache.commons.lang3.StringUtils.isNoneBlank(idcard)){
                                        String pw = idcard.substring(idcard.length()-6,idcard.length());
                                        basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                        Integer age = IdCardUtil.getAgeForIdcard(idcard);
                                        String sex = IdCardUtil.getSexForIdcard_new(idcard);
                                        Integer sexx = null;
                                        if (org.apache.commons.lang3.StringUtils.isNoneBlank(sex)){
                                            sexx = Integer.parseInt(sex);
                                        }
                                        basePatientDO.setAge(age);
                                        basePatientDO.setSex(sexx);
                                    }
                                    basePatientDO.setIdcard(infoData.getString("idNo"));
                                    String birthDay = infoData.getString("birthday");
                                    Date birthday = null;
                                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(birthDay)){
                                        birthday = DateUtil.strToDate(birthDay+" 00:00:00");;
                                    }
                                    basePatientDO.setAge(age);
                                    basePatientDO.setBirthday(birthday);
                                    basePatientDO.setSex(sexx);
                                    basePatientDO.setMobile(mobile1);
                                    String salt = UUID.randomUUID().toString().substring(0,5);
                                    String pw = idcard.substring(idcard.length()-6,idcard.length());
                                    basePatientDO.setIdcard(idcard);
                                    basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                    basePatientDO.setSalt(salt);
                                    basePatientDO.setLocked(0);
                                    basePatientDO.setEnabled(1);
@ -3431,6 +3449,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                    basePatientDO.setAppletsOpenId(infoData.getString("openid"));
                                    basePatientDO.setVerifyCode(accessToken);
                                    basePatientDO = basePatientDao.save(basePatientDO);
                                    oauthYlzConfigService.deleteMember(basePatientDO.getId());
                                    JSONArray familyList = infoData.getJSONArray("patientAccountList");
                                    if (familyList!=null&&familyList.size()!=0){
                                        for (int i=0;i<familyList.size();i++){
@ -3453,7 +3472,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                                Integer sexx1 = null;
                                                if (org.apache.commons.lang3.StringUtils.isNoneBlank(sex1)){
                                                    sexx1 = Integer.parseInt(sex);
                                                    sexx1 = Integer.parseInt(sex1);
                                                }
                                                String birthDay1 = IdCardUtil.getBirthdayForIdcardStr(idcard1);
                                                Date birthday1 = null;
@ -3527,8 +3546,10 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                }else {
                                    basePatientDO = basePatientDOS.get(0);
                                    basePatientDO.setVerifyCode(accessToken);
                                    basePatientDO.setName(infoData.getString("nickName"));
                                    basePatientDO.setAppletsOpenId(infoData.getString("openid"));
                                    basePatientDao.save(basePatientDO);
                                    oauthYlzConfigService.deleteMember(basePatientDO.getId());
                                    JSONArray familyList = infoData.getJSONArray("patientAccountList");
                                    if (familyList!=null&&familyList.size()!=0){
                                        for (int i=0;i<familyList.size();i++){
@ -4322,84 +4343,85 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                KeyPair keyPair = (KeyPair) httpSession.getAttribute("privateKey");
                String password = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("password"), keyPair);
                logger.info("password:"+password);
                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    logger.info("眼科通登陆返回参数:"+object);
                    if (!object.getString("code").equalsIgnoreCase("10000")){
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("message"),-1,userSimple);
                    }else {
                        JSONObject jsonObject = object.getJSONObject("value");
                        if (jsonObject!=null) {
                            String idCard = jsonObject.getString("idCard");
                            String verifyCode = jsonObject.getString("verifyCode");
                            String yktDoctorId= jsonObject.getString("id");
                            BaseDoctorDO doctorDOs = doctorDao.findByIdcard(idCard);
                            if (doctorDOs!=null){
                                doctorDOs.setVerifyCode(verifyCode);
                                doctorDOs.setYktDoctorId(yktDoctorId);
                                /*doctorDOs.setYktCode();*/
                                doctorDao.save(doctorDOs);
                            }else {
                                WlyyUserSimple userSimple = new WlyyUserSimple();
                                return getFailedResponse("您的账号未认证,请联系互联网医院工作人员,联系电话0592-2108763。",-1,userSimple);
                            }
                            if (idCard==null||idCard==""){
                                logger.info("身份证为空");
                            }else {
                                ykyyService.updateYkyyDoctor(idCard,verifyCode,yktDoctorId);
                            }
                        }
                    }
                }
                parameters.remove("password");
//                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
//                if (!StringUtils.isEmpty(response)){
//                    JSONObject object = JSONObject.parseObject(response);
//                    logger.info("眼科通登陆返回参数:"+object);
//                    if (!object.getString("code").equalsIgnoreCase("10000")){
//                        WlyyUserSimple userSimple = new WlyyUserSimple();
//                        return getFailedResponse(object.getString("message"),-1,userSimple);
//                    }else {
//                        JSONObject jsonObject = object.getJSONObject("value");
//                        if (jsonObject!=null) {
//                            String idCard = jsonObject.getString("idCard");
//                            String verifyCode = jsonObject.getString("verifyCode");
//                            String yktDoctorId= jsonObject.getString("id");
//                            BaseDoctorDO doctorDOs = doctorDao.findByIdcard(idCard);
//                            if (doctorDOs!=null){
//                                doctorDOs.setVerifyCode(verifyCode);
//                                doctorDOs.setYktDoctorId(yktDoctorId);
//                                /*doctorDOs.setYktCode();*/
//                                doctorDao.save(doctorDOs);
//                            }else {
//                                WlyyUserSimple userSimple = new WlyyUserSimple();
//                                return getFailedResponse("您的账号未认证,请联系互联网医院工作人员,联系电话0592-2108763。",-1,userSimple);
//                            }
//                            if (idCard==null||idCard==""){
//                                logger.info("身份证为空");
//                            }else {
//                                ykyyService.updateYkyyDoctor(idCard,verifyCode,yktDoctorId);
//                            }
//                        }
//                    }
//                }
//                parameters.remove("password");
                  parameters.put("password",password);
            } else if (parameters.get("mobile") != null) {
                KeyPair keyPair = (KeyPair) httpSession.getAttribute("privateKey");
                String mobile = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("mobile"), keyPair);
                logger.info("mobile:"+mobile);
                String password = null;
                String res = ykyyService.getDoctorPhone(mobile);
                if (res!=null&&res!=""){
                    JSONObject object = JSONObject.parseObject(res);
                    if (object.getString("code").equalsIgnoreCase("200")){
                        password = object.getString("data");
                    }else {
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("msg"),-1,userSimple);
                    }
                }
                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    logger.info("眼科通登陆返回参数:"+object);
                    if (!object.getString("code").equalsIgnoreCase("10000")){
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("message"),-1,userSimple);
                    }else {
                        JSONObject jsonObject = object.getJSONObject("value");
                        if (jsonObject!=null) {
                            String idCard = jsonObject.getString("idCard");
                            String verifyCode = jsonObject.getString("verifyCode");
                            String yktDoctorId= jsonObject.getString("id");
                            BaseDoctorDO doctorDOs = doctorDao.findByIdcard(idCard);
                            if (doctorDOs!=null){
                                doctorDOs.setVerifyCode(verifyCode);
                                doctorDOs.setYktDoctorId(yktDoctorId);
                                /*doctorDOs.setYktCode();*/
                                doctorDao.save(doctorDOs);
                            }else {
                                WlyyUserSimple userSimple = new WlyyUserSimple();
                                return getFailedResponse("您的账号未认证,请联系互联网医院工作人员,联系电话0592-2108763。",-1,userSimple);
                            }
                            if (idCard==null||idCard==""){
                                logger.info("身份证为空");
                            }else {
                                ykyyService.updateYkyyDoctor(idCard,verifyCode,yktDoctorId);
                            }
                        }
                    }
                }
//                String password = null;
//                String res = ykyyService.getDoctorPhone(mobile);
//                if (res!=null&&res!=""){
//                    JSONObject object = JSONObject.parseObject(res);
//                    if (object.getString("code").equalsIgnoreCase("200")){
//                        password = object.getString("data");
//                    }else {
//                        WlyyUserSimple userSimple = new WlyyUserSimple();
//                        return getFailedResponse(object.getString("msg"),-1,userSimple);
//                    }
//                }
//                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
//                if (!StringUtils.isEmpty(response)){
//                    JSONObject object = JSONObject.parseObject(response);
//                    logger.info("眼科通登陆返回参数:"+object);
//                    if (!object.getString("code").equalsIgnoreCase("10000")){
//                        WlyyUserSimple userSimple = new WlyyUserSimple();
//                        return getFailedResponse(object.getString("message"),-1,userSimple);
//                    }else {
//                        JSONObject jsonObject = object.getJSONObject("value");
//                        if (jsonObject!=null) {
//                            String idCard = jsonObject.getString("idCard");
//                            String verifyCode = jsonObject.getString("verifyCode");
//                            String yktDoctorId= jsonObject.getString("id");
//                            BaseDoctorDO doctorDOs = doctorDao.findByIdcard(idCard);
//                            if (doctorDOs!=null){
//                                doctorDOs.setVerifyCode(verifyCode);
//                                doctorDOs.setYktDoctorId(yktDoctorId);
//                                /*doctorDOs.setYktCode();*/
//                                doctorDao.save(doctorDOs);
//                            }else {
//                                WlyyUserSimple userSimple = new WlyyUserSimple();
//                                return getFailedResponse("您的账号未认证,请联系互联网医院工作人员,联系电话0592-2108763。",-1,userSimple);
//                            }
//                            if (idCard==null||idCard==""){
//                                logger.info("身份证为空");
//                            }else {
//                                ykyyService.updateYkyyDoctor(idCard,verifyCode,yktDoctorId);
//                            }
//                        }
//                    }
//                }
                parameters.remove("password");
            }else {
                //第三方同步账号模式登录

+ 20 - 14
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/SignGenerator.java

@ -3,6 +3,7 @@ package com.yihu.jw.security.utils;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.xmlbeans.impl.schema.StscChecker;
import org.springframework.util.StringUtils;
import java.net.URLEncoder;
@ -23,22 +24,27 @@ public class SignGenerator {
//        params1.put("mobile", "17602157210");
//        params1.put("scene", "EXT_REGISTER");
//        requestYkt(params1,"https://huaxia.yanketong.com/api/ext/ykt/open/sms/code/send");
        Map<String, Object> params2 = new HashMap<>();
        params2.put("mobile", "17602157210");
        params2.put("code", "965196");
        String res = requestYkt(params2,"https://huaxia.yanketong.com/api/ext/ykt/open/account/login/mobile");
        JSONObject resObj = JSONObject.parseObject(res);
        if (resObj.getString("code").equalsIgnoreCase("200")){
            JSONObject data = resObj.getJSONObject("data");
            Map<String, Object> params = new HashMap<>();
            Map<String, String> header = new HashMap<>();
            header.put("Authorization","Bearer "+data.getString("accessToken"));
            System.out.println("accessToken"+header);
            requestYktAndHeaderGet(params,header,"https://huaxia.yanketong.com/api/ext/ykt/account/info");
        }
//        Map<String, Object> params2 = new HashMap<>();
//        params2.put("mobile", "17602157210");
//        params2.put("code", "965196");
//        String res = requestYkt(params2,"https://huaxia.yanketong.com/api/ext/ykt/open/account/login/mobile");
//        JSONObject resObj = JSONObject.parseObject(res);
//        if (resObj.getString("code").equalsIgnoreCase("200")){
//            JSONObject data = resObj.getJSONObject("data");
//            Map<String, Object> params = new HashMap<>();
//            Map<String, String> header = new HashMap<>();
//            header.put("Authorization","Bearer "+data.getString("accessToken"));
//            System.out.println("accessToken"+header);
//            requestYktAndHeaderGet(params,header,"https://huaxia.yanketong.com/api/ext/ykt/account/info");
//
//        }
//
        String url = "https://huaxia.yanketong.com/api/ext/ykt/open/account/login/mobile-only";
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", "13037228861");
        String res = requestYkt(params,url);
        System.out.println("111111111111111"+res);
    }

+ 0 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -385,7 +385,6 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            String medicareType = jsonObject.getString("medicareType");
            String medicare = jsonObject.getString("medicare");
            String clinicId = jsonObject.getString("clinicId");
            String scbgjt = jsonObject.getString("scbgjt");
            boolean checkCode =false;
            if(!StringUtils.isEmpty(code)){
                checkCode = this.verification(client_id, username, code);

+ 38 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -498,4 +498,42 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
            return  failedListEnvelopException(e);
        }
    }
    /**
     *
     * @param source 渠道,1-校筛报告
     * @param eventType 事件类型:view-页面浏览, click-点击
     * @param eventName 事件名称或触发位置(如:校筛扫码、校筛报告结果、浏览首页、浏览资讯列表、点击提交预约等)
     * @param page 事件发生页面
     * @param referPage 来源页面
     * @param hospId 医院ID
     * @param hospName 医院名称
     * @param userName 姓名
     */
    @GetMapping(value = "traceRecharge")
    @ApiOperation(value = "埋点调用", notes = "埋点调用")
    public Envelop traceRecharge(@ApiParam(name = "patientId", value = "患者id")
                                  @RequestParam(value = "patientId", required = false)String patientId,
                                  @ApiParam(name = "source", value = "渠道,1-校筛报告")
                                  @RequestParam(value = "source", required = false)String source,
                                  @ApiParam(name = "eventType", value = "事件类型:view-页面浏览, click-点击")
                                  @RequestParam(value = "eventType", required = false)String eventType,
                                  @ApiParam(name = "eventName", value = "事件名称或触发位置(如:校筛扫码、校筛报告结果、浏览首页、浏览资讯列表、点击提交预约等)")
                                  @RequestParam(value = "eventName", required = false)String eventName,
                                  @ApiParam(name = "page", value = "事件发生页面")
                                  @RequestParam(value = "page", required = false)String page,
                                  @ApiParam(name = "referPage", value = "来源页面")
                                      @RequestParam(value = "referPage", required = false)String referPage,
                                  @ApiParam(name = "hospId", value = "医院ID")
                                      @RequestParam(value = "hospId", required = false)String hospId,
                                  @ApiParam(name = "hospName", value = "医院名称")
                                      @RequestParam(value = "hospName", required = false)String hospName,
                                  @ApiParam(name = "userName", value = "姓名")
                                      @RequestParam(value = "userName", required = false)String userName)throws Exception {
        try {
            return success("ok",prescriptionService.traceRecharge(patientId,source,eventType,eventName,page,referPage,hospId,hospName,userName));
        }catch (Exception e) {
            return  failedListEnvelopException(e);
        }
    }
}

+ 17 - 15
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/QrcodeService.java

@ -473,23 +473,25 @@ public class QrcodeService {
            }
            System.out.println("token"+token);
            System.out.println("wxId"+wxId);
            String url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token="+token+"&openid="+openId+"&lang=zh_CN";
            String res = httpClientUtil.get(url,"utf-8");
            String userName = "";
            if (StringUtils.isNoneBlank(res)){
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                if (null!=jsonObject.get("errcode")){
                    objEnvelop.setMessage(jsonObject.getString("errmsg"));
                    objEnvelop.setStatus(Integer.valueOf(jsonObject.getString("errcode")));
                }else {
                    userName = jsonObject.getString("nickname");
                    objEnvelop.setStatus(200);
                    objEnvelop.setMessage(jsonObject.toString());
            if (!"xm_ykyy_wx".equalsIgnoreCase(wxId)){
                String url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token="+token+"&openid="+openId+"&lang=zh_CN";
                String res = httpClientUtil.get(url,"utf-8");
                String userName = "";
                if (StringUtils.isNoneBlank(res)){
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                    if (null!=jsonObject.get("errcode")){
                        objEnvelop.setMessage(jsonObject.getString("errmsg"));
                        objEnvelop.setStatus(Integer.valueOf(jsonObject.getString("errcode")));
                    }else {
                        userName = jsonObject.getString("nickname");
                        objEnvelop.setStatus(200);
                        objEnvelop.setMessage(jsonObject.toString());
                    }
                    LOGGER.info("usernme:"+userName);
                }
                LOGGER.info("usernme:"+userName);
            }
            System.out.println(res);
                System.out.println(res);
            }
            return objEnvelop;
        }else {
            objEnvelop.setMessage("无用户信息");