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 35d34912..ee85c975 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java @@ -84,58 +84,62 @@ public class ThirdAliDrugController extends BaseController { filterUdiRelRequest.setUuid(thirdAliDrug.getUuid()); List udiInfoEntities = udiProductService.filterAllUdiInfo(filterUdiRelRequest); List nameCodeIn = new ArrayList<>(); - if(udiInfoEntities!=null && udiInfoEntities.size() >0){ + if (udiInfoEntities != null && udiInfoEntities.size() > 0) { for (UdiProductEntity udiInfoEntity : udiInfoEntities) { - if(StringUtils.isNotEmpty(udiInfoEntity.getNameCode())){ + if (StringUtils.isNotEmpty(udiInfoEntity.getNameCode())) { nameCodeIn.add(udiInfoEntity.getNameCode()); } } } thirdAliDrug.setNameCodeIn(nameCodeIn); + // 不查本地库全查阿里的库 List list = thirdAliDrugService.filterList(thirdAliDrug); if(list == null || list.size() == 0){ - AuthAliUser authAliUser = authAliUserService.getOne(); - AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); - 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()); - alihealthKytDrugrescodeReqeust.setPage_size(100); - alihealthKytDrugrescodeReqeust.setPage(1); - alihealthKytDrugrescodeReqeust.setApp_key(authAliUser.getAppkey()); - alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid()); - alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); - try { - BaseResponse baseResponse = alihealthBusController.thirdAliDrugList(alihealthThirdAliDrugInsertReqeust); - if (baseResponse.getCode() == 20000) { - - - if (thirdAliDrugService.addOrUpdate((List) baseResponse.getData())) { - list = thirdAliDrugService.filterList(thirdAliDrug); - - } else { - log.info("供应商平台获取阿里和国家库码段信息===未查到产品信息"); - - } + AuthAliUser authAliUser = authAliUserService.getOne(); + AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); + 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()); + alihealthKytDrugrescodeReqeust.setPackage_spec(thirdAliDrug.getBzgg()); + alihealthKytDrugrescodeReqeust.setPrepn_spec(thirdAliDrug.getFormSpec()); + + alihealthKytDrugrescodeReqeust.setPage_size(200); + alihealthKytDrugrescodeReqeust.setPage(1); + alihealthKytDrugrescodeReqeust.setApp_key(authAliUser.getAppkey()); + alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid()); + alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); + try { + BaseResponse baseResponse = alihealthBusController.thirdAliDrugList(alihealthThirdAliDrugInsertReqeust); + if (baseResponse.getCode() == 20000) { + + + if (thirdAliDrugService.addOrUpdate((List) baseResponse.getData())) { + list = thirdAliDrugService.filterList(thirdAliDrug); } else { - log.info("供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage()); + log.info("供应商平台获取阿里和国家库码段信息===未查到产品信息"); + + } + + + } else { + log.info("供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage()); // udiProductEntity.setBasicPrductRemak8("供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage()); // error = "供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage(); - } + } - } catch (Exception e) { - e.printStackTrace(); - log.info("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage()); + } catch (Exception e) { + log.info("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage()); - } + } } PageInfo pageInfo = new PageInfo<>(list); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); diff --git a/src/main/java/com/glxp/api/service/basic/UdiContrastService.java b/src/main/java/com/glxp/api/service/basic/UdiContrastService.java index 3cb87d45..83516169 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiContrastService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiContrastService.java @@ -376,7 +376,7 @@ public class UdiContrastService { AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); alihealthKytDrugrescodeReqeust.setPhysic_name(udiProductEntity.getCpmctymc()); alihealthKytDrugrescodeReqeust.setApproval_licence_no(udiProductEntity.getZczbhhzbapzbh()); - alihealthKytDrugrescodeReqeust.setPage_size(100); + alihealthKytDrugrescodeReqeust.setPage_size(200); alihealthKytDrugrescodeReqeust.setPage(1); alihealthKytDrugrescodeReqeust.setApp_key(authAliUser.getAppkey()); alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid()); diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java index c8bcb848..445c46f2 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java @@ -640,6 +640,8 @@ public class UdiProductServiceImpl implements UdiProductService { .like(StringUtils.isNotBlank( thirdAliDrugRequest.getCpmctymc()),"cpmctymc", thirdAliDrugRequest.getCpmctymc()) .like(StringUtils.isNotBlank( thirdAliDrugRequest.getManufacturer()),"manufacturer", thirdAliDrugRequest.getManufacturer()) .eq(StringUtils.isNotBlank( thirdAliDrugRequest.getApprovalNum()),"approvalNum", thirdAliDrugRequest.getApprovalNum()) + .like(StringUtils.isNotBlank( thirdAliDrugRequest.getFormSpec()),"formSpec", thirdAliDrugRequest.getFormSpec()) + .like(StringUtils.isNotBlank( thirdAliDrugRequest.getBzgg()),"bzgg", thirdAliDrugRequest.getBzgg()) ); if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) { diff --git a/src/main/resources/mybatis/mapper/thrsys/ThirdAliDrugMapper.xml b/src/main/resources/mybatis/mapper/thrsys/ThirdAliDrugMapper.xml index 691b68b7..076b3282 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThirdAliDrugMapper.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThirdAliDrugMapper.xml @@ -91,9 +91,15 @@ #{id} + + AND formSpec LIKE concat('%', #{formSpec}, '%') + AND manufacturer LIKE concat('%', #{manufacturer}, '%') + + AND bzgg LIKE concat('%', #{bzgg}, '%') + order by cpmctymc,approvalNum,packRatio,packLevel