选入药品层级bug

选入药品增加额外匹配规则
dev_unify
qiuyt 3 months ago
parent 163c299ab7
commit d95563602f

@ -426,8 +426,13 @@ public class UdiContrastService {
// udiProductService.insertUdiInfo(udiProductEntity); // udiProductService.insertUdiInfo(udiProductEntity);
} }
if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) { if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) {
int errCount = 0;
for (int i = 0; i < thirdAliDrugList.size(); i++) { for (int i = 0; i < thirdAliDrugList.size(); i++) {
ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i); ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i);
if(!drugRulesVerify(ybDrug,thirdAliDrug)){
errCount++;
continue;
}
udiProductEntity.setNameCode(thirdAliDrug.getNameCode()); udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
@ -487,6 +492,9 @@ public class UdiContrastService {
udiProductEntity.setId(IdUtil.getSnowflakeNextId()); udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity); udiProductService.insertUdiInfo(udiProductEntity);
} }
if(errCount == thirdAliDrugList.size()){
udiProductService.insertUdiInfo(udiProductEntity);
}
try { try {
udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType())); udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType()));
@ -595,6 +603,33 @@ public class UdiContrastService {
} }
} }
public boolean drugRulesVerify(YbDrug ybDrug,ThirdAliDrug thirdAliDrug ){
try {
Integer bzggInt = DimaUtil.trMinCount(thirdAliDrug.getBzgg());
// 按照医保数量与阿里包装规格对比
if((bzggInt == ybDrug.getFactor())){
return true;
}
// 医保规格拆分与阿里规格拆分做匹配
List<String> list = DimaUtil.extractNumbers(ybDrug.getRealityOutlook());
if(list!=null && list.size() >0){
for (String str : list) {
if(str.equals(bzggInt+"")){
return true;
}
}
}
// 医保的规格与阿里制剂规格完全匹配
if(thirdAliDrug.getFormSpec().equals(ybDrug.getRealityOutlook())){
return true;
}
}catch (Exception e){
log.error("药品校验出现错误==="+e.getMessage());
return false;
}
return false;
}
public void createOnlyApply(ThrProductsAddDiEntity thrProductsAddDiEntity) { public void createOnlyApply(ThrProductsAddDiEntity thrProductsAddDiEntity) {

@ -637,8 +637,8 @@ public class UdiProductServiceImpl implements UdiProductService {
List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list( List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list(
new QueryWrapper<ThirdAliDrug>().eq(StringUtils.isNotBlank( thirdAliDrugServiceOne.getBzgg()),"bzgg", thirdAliDrugServiceOne.getBzgg()) new QueryWrapper<ThirdAliDrug>().eq(StringUtils.isNotBlank( thirdAliDrugServiceOne.getBzgg()),"bzgg", thirdAliDrugServiceOne.getBzgg())
.eq(StringUtils.isNotBlank( thirdAliDrugServiceOne.getPackRatio()),"packRatio", thirdAliDrugServiceOne.getPackRatio()) .eq(StringUtils.isNotBlank( thirdAliDrugServiceOne.getPackRatio()),"packRatio", thirdAliDrugServiceOne.getPackRatio())
.eq(StringUtils.isNotBlank( thirdAliDrugRequest.getCpmctymc()),"cpmctymc", thirdAliDrugRequest.getCpmctymc()) .like(StringUtils.isNotBlank( thirdAliDrugRequest.getCpmctymc()),"cpmctymc", thirdAliDrugRequest.getCpmctymc())
.eq(StringUtils.isNotBlank( thirdAliDrugRequest.getManufacturer()),"manufacturer", thirdAliDrugRequest.getManufacturer()) .like(StringUtils.isNotBlank( thirdAliDrugRequest.getManufacturer()),"manufacturer", thirdAliDrugRequest.getManufacturer())
.eq(StringUtils.isNotBlank( thirdAliDrugRequest.getApprovalNum()),"approvalNum", thirdAliDrugRequest.getApprovalNum()) .eq(StringUtils.isNotBlank( thirdAliDrugRequest.getApprovalNum()),"approvalNum", thirdAliDrugRequest.getApprovalNum())
); );

@ -51,4 +51,32 @@ public class DimaUtil {
return null; return null;
} }
public static List<Integer> trMinCountAll(String bzgg) {
List<Integer> list = new ArrayList<>();
// 定义正则表达式模式,用于匹配数字
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(bzgg);
if (matcher.find()) {
list.add( Integer.parseInt(matcher.group()));
}
return list;
}
public static List<String> extractNumbers(String input) {
List<String> numberList = new ArrayList<>();
// 匹配小数的正则表达式
Pattern decimalPattern = Pattern.compile("\\d+\\.\\d+");
Matcher decimalMatcher = decimalPattern.matcher(input);
while (decimalMatcher.find()) {
numberList.add(decimalMatcher.group());
}
// 匹配整数的正则表达式
Pattern integerPattern = Pattern.compile("\\d+");
Matcher integerMatcher = integerPattern.matcher(input);
while (integerMatcher.find()) {
numberList.add(integerMatcher.group());
}
return numberList;
}
} }

Loading…
Cancel
Save