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 a129396d..30b5ddeb 100644 --- a/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java +++ b/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java @@ -105,7 +105,7 @@ public class AlihealthBusController extends BaseController { List thirdAliDrugsListGjk = null; // 本地查询和新增都先注释了 到时候加到这边来 YbDrug ybDrug = alihealthThirdAliDrugInsertReqeust.getYbDrug(); - if(StringUtils.isNotEmpty(ybDrug.getGoodsCode())){ + if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode())){ // 用医保编码查询国家库药品信息 try { CodeRel codeReNew = new CodeRel(); @@ -194,10 +194,10 @@ public class AlihealthBusController extends BaseController { } // 上传多玛关系于处理规则在插入到融合表 - if(StringUtils.isNotEmpty(ybDrug.getGoodsCode()) + if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode()) ){ // 规则匹配 - thirdAliDrugsListGjk = udiContrastService.disposeYbDrugList(thirdAliDrugsListGjk,ybDrug); + thirdAliDrugsListGjk = udiContrastService.disposeYbDrugList(thirdAliDrugsListGjk,ybDrug,alihealthThirdAliDrugInsertReqeust.getNameCodeIn()); if(thirdAliDrugsListGjk!=null && thirdAliDrugsListGjk.size()>0){ List list = new ArrayList<>(); for (ThirdAliDrug thirdAliDrug : thirdAliDrugsListGjk) { 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 35e4e33f..7c981469 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java @@ -93,9 +93,11 @@ public class ThirdAliDrugController extends BaseController { } thirdAliDrug.setNameCodeIn(nameCodeIn); + List list = new ArrayList<>(); + // 不查本地库全查阿里的库 - List list = thirdAliDrugService.filterList(thirdAliDrug); - if(list == null || list.size() == 0){ +// List list = thirdAliDrugService.filterList(thirdAliDrug); +// if(list == null || list.size() == 0){ AuthAliUser authAliUser = authAliUserService.getOne(); AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); @@ -104,7 +106,7 @@ public class ThirdAliDrugController extends BaseController { alihealthThirdAliDrugInsertReqeust.setManufactory(thirdAliDrug.getManufacturer()); alihealthThirdAliDrugInsertReqeust.setBzgg(thirdAliDrug.getBzgg()); alihealthThirdAliDrugInsertReqeust.setFormSpec(thirdAliDrug.getFormSpec()); - + alihealthThirdAliDrugInsertReqeust.setNameCodeIn(nameCodeIn); alihealthThirdAliDrugInsertReqeust.setGjkSwitch(true); AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc()); @@ -144,7 +146,7 @@ public class ThirdAliDrugController extends BaseController { log.error("获取阿里和国家库码段信息出现错误===" + e.getMessage()); } - } +// } PageInfo pageInfo = new PageInfo<>(list); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pageInfo.getTotal()); 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 b5cc639e..affa59df 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 @@ -4,6 +4,8 @@ import com.glxp.api.entity.thrsys.YbDrug; import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust; import lombok.Data; +import java.util.List; + @Data public class AlihealthThirdAliDrugInsertReqeust { private String erpId; @@ -13,6 +15,7 @@ public class AlihealthThirdAliDrugInsertReqeust { private YbDrug ybDrug; private String formSpec; private String bzgg; + private List nameCodeIn; private AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust; } 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 ab1b42c0..0bf3e423 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiContrastService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiContrastService.java @@ -568,17 +568,27 @@ public class UdiContrastService { } } - public List disposeYbDrugList(List thirdAliDrugList,YbDrug ybDrug){ + public List disposeYbDrugList(List thirdAliDrugList,YbDrug ybDrug,List codeIn){ List list1 = new ArrayList<>(); + String result=null; + if(codeIn!=null && codeIn.size() >0){ + result = String.join(", ", codeIn); + + } if(thirdAliDrugList!=null && thirdAliDrugList.size() >0){ // List list2 = new ArrayList<>(); for (ThirdAliDrug thirdAliDrug : thirdAliDrugList) { String str = drugRulesVerify(ybDrug,thirdAliDrug); if(StringUtils.isNotEmpty(str)){ - if(str.equals("1")){ - list1.add(thirdAliDrug); - }else if(str.equals("2")){ - list1.add(thirdAliDrug); + if(str.equals("1") || str.equals("2")){ + if(StringUtils.isNotEmpty(result)){ + if(!result.contains(thirdAliDrug.getNameCode())){ + list1.add(thirdAliDrug); + } + }else { + list1.add(thirdAliDrug); + + } } } }