Просмотр исходного кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

liuwenbin 7 лет назад
Родитель
Сommit
af460736d7

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -491,7 +491,7 @@
        <dependency>
            <groupId>com.ylz</groupId>
            <artifactId>ehc-empi-java-sdk</artifactId>
            <version>20180522</version>
            <version>20180528</version>
        </dependency>
    </dependencies>
    <build>

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -1756,7 +1756,7 @@ public class PatientInfoService extends BaseService {
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> getPatientSignByNameOrIdCard(String keyWord,String deviceSn,String doctorId,int isManage,int level,String area,int pageNo,int pageSize)throws Exception{
    public List<Map<String,Object>> getPatientSignByNameOrIdCard(String keyWord,String deviceSn,int isManage,int level,String area,int pageNo,int pageSize)throws Exception{
        /* String sql = "SELECT p.code,p.name,CASE p.sex WHEN 1 THEN '男' WHEN 2 THEN '女' END sex,p.idcard,f.doctor_name" +
                " FROM wlyy_patient p  LEFT JOIN wlyy_sign_family f ON p.code = f.patient" +
                " WHERE f.status = 1 AND p.name LIKE '%"+keyWord+"%' OR p.idcard LIKE '%"+keyWord+"%' and f.hospital = '"+hospital+"'"+" limit ?,?";*/

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

@ -1,36 +1,31 @@
package com.yihu.wlyy.service.third.ylz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.third.ylz.model.YLZAccessToken;
import com.yihu.wlyy.service.third.ylz.model.YLZUser;
import com.yihu.wlyy.service.third.ylz.model.YLZUserCard;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.util.IdCardUtil;
import com.ylzinfo.ehc.empi.sdk.EhcEmpiClient;
import com.ylzinfo.ehc.empi.sdk.domain.ResponseParams;
import com.ylzinfo.ehc.empi.sdk.dto.request.AuthorizationTokenRequest;
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
import com.ylzinfo.onepay.sdk.domain.RequestParams;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.exception.PayException;
import com.ylzinfo.onepay.sdk.utils.DateUtil;
import com.ylzinfo.onepay.sdk.utils.SecurityUtil;
import com.ylzinfo.onepay.sdk.utils.Signature;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
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.UserInfoResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2018/5/16 0016.
 */
@Service
public class YLZUserService {
    Logger logger = LoggerFactory.getLogger(YLZUserService.class);
    Logger logger = LoggerFactory.getLogger("elasticsearch_logger");
    //网关地址
    @Value("${ylz.gateway.url}")
    private String gatewayURL;
@ -43,33 +38,46 @@ public class YLZUserService {
    @Value("${ylz.appId}")
    private String appId;
    @Value("${ylz.termId}")
    private String termId;
    private String termId = "01";
    @Value("${ylz.appSecret}")
    private String appSecret;
    @Value("${ylz.redirectUrl}")
    private String redirectUrl;
    @Value("${server.server_url}")
    private String server_url;
    @Autowired
    private SocialSecurityInfoDao socialSecurityInfoDao;
    private String signType = "MD5";
    private String encryptType = "AES";
    private String responseType = "token";
    @Autowired
    private HttpClientUtil httpClientUtil;
    private final String responseType = "token";
    private final String version = "1.0";
    public String getAccessToken() {
    public AuthorizationTokenResponse getAccessToken(String openId) {
        try {
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, "1.0", signType, encryptType);
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            try {
                AuthorizationTokenRequest params = new AuthorizationTokenRequest();
                params.setRedirectUrl(redirectUrl);
                params.setUserName("48");
                String url = empiClient.createUrl("gatewayPage", empiUimcAuthorization, params);
                String responseStr = httpClientUtil.get(url, "UTF-8");
                net.sf.json.JSONObject responseJSON = net.sf.json.JSONObject.fromObject(responseStr);
                Map params = new HashMap();
                params.put("response_type", responseType);
                params.put("redirect_url", redirectUrl);
                params.put("auth_type", "IXM");
                params.put("domain_cust_id", "openId");
                logger.info(net.sf.json.JSONObject.fromObject(params).toString());
                //params 为自行解析回调参数。 key值参考文档
                ResponseParams<AuthorizationTokenResponse> response = empiClient.checkResponseParams(params, AuthorizationTokenResponse.class);
                if (empiClient.isSuccessful(response)) {
                    AuthorizationTokenResponse authorizationTokenResponse = response.getBizContent();
                    logger.info(net.sf.json.JSONObject.fromObject(authorizationTokenResponse).toString());
                    return authorizationTokenResponse;
                } else {
                    logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -80,61 +88,28 @@ public class YLZUserService {
        return null;
    }
    private String initParams(RequestParams requestParams) throws PayException {
        String sign = Signature.createSign(requestParams, this.appSecret);
        requestParams.setSign(sign);
        String requestMessage;
        try {
            logger.info("加密前报文:" + JSONObject.toJSONString(requestParams));
            requestMessage = SecurityUtil.encrypt(JSONObject.toJSONString(requestParams.getParam()), this.encryptType, this.appSecret, this.appId);
            logger.info("加密后报文:" + requestMessage);
            requestParams.setEncryptData(requestMessage);
        } catch (Exception var11) {
            throw new PayException("请求报文加密失败");
        }
        requestParams.setParam((Object) null);
        requestMessage = JSON.toJSONString(requestParams);
        System.out.println("请求参数报文:" + requestMessage);
        return requestMessage;
    }
    /**
     * 此方式仅应用到注册回调
     */
    public YLZUser getUserByToken(String token) {
    public UserInfoResponse getUserByToken(String token) {
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        try {
            String result = null;
            OnepayDefaultClient onepayClient = new OnepayDefaultClient(
                    empiUimcQuery,
                    appId,
                    appSecret, signType, encryptType);
            RequestParams requestParams = new RequestParams();
            requestParams.setAppId(appId);
            requestParams.setTimestamp(DateUtil.getCurrentDateTime());
            requestParams.setSignType(signType);
            requestParams.setEncryptType(encryptType);
            //业务参数
            JSONObject params = new JSONObject();
            params.put("token", token);  //注册回调的token
            requestParams.setParam(params);
            logger.info("requestParams:" + requestParams.toString());
            ResponseParams<JSONObject> res = onepayClient.execute(requestParams);
            if (OnepayDefaultClient.isSuccessful(res)) {
                result = JSON.toJSONString(res.getParam());
                logger.info("易联众返回结果:" + result);
//             新增保存数据
                JSONObject userJson = JSON.parseObject(result).getJSONObject("biz_content");
                YLZUser user = getYLZUser(userJson);
                YLZUserCard userCard = getYLZUserCard(userJson.getJSONArray("card_info"));
                user.setYlzUserCard(userCard);
                return user;
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            UserInfoRequest params = new UserInfoRequest();
            params.setAccessToken(token);
            logger.info(net.sf.json.JSONObject.fromObject(params).toString());
            ResponseParams<UserInfoResponse> response = empiClient.queryUserInfo(params);
            if (empiClient.isSuccessful(response)) {
                UserInfoResponse userInfoResponse = response.getBizContent();
                logger.info(net.sf.json.JSONObject.fromObject(userInfoResponse).toString());
                return userInfoResponse;
            } else {
                logger.error("调用易联众接口失败:" + res.toString());
                logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
            }
            return null;
        } catch (Exception e) {
@ -143,26 +118,75 @@ public class YLZUserService {
        }
    }
    private YLZUserCard getYLZUserCard(JSONArray card_infos) {
        YLZUserCard ylzUserCard = null;
        for (int i = 0; i < card_infos.size(); i++) {
            JSONObject jo = card_infos.getJSONObject(i);
            if ("normal ".equals(jo.getString("state"))) {
                ylzUserCard = JSON.parseObject(jo.toJSONString(), YLZUserCard.class);
                break;
    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(server_url + redirectUrl);
                params.setAuthType("IXM");
                params.setDomainCustId(openId);
                params.setResponseType(responseType);
                url = empiClient.createUrl("gatewayPage", "empi.uimc.authorization", params);
                logger.info(url);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ylzUserCard;
        return url;
    }
    private YLZUser getYLZUser(JSONObject userJson) {
        YLZUser ylzUserCard = JSON.parseObject(userJson.toJSONString(), YLZUser.class);
        return ylzUserCard;
    @Transactional
    public  Map<String, String> synchronousBSInfo(String params) {
        logger.info(params);
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        try {
            //获取get params 入参 转换 并解密验签
            ResponseParams<AuthorizationTokenResponse> response = empiClient.checkURLResponseParams(params, AuthorizationTokenResponse.class);
            UserInfoResponse userInfoResponse = getUserByToken(response.getBizContent().getAccessToken());
            List<UserInfoResponse.CardInfo> cards = userInfoResponse.getCardInfo();
            UserInfoResponse.CardInfo ssc = null;
            for (UserInfoResponse.CardInfo card : cards) {
                //如果患者有正常状态的社保卡
                if ("01".equals(card.getCardType()) && "normal".equals(card.getState().toLowerCase())) {
                    ssc = card;
                    break;
                }
            }
            //同步社保卡号
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(userInfoResponse.getIdNo());
            //如果我们表没有记录那就新增一条记录
            if(socialSecurityInfo==null){
                socialSecurityInfo=new SocialSecurityInfo();
                socialSecurityInfo.setXming0(userInfoResponse.getName());
                socialSecurityInfo.setXbie00(IdCardUtil.getSexForIdcard(userInfoResponse.getIdNo()));
                socialSecurityInfo.setCsrqi0(IdCardUtil.getBirthdayForIdcardStr(userInfoResponse.getIdNo()));
                socialSecurityInfo.setSfzh18(userInfoResponse.getIdNo());
                socialSecurityInfo.setGrsfen("8");
                socialSecurityInfo.setId0000(userInfoResponse.getIdNo());
                socialSecurityInfo.setGzztai("01");
                socialSecurityInfo.setCardno(ssc.getCardNo());
                socialSecurityInfo.setCard16(userInfoResponse.getIdNo().substring(0,16));
                socialSecurityInfoDao.save(socialSecurityInfo);
            }
            //如果医保卡不一致更新{
            if(!socialSecurityInfo.getCardno().equals(ssc.getCardNo())){
                socialSecurityInfo.setCardno(ssc.getCardNo());
            }
            Map<String, String> checkReturnModel=new HashMap<>();
            checkReturnModel.put("name",userInfoResponse.getName());
            checkReturnModel.put("mobile",userInfoResponse.getTelephone());
            checkReturnModel.put("idCard",userInfoResponse.getIdNo());
            checkReturnModel.put("ssc",ssc.getCardNo());
            return checkReturnModel;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public static void main(String[] args) {
        String str = "{\"card_no\":\"111111\"}";
        YLZUserCard ylzUserCard = JSON.parseObject(str, YLZUserCard.class);
        System.out.println(ylzUserCard);
    }
}

+ 0 - 64
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/model/YLZAccessToken.java

@ -1,64 +0,0 @@
package com.yihu.wlyy.service.third.ylz.model;
import java.util.Date;
/**
 * Created by chenweida on 2018/5/16 0016.
 */
public class YLZAccessToken {
    private String accessToken; //授权token	String(32)
    private String tokenType;
    private Integer expiresIn;// token过期时间  3600 秒
    private Date createTime;// token过期时间  3600 秒
    private String state;
    public String getAccessToken() {
        return accessToken;
    }
    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }
    public String getTokenType() {
        return tokenType;
    }
    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }
    public Integer getExpiresIn() {
        return expiresIn;
    }
    public void setExpiresIn(Integer expiresIn) {
        this.expiresIn = expiresIn;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public boolean isNotOutTime() {
        long interval = (new Date().getTime() - this.getCreateTime().getTime()) / 1000;
        if (interval > (expiresIn - 120)) {
            return false;
        } else {
            return true;
        }
    }
}

+ 0 - 126
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/model/YLZRequestParams.java

@ -1,126 +0,0 @@
//package com.yihu.wlyy.service.third.ylz.model;
//
//import com.alibaba.fastjson.annotation.JSONField;
//import net.sf.json.JSONObject;
//
///**
// * Created by chenweida on 2018/5/22 0022.
// */
//public class YLZRequestParams {
//    @JSONField(name = "timestamp")
//    private String timestamp;
//    @JSONField(name = "sign")
//    private String sign;
//    @JSONField(name = "biz_content")
//    private String bizContent;
//    @JSONField(name = "enc_type")
//    private String signType = "MD5";
//    @JSONField(name = "term_id")
//    private String termId;
//    @JSONField(name = "method")
//    private String method;
//    @JSONField(name = "app_id")
//    private String appId;
//    @JSONField(name = "version")
//    private String version = "1.0";
//    @JSONField(name = "sign_type")
//    private String encType = "AES";
//
//
//    public String getTimestamp() {
//        return timestamp;
//    }
//
//    public void setTimestamp(String timestamp) {
//        this.timestamp = timestamp;
//    }
//
//    public String getSign() {
//        return sign;
//    }
//
//    public void setSign(String sign) {
//        this.sign = sign;
//    }
//
//    public String getBizContent() {
//        return bizContent;
//    }
//
//    public void setBizContent(String bizContent) {
//        this.bizContent = bizContent;
//    }
//
//    public String getSignType() {
//        return signType;
//    }
//
//    public void setSignType(String signType) {
//        this.signType = signType;
//    }
//
//    public String getTermId() {
//        return termId;
//    }
//
//    public void setTermId(String termId) {
//        this.termId = termId;
//    }
//
//    public String getMethod() {
//        return method;
//    }
//
//    public void setMethod(String method) {
//        this.method = method;
//    }
//
//    public String getAppId() {
//        return appId;
//    }
//
//    public void setAppId(String appId) {
//        this.appId = appId;
//    }
//
//    public String getVersion() {
//        return version;
//    }
//
//    public void setVersion(String version) {
//        this.version = version;
//    }
//
//    public String getEncType() {
//        return encType;
//    }
//
//    public void setEncType(String encType) {
//        this.encType = encType;
//    }
//
//    /**
//     * 1. 筛选
//     获取所有请求参数,不包括字节类型参数,如文件、字节流,剔除sign字段。
//     (app_id.、term_id、method、version、timestamp、sign_type、enc_type、)
//     2. 排序
//     将筛选的参数按照第一个字符的键值ASCII码递增排序(字母升序排序),如果遇到相同字符则按照第二个字符的键值ASCII码递增排序,以此类推。
//
//     3. 拼接
//     将排序后的参数与其对应值,组合成“参数=参数值”的格式,并且把这些参数用&字符连接起来,最后拼接上应用密钥在“…参数=参数值key=你的密钥”,此时生成的字符串为待签名字符串,将待签名字符串MD5运算,即是签名(sign)的值。
//     * @return
//     */
//    public String initSign(){
//        JSONObject jo=new JSONObject();
//        jo.put("app_id",this.appId);
//        jo.put("enc_type",this.encType);
//        jo.put("method",this.method);
//        jo.put("sign_type",this.signType);
//        jo.put("term_id",this.termId);
//        jo.put("timestamp",this.timestamp);
//        jo.put("version",this.version);
//
//        StringBuffer sb=new StringBuffer();
//        sb.append("app_id="+this.appId);
//    }
//}

+ 0 - 360
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/model/YLZUser.java

@ -1,360 +0,0 @@
package com.yihu.wlyy.service.third.ylz.model;
import com.alibaba.fastjson.annotation.JSONField;
/**
 * Created by chenweida on 2018/5/16 0016.
 */
public class YLZUser {
    @JSONField(name = "empi_user_id")
    private String empiUserId;//用户主索引
    @JSONField(name = "name")
    private String name;//姓名
    @JSONField(name = "sex")
    private String sex;//性别  0未知性别 1男 2女 9未说明性别
    @JSONField(name = "birth_day")
    private String birthDay;//出生日期  yyyyMMddHH
    @JSONField(name = "birth_addr")
    private String birthAddr;//出生地
    @JSONField(name = "id_type")
    private String idType;//证件类型   01	居民身份证 02	居民户口簿 03	护照  04	军官证   05	驾驶证   06	港澳居民来往内地通行证   07	台湾居民来往内地通行证   99	其他法定有效证件
    @JSONField(name = "id_no")
    private String idNo;//证件号码
    @JSONField(name = "native")
    private String native_;//国籍
    @JSONField(name = "address")
    private String address;//所在地, 通讯地址
    @JSONField(name = "origin")
    private String origin;//籍贯
    @JSONField(name = "company")
    private String company;//作单位
    @JSONField(name = "company_phone")
    private String companyPhone;//单位电话
    @JSONField(name = "contacts_relationship")
    private String contactsRelationship;//与联系人关系 参考国家互联互通标准GB/T 4761-2008
    @JSONField(name = "contacts_phone")
    private String contactsPhone;//联系人电话
    @JSONField(name = "contacts_addr")
    private String contactsAddr;//联系人地址
    @JSONField(name = "is_certified")
    private String isCertified;//安全认证  0否,1 是
    @JSONField(name = "certificate_authority")
    private String certificateAuthority;//认证机构  1经信局 2公安 等
    @JSONField(name = "telephone")
    private String telephone;//联系方式
    @JSONField(name = "email")
    private String email;//邮箱地址
    @JSONField(name = "post")
    private String post;//邮编
    @JSONField(name = "work")
    private String work;//职业
    @JSONField(name = "home_phone")
    private String homePhone;//家庭电话
    @JSONField(name = "avatar_photo_id")
    private String avatarPhotoId;//照片
    @JSONField(name = "marital_status")
    private String maritalStatus;//婚姻状态  10未婚 20已婚  21初婚 22再婚 23复婚  30丧偶 40离婚 90未说明的婚姻状况
    @JSONField(name = "state")
    private String state;//状态  normal 正常 freeze 冻结  logout 注销   lossed 挂失
    @JSONField(name = "domain_id")
    private String domainId;//标识域编码
    @JSONField(name = "domain_name")
    private String domainName;//标识域名称
    @JSONField(name = "term_id")
    private String termId;//终端号
    @JSONField(name = "oper_id")
    private String operId;//操作员编号
    @JSONField(name = "oper_name")
    private String operName;//操作员姓名
    @JSONField(name = "crt_date")
    private String crtDate;//创建日期
    @JSONField(name = "crt_time")
    private String crtTime;//创建时间
    @JSONField(name = "nation")
    private String nation;//民族
    @JSONField(name = "contacts_name")
    private String contactsName;//联系人姓名
    private YLZUserCard ylzUserCard;
    public String getEmpiUserId() {
        return empiUserId;
    }
    public void setEmpiUserId(String empiUserId) {
        this.empiUserId = empiUserId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getBirthDay() {
        return birthDay;
    }
    public void setBirthDay(String birthDay) {
        this.birthDay = birthDay;
    }
    public String getBirthAddr() {
        return birthAddr;
    }
    public void setBirthAddr(String birthAddr) {
        this.birthAddr = birthAddr;
    }
    public String getIdType() {
        return idType;
    }
    public void setIdType(String idType) {
        this.idType = idType;
    }
    public String getIdNo() {
        return idNo;
    }
    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }
    public String getNative_() {
        return native_;
    }
    public void setNative_(String native_) {
        this.native_ = native_;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getOrigin() {
        return origin;
    }
    public void setOrigin(String origin) {
        this.origin = origin;
    }
    public String getCompany() {
        return company;
    }
    public void setCompany(String company) {
        this.company = company;
    }
    public String getCompanyPhone() {
        return companyPhone;
    }
    public void setCompanyPhone(String companyPhone) {
        this.companyPhone = companyPhone;
    }
    public String getContactsRelationship() {
        return contactsRelationship;
    }
    public void setContactsRelationship(String contactsRelationship) {
        this.contactsRelationship = contactsRelationship;
    }
    public String getContactsPhone() {
        return contactsPhone;
    }
    public void setContactsPhone(String contactsPhone) {
        this.contactsPhone = contactsPhone;
    }
    public String getContactsAddr() {
        return contactsAddr;
    }
    public void setContactsAddr(String contactsAddr) {
        this.contactsAddr = contactsAddr;
    }
    public String getIsCertified() {
        return isCertified;
    }
    public void setIsCertified(String isCertified) {
        this.isCertified = isCertified;
    }
    public String getCertificateAuthority() {
        return certificateAuthority;
    }
    public void setCertificateAuthority(String certificateAuthority) {
        this.certificateAuthority = certificateAuthority;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getPost() {
        return post;
    }
    public void setPost(String post) {
        this.post = post;
    }
    public String getWork() {
        return work;
    }
    public void setWork(String work) {
        this.work = work;
    }
    public String getHomePhone() {
        return homePhone;
    }
    public void setHomePhone(String homePhone) {
        this.homePhone = homePhone;
    }
    public String getAvatarPhotoId() {
        return avatarPhotoId;
    }
    public void setAvatarPhotoId(String avatarPhotoId) {
        this.avatarPhotoId = avatarPhotoId;
    }
    public String getMaritalStatus() {
        return maritalStatus;
    }
    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getDomainId() {
        return domainId;
    }
    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }
    public String getDomainName() {
        return domainName;
    }
    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }
    public String getTermId() {
        return termId;
    }
    public void setTermId(String termId) {
        this.termId = termId;
    }
    public String getOperId() {
        return operId;
    }
    public void setOperId(String operId) {
        this.operId = operId;
    }
    public String getOperName() {
        return operName;
    }
    public void setOperName(String operName) {
        this.operName = operName;
    }
    public String getCrtDate() {
        return crtDate;
    }
    public void setCrtDate(String crtDate) {
        this.crtDate = crtDate;
    }
    public String getCrtTime() {
        return crtTime;
    }
    public void setCrtTime(String crtTime) {
        this.crtTime = crtTime;
    }
    public String getNation() {
        return nation;
    }
    public void setNation(String nation) {
        this.nation = nation;
    }
    public String getContactsName() {
        return contactsName;
    }
    public void setContactsName(String contactsName) {
        this.contactsName = contactsName;
    }
    public YLZUserCard getYlzUserCard() {
        return ylzUserCard;
    }
    public void setYlzUserCard(YLZUserCard ylzUserCard) {
        this.ylzUserCard = ylzUserCard;
    }
}

+ 0 - 137
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/model/YLZUserCard.java

@ -1,137 +0,0 @@
package com.yihu.wlyy.service.third.ylz.model;
import com.alibaba.fastjson.annotation.JSONField;
/**
 * Created by chenweida on 2018/5/16 0016.
 */
public class YLZUserCard {
    @JSONField(name = "card_no")
    private String cardNo;//卡号
    @JSONField(name = "card_type")
    private String cardType;//卡类型 01社保卡  02就诊卡
    @JSONField(name = "card_org")
    private String cardOrg;//办卡机构
    @JSONField(name = "card_zone")
    private String cardZone;//办卡地区
    @JSONField(name = "card_fn")
    private String cardFn;//卡内码
    @JSONField(name = "term_id")
    private String termId;//	终端号
    @JSONField(name = "oper_id")
    private String operId;//	操作员编号
    @JSONField(name = "oper_name")
    private String operName;//操作员姓名
    @JSONField(name = "crt_date")
    private String crtDate;//创建日期
    @JSONField(name = "crt_time")
    private String crtTime;//创建时间
    @JSONField(name = "state")
    private String state; //状态  normal 正常 freeze 冻结  logout 注销  lossed 挂失 
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getCardOrg() {
        return cardOrg;
    }
    public void setCardOrg(String cardOrg) {
        this.cardOrg = cardOrg;
    }
    public String getCardZone() {
        return cardZone;
    }
    public void setCardZone(String cardZone) {
        this.cardZone = cardZone;
    }
    public String getCardFn() {
        return cardFn;
    }
    public void setCardFn(String cardFn) {
        this.cardFn = cardFn;
    }
    public String getTermId() {
        return termId;
    }
    public void setTermId(String termId) {
        this.termId = termId;
    }
    public String getOperId() {
        return operId;
    }
    public void setOperId(String operId) {
        this.operId = operId;
    }
    public String getOperName() {
        return operName;
    }
    public void setOperName(String operName) {
        this.operName = operName;
    }
    public String getCrtDate() {
        return crtDate;
    }
    public void setCrtDate(String crtDate) {
        this.crtDate = crtDate;
    }
    public String getCrtTime() {
        return crtTime;
    }
    public void setCrtTime(String crtTime) {
        this.crtTime = crtTime;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    @Override
    public String toString() {
        return "YLZUserCard{" +
                "cardNo='" + cardNo + '\'' +
                ", cardType='" + cardType + '\'' +
                ", cardOrg='" + cardOrg + '\'' +
                ", cardZone='" + cardZone + '\'' +
                ", cardFn='" + cardFn + '\'' +
                ", termId='" + termId + '\'' +
                ", operId='" + operId + '\'' +
                ", operName='" + operName + '\'' +
                ", crtDate='" + crtDate + '\'' +
                ", crtTime='" + crtTime + '\'' +
                ", state='" + state + '\'' +
                '}';
    }
}

+ 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;
    }
    /**
     * 身份证提取出身日期
     *
     * @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未知

+ 98 - 39
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.TokenService;
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.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.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinTagUtil;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
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.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.*;
@ -73,6 +73,8 @@ public class WechatController extends WeixinBaseController {
    private WeiXinTagUtil weiXinTagUtil;
    @Autowired
    private RSAUtils rsaUtils;
    @Autowired
    private YLZUserService ylzUserService;
    /**
@ -132,7 +134,7 @@ public class WechatController extends WeixinBaseController {
            // 解密身份证号
            //idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            rsaUtils.setBaseService(patientService);
            idcard =rsaUtils.decryptString(idcard);
            idcard = rsaUtils.decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = StringUtils.reverse(idcard);
@ -188,7 +190,7 @@ public class WechatController extends WeixinBaseController {
    @ResponseBody
    public String regist(@RequestParam(value = "name", required = true) String name,
                         @RequestParam(value = "idcard", required = true) String idcard,
                         @RequestParam(value = "ssc", required = false) String ssc,
                         @RequestParam(value = "ssc", required = true) String ssc,
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "openid", required = true) String openid,
@ -200,9 +202,9 @@ public class WechatController extends WeixinBaseController {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "身份证号不允许为空!");
            }
//            if (StringUtils.isEmpty(ssc)) {
//                return error(-1, "社保卡号不允许为空!");
//            }
            if (StringUtils.isEmpty(ssc)) {
                return error(-1, "社保卡号不允许为空!");
            }
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空!");
            }
@ -240,24 +242,80 @@ public class WechatController extends WeixinBaseController {
            } else {
                return error(-1, "请输入正确的身份证号!");
            }
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            //==========================同步易联众的医保卡号=============================
            //判断此人有没有厦门社保卡 没有补给注册
            //判断身份证号与姓名是否一致
            //判断身份证和社保卡是否一致  统一只存英文字母开头的医保卡
//            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 (socialSecurityInfo != null) {
//                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
//                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
//                }
//                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
//                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
//                    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 = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
//                        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);
//                    }
//
//
//                }
//            } else {
//                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
//
//            }
            //==============================旧版验证=========================
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            if (socialSecurityInfo != null) {
                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
                }
                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
                    } else {
                        ssc = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
                    }
                }
            } else {
                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
            }
            //==========================旧版验证=============================
            Patient patient = patientDao.findByIdcard(idcard);
            if (patient == null) {
@ -278,7 +336,7 @@ public class WechatController extends WeixinBaseController {
            password = StringUtils.reverse(password);
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setSsc(ssc);
            if(!"undefined".equals(openid)&&StringUtils.isNotBlank(openid)){
            if (!"undefined".equals(openid) && StringUtils.isNotBlank(openid)) {
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }
@ -287,7 +345,7 @@ public class WechatController extends WeixinBaseController {
//                patient.setOpenidTime(new Date());
//            }
            JSONObject json = patientService.register(idcard, ssc, name, mobile, MD5.GetMD5Code(password + salt)
                    ,salt,openid,3);
                    , salt, openid, 3);
            if (json != null) {
                try {
                    Patient p = patientDao.findByIdcard(idcard);
@ -307,6 +365,7 @@ public class WechatController extends WeixinBaseController {
        }
    }
    /**
     * 患者微信登录接口
     *
@ -384,22 +443,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                }
                            }
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                            }
@ -422,7 +481,7 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setLoginType("1");
                    loginLogService.saveLog(loginLog);
                    //判断是否打过标签
                   //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //清空患者的微信标签
                    weiXinTagUtil.deleteTagWithOpenid(p.getOpenid());
@ -510,22 +569,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                }
                            }
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                            }

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -528,11 +528,11 @@ public class PatientInfoController extends BaseController {
    @RequestMapping(value = "/getPatientSignByNameOrIdCard",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("在绑定设备的时候查找患者(带签约信息)")
    public String getPatientSignByNameOrIdCard(@ApiParam(value = "关键搜索词", name = "keyWord") @RequestParam(value = "keyWord",required = true)String keyWord,
    public String getPatientSignByNameOrIdCard(@ApiParam(value = "关键搜索词", name = "keyWord") @RequestParam(value = "keyWord",required = true,defaultValue = "")String keyWord,
                                                @ApiParam(value = "设备sn码", name = "deviceSn") @RequestParam(value = "deviceSn",required = true)String deviceSn,
                                                @ApiParam(value = "是否为管理员登录(0不是1是)", name = "isManage") @RequestParam(value = "isManage",required = true)String isManage,
                                                @ApiParam(value = "管理员地区权限level(3区  2社区)", name = "level") @RequestParam(value = "level",required = true)String level,
                                                @ApiParam(value = "管理员地区code", name = "area") @RequestParam(value = "area",required = false)String area,
                                                @ApiParam(value = "管理员地区权限level(3区  2社区)", name = "level") @RequestParam(value = "level",required = false,defaultValue = "0")String level,
                                                @ApiParam(value = "管理员地区code", name = "area") @RequestParam(value = "area",required = true)String area,
                                                @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                                @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
@ -542,7 +542,7 @@ public class PatientInfoController extends BaseController {
            page = "1";
        }
        try {
            return  write(200,"查找成功!","data",patientInfoService.getPatientSignByNameOrIdCard(keyWord,deviceSn,getUID(),Integer.valueOf(isManage),Integer.valueOf(level),area,Integer.valueOf(page),Integer.valueOf(pageSize)));
            return  write(200,"查找成功!","data",patientInfoService.getPatientSignByNameOrIdCard(keyWord,deviceSn,Integer.valueOf(isManage),Integer.valueOf(level),area,Integer.valueOf(page),Integer.valueOf(pageSize)));
        } catch (Exception e) {
            error(e);
            return error( -1, "查询失败!");

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

@ -3,16 +3,25 @@ package com.yihu.wlyy.web.third.ylzpay;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import com.ylzinfo.onepay.sdk.exception.PayException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
 *
@ -20,9 +29,9 @@ import java.io.IOException;
@RestController
@RequestMapping(value = "/check")
@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
    ObjectMapper objectMapper;
@ -31,21 +40,37 @@ public class ThirdCheckUserController extends BaseController {
    /**
     * 验证用户的唯一性
     * 加密URL给前端
     *
     * @throws IOException
     * @throws PayException
     */
    @RequestMapping(value = "/checkUser", method = RequestMethod.POST)
    public String checkUser(String mediaIds) {
    @RequestMapping(value = "/securityURL", method = RequestMethod.POST)
    public String securityURL(
            @ApiParam(name = "openId", value = "openId", required = true) @RequestParam(value = "openId", required = true) String openId) {
        try {
            checkService.getAccessToken();
            return write(200, "获取成功!", "data", "");
            String url = checkService.securityURL(openId);
            return write(200, "获取成功!", "data", url);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "失败!");
        }
    }
    /**
     * 根据易联众返回的tokan 同步sb_info表
     *
     * @return
     */
    @RequestMapping(value = "/synchronousBSInfo", method = RequestMethod.POST)
    public String synchronousBSInfo(
            @ApiParam(name = "params", value = "params", required = true) @RequestParam(value = "params", required = true) String params) {
        try {
            Map<String, String> userInfoResponse = checkService.synchronousBSInfo(params);
            return write(200, "获取成功!", "data", userInfoResponse);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "失败!");
        }
    }
}

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

@ -163,9 +163,9 @@ Riva:
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  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

@ -167,9 +167,10 @@ Riva:
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  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

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