diff --git a/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java b/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java index 2d14e259..3b694772 100644 --- a/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java +++ b/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java @@ -112,23 +112,25 @@ public class AlihealthBusController extends BaseController { } List thirdAliDrugsListGjk = null; + if(alihealthThirdAliDrugInsertReqeust.getGjkSwitch()){ + try { + String response = HttpUtil.get(udiUrl + "/udiwms/aliDrug/getDrugLevelList", map); + BaseResponse> udiDlDeviceResponse = + JSONObject.parseObject(response, new TypeReference>>() { + + }); + if (udiDlDeviceResponse != null + ) { + // 查询国家库是否有值 有值直接返回没值查询阿里接口 + thirdAliDrugsListGjk = udiDlDeviceResponse.getData().getList(); + } + } catch (Exception e) { + log.error("国家库查询阿里产品访问出现错误===" + e.getMessage()); - try { - String response = HttpUtil.get(udiUrl + "/udiwms/aliDrug/getDrugLevelList", map); - BaseResponse> udiDlDeviceResponse = - JSONObject.parseObject(response, new TypeReference>>() { - - }); - if (udiDlDeviceResponse != null - ) { - // 查询国家库是否有值 有值直接返回没值查询阿里接口 - thirdAliDrugsListGjk = udiDlDeviceResponse.getData().getList(); } - } catch (Exception e) { - log.error("国家库查询阿里产品访问出现错误===" + e.getMessage()); - } + if (thirdAliDrugsListGjk != null && thirdAliDrugsListGjk.size() > 0) { return ResultVOUtils.success(thirdAliDrugsListGjk); } else { diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java index a9a377c6..35d34912 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java @@ -100,6 +100,7 @@ public class ThirdAliDrugController extends BaseController { alihealthThirdAliDrugInsertReqeust.setErpId(authAliUser.getErpid()); alihealthThirdAliDrugInsertReqeust.setAppSecret(authAliUser.getAppsecret()); alihealthThirdAliDrugInsertReqeust.setManufactory(thirdAliDrug.getManufacturer()); + alihealthThirdAliDrugInsertReqeust.setGjkSwitch(false); AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc()); alihealthKytDrugrescodeReqeust.setApproval_licence_no(thirdAliDrug.getApprovalNum()); diff --git a/src/main/java/com/glxp/api/req/alihealth/local/AlihealthThirdAliDrugInsertReqeust.java b/src/main/java/com/glxp/api/req/alihealth/local/AlihealthThirdAliDrugInsertReqeust.java index 3e0f00a5..0ceaee2f 100644 --- a/src/main/java/com/glxp/api/req/alihealth/local/AlihealthThirdAliDrugInsertReqeust.java +++ b/src/main/java/com/glxp/api/req/alihealth/local/AlihealthThirdAliDrugInsertReqeust.java @@ -8,6 +8,7 @@ public class AlihealthThirdAliDrugInsertReqeust { private String erpId; private String appSecret; private String manufactory; + private Boolean gjkSwitch = true; private AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust; }