diff --git a/cloud-common/cloud-common-core/src/main/java/cn/sh/stc/sict/cloud/common/core/util/WoaUtil.java b/cloud-common/cloud-common-core/src/main/java/cn/sh/stc/sict/cloud/common/core/util/WoaUtil.java index fc5649bc79cdbd43d977e02373671a802a1ea9b0..71432e27540a744ecf207a82d7009b8b6b23406e 100644 --- a/cloud-common/cloud-common-core/src/main/java/cn/sh/stc/sict/cloud/common/core/util/WoaUtil.java +++ b/cloud-common/cloud-common-core/src/main/java/cn/sh/stc/sict/cloud/common/core/util/WoaUtil.java @@ -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) { diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java index 11daa84a82c455a22c2fbc76f78c38decfe3cf86..e8ca6aeb3799b60895c3b6b499bf6950d5765a31 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/HphyPatientBaseController.java @@ -187,4 +187,14 @@ public class HphyPatientBaseController { List 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); + } + } diff --git a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml index a9b3ed9bd83c8ecd486a16420c312e957772aeb3..ace4cabf5e1dd3dff600c1380abfc3b467ca4e83 100644 --- a/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml +++ b/smart-health-modules/theme-schema/src/main/resources/mapper/hpgp/HpgpDepartmentRankMapper.xml @@ -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)