Commit ed8ac7bf authored by gaozhaochen's avatar gaozhaochen

更新 -> 香山中医院用户接口调用地址

parent cb9461de
......@@ -2,7 +2,7 @@ package cn.sh.stc.sict.cloud.common.core.util;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.convert.Convert;
import cn.sh.stc.sict.cloud.common.core.constant.Constant;
import cn.hutool.json.JSONUtil;
import cn.sh.stc.sict.cloud.common.core.dto.XSZYUserInfo;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
......@@ -22,22 +22,41 @@ import ngari.openapi.Response;
@UtilityClass
public class WoaUtil {
// 香山中医医院公众号用户信息获取接口地址(纳里)
private final static String XSZY_USER_URL = "https://openapi.ngarihealth.com/openapi/gateway";
/**
* 香山中医医院公众号用户信息获取接口地址(纳里)
*/
private final static String WOA_XSZY_URL = "https://openapi.ngarihealth.com";
private final static String WOA_XSZY_GATEWAY_URL = "/openapi/gateway";
/**
* 内网代理请求地址
*/
private final static String WOA_XSZY_PROXY_PASS_URL = "http://30.30.5.74:9988/woa/xszy";
/**
* 获取用户信息请求地址
*/
private final static String WOA_XSZY_USER_INFO_API_URL = WOA_XSZY_PROXY_PASS_URL + WOA_XSZY_GATEWAY_URL;
// 接口授权信息
/**
* 接口授权信息
*/
private final static String APP_KEY = "ngari635f7f4b0e980e63";
private final static String APP_SECRET = "0e980e634196fcde";
// 获取用户信息服务ID
/**
* 获取用户信息服务ID
*/
private final static String SERVICE_ID = "openapi.authenticationService";
// 获取用户信息方法
/**
* 获取用户信息方法
*/
private final static String METHOD = "apiGetUserInfo";
// 响应头请求唯一ID
private final static String RESPONSE_HEADER_REQUEST_ID = "X-Ca-Request-Id";
// 香山中医医院编码
/**
* 响应头请求唯一ID
*/
private final static String RESPONSE_HEADER_REQUEST_ID = "X-Ca-RequestId";
/**
* 香山中医医院编码
*/
private final static String XSZY_HOSPITAL_CODE = "42502905200";
/**
......@@ -50,7 +69,7 @@ public class WoaUtil {
//如果开启加密,则必填
String encodingAesKey = "";
Client client = new Client(XSZY_USER_URL, APP_KEY, APP_SECRET, encodingAesKey);
Client client = new Client(WOA_XSZY_USER_INFO_API_URL, APP_KEY, APP_SECRET, encodingAesKey);
try {
// 入参说明[授权码,是否回调,拓展参数]
......@@ -64,6 +83,7 @@ public class WoaUtil {
return xszyUserInfo;
} else {
log.error("香山中医医院公众号token获取用户信息异常-1,requestId = [{}],caError = [{}],error = [{}]", response.getHeader(RESPONSE_HEADER_REQUEST_ID), response.getCaErrorMsg(), response.getErrorMessage());
log.error(JSONUtil.toJsonStr(response));
return null;
}
} catch (Exception ex) {
......
......@@ -187,4 +187,14 @@ public class HphyPatientBaseController {
List<HpPatientCard> cardList = hpPatientCardService.listByUserId(current.getId());
return new R(cardList);
}
@ApiOperation("第三方公众号进入系统时,获取患者信息")
@GetMapping("/third-party/woa")
public R getwoa(@RequestParam("source") String source,
@RequestParam("token") String token) {
log.error("source = {}, token = {}", source, token);
XSZYUserInfo xszyUserInfo = WoaUtil.getXszyUserInfo(token);
return new R(xszyUserInfo);
}
}
......@@ -22,8 +22,8 @@
dr.rank_score rankScore,
d.one_dept_code oneDeptCode,
d.dept_code subDeptCode
from hpgp_department_rank_1028 dr
join hp_dept_info_copy1 d on (dr.hospital_code = d.hos_org_code and dr.one_dept_code = d.one_dept_code and dr.dept_code = d.dept_code)
from hpgp_department_rank dr
join hp_dept_info d on (dr.hospital_code = d.hos_org_code and dr.one_dept_code = d.one_dept_code and dr.dept_code = d.dept_code)
<where>
<choose>
<when test="hospitalCode != null and hospitalCode != ''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment