소스 검색

新增易联众对接

chenweida 7 년 전
부모
커밋
cce382ce2d

+ 34 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/YLZUserService.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.service.third.ylz;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.ylzinfo.ehc.empi.sdk.EhcEmpiClient;
import com.ylzinfo.ehc.empi.sdk.EhcEmpiClient;
import com.ylzinfo.ehc.empi.sdk.domain.ResponseParams;
import com.ylzinfo.ehc.empi.sdk.domain.ResponseParams;
import com.ylzinfo.ehc.empi.sdk.dto.request.AuthorizationTokenRequest;
import com.ylzinfo.ehc.empi.sdk.dto.request.UserInfoRequest;
import com.ylzinfo.ehc.empi.sdk.dto.request.UserInfoRequest;
import com.ylzinfo.ehc.empi.sdk.dto.response.AuthorizationTokenResponse;
import com.ylzinfo.ehc.empi.sdk.dto.response.AuthorizationTokenResponse;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
@ -19,7 +20,7 @@ import java.util.Map;
 */
 */
@Service
@Service
public class YLZUserService {
public class YLZUserService {
    Logger logger = LoggerFactory.getLogger(YLZUserService.class);
    Logger logger = LoggerFactory.getLogger("elasticsearch_logger");
    //网关地址
    //网关地址
    @Value("${ylz.gateway.url}")
    @Value("${ylz.gateway.url}")
    private String gatewayURL;
    private String gatewayURL;
@ -38,6 +39,8 @@ public class YLZUserService {
    private String appSecret;
    private String appSecret;
    @Value("${ylz.redirectUrl}")
    @Value("${ylz.redirectUrl}")
    private String redirectUrl;
    private String redirectUrl;
    @Value("${server.server_url}")
    private String server_url;
    private String signType = "MD5";
    private String signType = "MD5";
@ -50,23 +53,24 @@ public class YLZUserService {
        try {
        try {
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            try {
            try {
                Map params = new HashMap();
                Map params = new HashMap();
                params.put("response_type", responseType);
                params.put("response_type", responseType);
                params.put("redirect_url", redirectUrl);
                params.put("redirect_url", redirectUrl);
                params.put("auth_type", "IXM");
                params.put("auth_type", "IXM");
                params.put("domain_cust_id", "openId");
                params.put("domain_cust_id", "openId");
                logger.info(net.sf.json.JSONObject.fromObject(params).toString());
                //params 为自行解析回调参数。 key值参考文档
                //params 为自行解析回调参数。 key值参考文档
                ResponseParams<AuthorizationTokenResponse> response = empiClient.checkResponseParams(params, AuthorizationTokenResponse.class);
                ResponseParams<AuthorizationTokenResponse> response = empiClient.checkResponseParams(params, AuthorizationTokenResponse.class);
                if (empiClient.isSuccessful(response)) {
                if (empiClient.isSuccessful(response)) {
                    AuthorizationTokenResponse authorizationTokenResponse = response.getBizContent();
                    AuthorizationTokenResponse authorizationTokenResponse = response.getBizContent();
                    logger.info("易联众返回结果:" + authorizationTokenResponse);
                    logger.info(net.sf.json.JSONObject.fromObject(authorizationTokenResponse).toString());
                    return authorizationTokenResponse;
                    return authorizationTokenResponse;
                } else {
                } else {
                    logger.error("调用易联众接口失败:" + net.sf.json.JSONObject.fromObject(response));
                    logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
                }
                }
            } catch (Exception e) {
            } catch (Exception e) {
                e.printStackTrace();
                e.printStackTrace();
@ -85,17 +89,21 @@ public class YLZUserService {
    public UserInfoResponse getUserByToken(String token) {
    public UserInfoResponse getUserByToken(String token) {
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        try {
        try {
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            UserInfoRequest params = new UserInfoRequest();
            UserInfoRequest params = new UserInfoRequest();
            params.setAccessToken(token);
            params.setAccessToken(token);
            logger.info(net.sf.json.JSONObject.fromObject(params).toString());
            ResponseParams<UserInfoResponse> response = empiClient.queryUserInfo(params);
            ResponseParams<UserInfoResponse> response = empiClient.queryUserInfo(params);
            if (empiClient.isSuccessful(response)) {
            if (empiClient.isSuccessful(response)) {
                UserInfoResponse userInfoResponse = response.getBizContent();
                UserInfoResponse userInfoResponse = response.getBizContent();
                logger.info("易联众返回结果:" + userInfoResponse);
                logger.info(net.sf.json.JSONObject.fromObject(userInfoResponse).toString());
                return userInfoResponse;
                return userInfoResponse;
            } else {
            } else {
                logger.error("调用易联众接口失败:" + net.sf.json.JSONObject.fromObject(response));
                logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
            }
            }
            return null;
            return null;
        } catch (Exception e) {
        } catch (Exception e) {
@ -105,4 +113,24 @@ public class YLZUserService {
    }
    }
    public String securityURL(String openId) {
        String url = "";
        try {
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            try {
                logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
                AuthorizationTokenRequest params = new AuthorizationTokenRequest();
                params.setRedirectUrl("http://www.baidu.com");
                params.setUserName("48");
//            params.setScope();
                url = empiClient.createUrl("gatewayPage", "empi.uimc.authorization", params);
                System.out.println(url);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return url;
    }
}
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/IdCardUtil.java

@ -122,6 +122,30 @@ public class IdCardUtil {
        return b;
        return b;
    }
    }
    /**
     * 身份证提取出身日期
     *
     * @param card
     * @return
     * @throws Exception
     */
    public static String getBirthdayForIdcardStr(String card)
            throws Exception {
        if (card.length() == 18) {
            String year = card.substring(6).substring(0, 4);// 得到年份
            String yue = card.substring(10).substring(0, 2);// 得到月份
            String ri = card.substring(12).substring(0, 2);// 得到日
            // String day=CardCode.substring(12).substring(0,2);//得到日
            return year + yue + ri;
        } else if (card.length() == 15) {
            String uyear = "19" + card.substring(6, 8);// 年份
            String uyue = card.substring(8, 10);// 月份
            String uri = card.substring(10, 12);// 得到日
            return uyear + uyue + uri;
        }
        return null;
    }
    /**
    /**
     * 根据身份证的号码算出当前身份证持有者的性别
     * 根据身份证的号码算出当前身份证持有者的性别
     * 1 女 2 男 3未知
     * 1 女 2 男 3未知

+ 85 - 25
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -15,14 +15,13 @@ import com.yihu.wlyy.service.common.account.AccessTokenService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinTagUtil;
import com.yihu.wlyy.wechat.util.WeiXinTagUtil;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.json.JSONObject;
@ -34,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLDecoder;
import java.util.*;
import java.util.*;
@ -73,6 +73,8 @@ public class WechatController extends WeixinBaseController {
    private WeiXinTagUtil weiXinTagUtil;
    private WeiXinTagUtil weiXinTagUtil;
    @Autowired
    @Autowired
    private RSAUtils rsaUtils;
    private RSAUtils rsaUtils;
    @Autowired
    private YLZUserService ylzUserService;
    /**
    /**
@ -132,7 +134,7 @@ public class WechatController extends WeixinBaseController {
            // 解密身份证号
            // 解密身份证号
            //idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            //idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            rsaUtils.setBaseService(patientService);
            rsaUtils.setBaseService(patientService);
            idcard =rsaUtils.decryptString(idcard);
            idcard = rsaUtils.decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = StringUtils.reverse(idcard);
            idcard = StringUtils.reverse(idcard);
@ -192,7 +194,8 @@ public class WechatController extends WeixinBaseController {
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "openid", required = true) String openid,
                         @RequestParam(value = "openid", required = true) String openid,
                         @RequestParam(value = "password", required = true) String password) {
                         @RequestParam(value = "password", required = true) String password,
                         @RequestParam(value = "token", required = false) String token) {
        try {
        try {
            if (StringUtils.isEmpty(name)) {
            if (StringUtils.isEmpty(name)) {
                return error(-1, "姓名不允许为空!");
                return error(-1, "姓名不允许为空!");
@ -240,7 +243,62 @@ public class WechatController extends WeixinBaseController {
            } else {
            } else {
                return error(-1, "请输入正确的身份证号!");
                return error(-1, "请输入正确的身份证号!");
            }
            }
            //==========================同步易联众的医保卡号=============================
            //判断此人有没有厦门社保卡 没有补给注册
            //判断身份证号与姓名是否一致
            //判断身份证和社保卡是否一致  统一只存英文字母开头的医保卡
            if (!org.springframework.util.StringUtils.isEmpty(token)) {
                UserInfoResponse userInfoResponse = ylzUserService.getUserByToken(token);
                if (userInfoResponse.getCardInfo() != null && userInfoResponse.getCardInfo().size() > 0) {
                    List<UserInfoResponse.CardInfo> cards = userInfoResponse.getCardInfo();
                    Boolean hasCard = false;
                    UserInfoResponse.CardInfo cardInfo = null;
                    for (UserInfoResponse.CardInfo card : cards) {
                        //如果患者有正常状态的社保卡
                        if ("01".equals(card.getCardType()) && "normal".equals("state")) {
                            hasCard = true;
                            cardInfo = card;
                            break;
                        }
                    }
                    if (!hasCard) {
                        return error(-1, "医保卡不存在,必须使用正常状态的厦门医保卡");
                    }
                    if (name.compareTo(userInfoResponse.getName() == null ? "" : userInfoResponse.getName()) != 0) {
                        return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
                    }
                    if (ssc.compareTo(cardInfo.getCardNo() == null ? "" : cardInfo.getCardNo()) != 0) {
                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
                    } else {
                        ssc = cardInfo.getCardNo();//统一只存英文字母开头的医保卡
                    }
                    SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
                    //如果我们表没有记录那就新增一条记录
                    if(socialSecurityInfo==null){
                        socialSecurityInfo=new SocialSecurityInfo();
                        socialSecurityInfo.setXming0(name);
                        socialSecurityInfo.setXbie00(IdCardUtil.getSexForIdcard(idcard));
                        socialSecurityInfo.setCsrqi0(IdCardUtil.getBirthdayForIdcardStr(idcard));
                        socialSecurityInfo.setSfzh18(idcard);
                        socialSecurityInfo.setGrsfen("8");
                        socialSecurityInfo.setId0000(idcard);
                        socialSecurityInfo.setGzztai("01");
                        socialSecurityInfo.setCardno(ssc);
                        socialSecurityInfoDao.save(socialSecurityInfo);
                    }
                    //如果医保卡不一致更新{
                    if(!socialSecurityInfo.getCardno().equals(ssc)){
                        socialSecurityInfo.setCardno(ssc);
                    }
                }
            }
            //==============================旧版验证=========================
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
//
//
//            if (socialSecurityInfo != null) {
//            if (socialSecurityInfo != null) {
@ -258,6 +316,7 @@ public class WechatController extends WeixinBaseController {
//                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
//                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
//            }
//            }
            //==========================旧版验证=============================
            Patient patient = patientDao.findByIdcard(idcard);
            Patient patient = patientDao.findByIdcard(idcard);
            if (patient == null) {
            if (patient == null) {
@ -278,7 +337,7 @@ public class WechatController extends WeixinBaseController {
            password = StringUtils.reverse(password);
            password = StringUtils.reverse(password);
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setSsc(ssc);
            patient.setSsc(ssc);
            if(!"undefined".equals(openid)&&StringUtils.isNotBlank(openid)){
            if (!"undefined".equals(openid) && StringUtils.isNotBlank(openid)) {
                patient.setOpenid(openid);
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
                patient.setOpenidTime(new Date());
            }
            }
@ -287,7 +346,7 @@ public class WechatController extends WeixinBaseController {
//                patient.setOpenidTime(new Date());
//                patient.setOpenidTime(new Date());
//            }
//            }
            JSONObject json = patientService.register(idcard, ssc, name, mobile, MD5.GetMD5Code(password + salt)
            JSONObject json = patientService.register(idcard, ssc, name, mobile, MD5.GetMD5Code(password + salt)
                    ,salt,openid,3);
                    , salt, openid, 3);
            if (json != null) {
            if (json != null) {
                try {
                try {
                    Patient p = patientDao.findByIdcard(idcard);
                    Patient p = patientDao.findByIdcard(idcard);
@ -307,6 +366,7 @@ public class WechatController extends WeixinBaseController {
        }
        }
    }
    }
    /**
    /**
     * 患者微信登录接口
     * 患者微信登录接口
     *
     *
@ -384,22 +444,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                    return error(-2, errorMessage);
                                }
                                }
                            }
                            }
                            patientService.updatePatient(p, openid);
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                                patientService.updatePatient(p, openid);
                            }
                            }
@ -422,7 +482,7 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setLoginType("1");
                    loginLog.setLoginType("1");
                    loginLogService.saveLog(loginLog);
                    loginLogService.saveLog(loginLog);
                    //判断是否打过标签
                    //判断是否打过标签
                   //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //清空患者的微信标签
                    //清空患者的微信标签
                    weiXinTagUtil.deleteTagWithOpenid(p.getOpenid());
                    weiXinTagUtil.deleteTagWithOpenid(p.getOpenid());
@ -510,22 +570,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                    return error(-2, errorMessage);
                                }
                                }
                            }
                            }
                            patientService.updatePatient(p, openid);
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                                patientService.updatePatient(p, openid);
                            }
                            }

+ 13 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdCheckUserController.java

@ -3,13 +3,17 @@ package com.yihu.wlyy.web.third.ylzpay;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import com.ylzinfo.onepay.sdk.exception.PayException;
import com.ylzinfo.onepay.sdk.exception.PayException;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.io.IOException;
@ -20,9 +24,9 @@ import java.io.IOException;
@RestController
@RestController
@RequestMapping(value = "/check")
@RequestMapping(value = "/check")
@Api(description = "易联众验证相关的服务")
@Api(description = "易联众验证相关的服务")
public class ThirdCheckUserController extends BaseController {
public class ThirdCheckUserController extends WeixinBaseController {
    private static final Logger LOGGER = LoggerFactory.getLogger(ThirdCheckUserController.class);
    private static final Logger LOGGER = LoggerFactory.getLogger("elasticsearch_logger");
    @Autowired
    @Autowired
    ObjectMapper objectMapper;
    ObjectMapper objectMapper;
@ -31,17 +35,18 @@ public class ThirdCheckUserController extends BaseController {
    /**
    /**
     * 验证用户的唯一性
     * 加密URL给前端
     *
     *
     * @throws IOException
     * @throws IOException
     * @throws PayException
     * @throws PayException
     */
     */
    @RequestMapping(value = "/checkUser", method = RequestMethod.POST)
    public String checkUser(String openId) {
    @RequestMapping(value = "/securityURL", method = RequestMethod.POST)
    public String securityURL(
            @ApiParam(name = "code", value = "code", required = true) @RequestParam(value = "code", required = true) String code) {
        try {
        try {
            checkService.getAccessToken(openId);
            return write(200, "获取成功!", "data", "");
            String openId = getOpenId(code);
            String url = checkService.securityURL(openId);
            return write(200, "获取成功!", "data", url);
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return invalidUserException(e, -1, "失败!");
            return invalidUserException(e, -1, "失败!");

+ 5 - 5
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -163,9 +163,9 @@ Riva:
ylz:
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway
    url: http://www.mstpay.com:1300/huangsb

+ 6 - 5
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -165,9 +165,10 @@ Riva:
ylz:
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway
    url: http://www.mstpay.com:1300/huangsb

+ 5 - 5
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -154,9 +154,9 @@ Riva:
ylz:
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway
    url: http://www.mstpay.com:1300/huangsb