选入模糊查询问题

v3
qiuyt 3 months ago
parent c9c0eb5e9c
commit 9e592f44cf

@ -65,7 +65,7 @@ public class ThirdAliDrugController {
// 剔除当前选入的产品编码要给他删了再重新查一次判断 如果还是查不到就去查阿里 // 剔除当前选入的产品编码要给他删了再重新查一次判断 如果还是查不到就去查阿里
thirdAliDrug.setNameCodeIn(null); thirdAliDrug.setNameCodeIn(null);
List<ThirdAliDrug> listNew = thirdAliDrugService.filterList(thirdAliDrug); List<ThirdAliDrug> listNew = thirdAliDrugService.filterList(thirdAliDrug);
if (CollUtil.isEmpty(listNew)){ if (CollUtil.isEmpty(listNew)) {
ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest(); ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest();
AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust(); AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust();
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
@ -78,13 +78,13 @@ public class ThirdAliDrugController {
request.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); request.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
try { try {
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(request); BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(request);
if(baseResponse.getCode() == 20000){ if (baseResponse.getCode() == 20000) {
list = baseResponse.getData(); list = baseResponse.getData();
}else { } else {
log.error("阿里访问失败==="+baseResponse.getMessage()); log.error("阿里访问失败===" + baseResponse.getMessage());
} }
}catch (Exception e){ } catch (Exception e) {
log.error("阿里访问失败==="+e.getMessage()); log.error("阿里访问失败===" + e.getMessage());
} }
List<ThirdAliDrug> finalList = list; List<ThirdAliDrug> finalList = list;
ThreadUtil.execAsync(() -> { ThreadUtil.execAsync(() -> {
@ -92,20 +92,50 @@ public class ThirdAliDrugController {
thirdAliDrugAddRequest.setList(finalList); thirdAliDrugAddRequest.setList(finalList);
thirdAliDrugService.addThirdAliDrug(thirdAliDrugAddRequest); thirdAliDrugService.addThirdAliDrug(thirdAliDrugAddRequest);
} catch (Exception e) { } catch (Exception e) {
log.error("异步更新阿里药品数据错误==="+e.getMessage()); log.error("异步更新阿里药品数据错误===" + e.getMessage());
} }
}); });
// 判断中文括号和英文括号的就今昔新的结果进行剔除 // 判断中文括号和英文括号的就今昔新的结果进行剔除
if(thirdAliDrug.getCpmctymc().contains("(") || thirdAliDrug.getCpmctymc().contains("")){
if(thirdAliDrug.getCpmctymc().contains("(") || thirdAliDrug.getCpmctymc().contains("")
|| !(
StrUtil.isEmpty(thirdAliDrug.getApprovalNum()) && StrUtil.isEmpty(thirdAliDrug.getNameCode()) &&
StrUtil.isEmpty(thirdAliDrug.getManufacturer())&&
StrUtil.isEmpty(thirdAliDrug.getFormSpec())&&
StrUtil.isEmpty(thirdAliDrug.getBzgg())
)
){
List<ThirdAliDrug> listResult = new ArrayList<>(); List<ThirdAliDrug> listResult = new ArrayList<>();
if(CollUtil.isNotEmpty(list)){ if (CollUtil.isNotEmpty(list)) {
for (ThirdAliDrug aliDrug : list) { for (ThirdAliDrug aliDrug : list) {
if(!nameCodeIn.contains(aliDrug.getNameCode())){ // String cpmctymc = StringUtils.isEmpty(aliDrug.getCpmctymc()) ? "":aliDrug.getCpmctymc();
String nameCode = thirdAliDrug.getNameCode();
String approvalNum = thirdAliDrug.getApprovalNum();
String manufacturer = thirdAliDrug.getManufacturer();
String formSpec = thirdAliDrug.getFormSpec();
String bzgg = thirdAliDrug.getBzgg();
if (StringUtils.isNotEmpty(nameCode) && !nameCode.contains(aliDrug.getNameCode())) {
continue;
}
if (StringUtils.isNotEmpty(approvalNum) && !nameCode.contains(aliDrug.getApprovalNum())) {
continue;
}
if (StringUtils.isNotEmpty(manufacturer) && !nameCode.contains(aliDrug.getManufacturer())) {
continue;
}
if (StringUtils.isNotEmpty(formSpec) && !nameCode.contains(aliDrug.getFormSpec())) {
continue;
}
if (StringUtils.isNotEmpty(bzgg) && !nameCode.contains(aliDrug.getBzgg())) {
continue;
}
if (nameCodeIn.contains(aliDrug.getNameCode())) {
continue;
}
listResult.add(aliDrug); listResult.add(aliDrug);
} }
}
list = listResult; list = listResult;
} }
} }

Loading…
Cancel
Save