|
|
|
@ -424,33 +424,35 @@ public class UdiContrastService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) {
|
|
|
|
|
thirdAliDrugList = disposeYbDrugList(thirdAliDrugList,ybDrug);
|
|
|
|
|
if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < thirdAliDrugList.size(); i++) {
|
|
|
|
|
ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
|
|
|
|
|
|
|
|
|
|
// 数据处理
|
|
|
|
|
udiProductEntity.setPrepnSpec(CopyUtils.copyNullStr(udiProductEntity.getPrepnSpec(),thirdAliDrug.getFormSpec()));
|
|
|
|
|
udiProductEntity.setZczbhhzbapzbh(CopyUtils.copyNullStr(udiProductEntity.getZczbhhzbapzbh(),thirdAliDrug.getApprovalNum()));
|
|
|
|
|
udiProductEntity.setCpmctymc(CopyUtils.copyNullStr(udiProductEntity.getCpmctymc(),thirdAliDrug.getCpmctymc()));
|
|
|
|
|
udiProductEntity.setSpmc(CopyUtils.copyNullStr(udiProductEntity.getSpmc(),thirdAliDrug.getSpmc()));
|
|
|
|
|
udiProductEntity.setPrepnSpec(CopyUtils.copyNullStr(udiProductEntity.getPrepnSpec(), thirdAliDrug.getFormSpec()));
|
|
|
|
|
udiProductEntity.setZczbhhzbapzbh(CopyUtils.copyNullStr(udiProductEntity.getZczbhhzbapzbh(), thirdAliDrug.getApprovalNum()));
|
|
|
|
|
udiProductEntity.setCpmctymc(CopyUtils.copyNullStr(udiProductEntity.getCpmctymc(), thirdAliDrug.getCpmctymc()));
|
|
|
|
|
udiProductEntity.setSpmc(CopyUtils.copyNullStr(udiProductEntity.getSpmc(), thirdAliDrug.getSpmc()));
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setBzgg(CopyUtils.copyNullStr(udiProductEntity.getBzgg(),thirdAliDrug.getBzgg()));
|
|
|
|
|
udiProductEntity.setPackRatio(CopyUtils.copyNullStr(udiProductEntity.getPackRatio(),thirdAliDrug.getPackRatio()));
|
|
|
|
|
udiProductEntity.setBzgg(CopyUtils.copyNullStr(udiProductEntity.getBzgg(), thirdAliDrug.getBzgg()));
|
|
|
|
|
udiProductEntity.setPackRatio(CopyUtils.copyNullStr(udiProductEntity.getPackRatio(), thirdAliDrug.getPackRatio()));
|
|
|
|
|
// udiProductEntity.setMatrial(ybDrug.getMaterialName());
|
|
|
|
|
// udiProductEntity.setPackMatrial(ybDrug.getMaterialName());
|
|
|
|
|
// udiProductEntity.setMedicareType(setMedicareType(ybDrug.getProductInsuranceType()));
|
|
|
|
|
//最小产品单位
|
|
|
|
|
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(udiProductEntity.getPackUnit(),thirdAliDrug.getPackUnitName()));
|
|
|
|
|
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(udiProductEntity.getPackUnit(), thirdAliDrug.getPackUnitName()));
|
|
|
|
|
//设置最小产品数量
|
|
|
|
|
// udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
//生产厂家
|
|
|
|
|
// udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
|
|
|
|
|
//商品条码 essentialDrugMarkName sptm
|
|
|
|
|
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
|
|
|
|
|
udiProductEntity.setPrepnUnit(CopyUtils.copyNullStr(udiProductEntity.getPrepnUnit(),thirdAliDrug.getPrepnUnitName()));
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setPrepnUnit(CopyUtils.copyNullStr(udiProductEntity.getPrepnUnit(), thirdAliDrug.getPrepnUnitName()));
|
|
|
|
|
|
|
|
|
|
List<Integer> integers = new ArrayList<>();
|
|
|
|
|
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
|
|
|
|
@ -465,6 +467,9 @@ public class UdiContrastService {
|
|
|
|
|
udiProductEntity.setBhxjsl(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IntUtil.value(udiProductEntity.getBhxjsl()) == 0) {
|
|
|
|
|
udiProductEntity.setBhxjsl(IntUtil.value(ybDrug.getFactor()));
|
|
|
|
|
}
|
|
|
|
|
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
|
|
|
|
|
udiProductEntity.setXjdw(ybDrug.getMinUnit());
|
|
|
|
|
if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) {
|
|
|
|
@ -482,6 +487,20 @@ public class UdiContrastService {
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
udiProductService.insertUdiInfo(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
udiProductService.insertUdiInfo(udiProductEntity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType()));
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error("明细分类转换出现错误"+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
udiProductService.insertUdiInfo(udiProductEntity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// setLevel(udiRelevanceEntity.getUuid());
|
|
|
|
@ -582,6 +601,54 @@ public class UdiContrastService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public List<ThirdAliDrug> disposeYbDrugList(List<ThirdAliDrug> thirdAliDrugList,YbDrug ybDrug){
|
|
|
|
|
List<ThirdAliDrug> list1 = new ArrayList<>();
|
|
|
|
|
List<ThirdAliDrug> 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")){
|
|
|
|
|
list2.add(thirdAliDrug);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(list1 !=null && list1.size() >0){
|
|
|
|
|
return list1;
|
|
|
|
|
}else if(list2 !=null && list2.size() >0){
|
|
|
|
|
return list2;
|
|
|
|
|
}
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
public String drugRulesVerify(YbDrug ybDrug,ThirdAliDrug thirdAliDrug ){
|
|
|
|
|
try {
|
|
|
|
|
Integer bzggInt = DimaUtil.trMinCount(thirdAliDrug.getBzgg());
|
|
|
|
|
// 按照医保数量与阿里包装规格对比
|
|
|
|
|
if((bzggInt == ybDrug.getFactor())){
|
|
|
|
|
return "1";
|
|
|
|
|
}
|
|
|
|
|
// 医保规格拆分与阿里规格拆分做匹配
|
|
|
|
|
List<String> list = DimaUtil.extractNumbers(ybDrug.getRealityOutlook());
|
|
|
|
|
if(list!=null && list.size() >0){
|
|
|
|
|
for (String str : list) {
|
|
|
|
|
if(str.equals(String.valueOf(bzggInt))){
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// // 医保的规格与阿里制剂规格完全匹配
|
|
|
|
|
// if(thirdAliDrug.getFormSpec().equals(ybDrug.getRealityOutlook())){
|
|
|
|
|
// return "3";
|
|
|
|
|
// }
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error("药品校验出现错误==="+e.getMessage());
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean insertProduct(ThrProductsEntity thrProductsEntity, BasicInsMaterialEntity basicInsMaterialEntity, UdiRelevanceEntity udiRelevanceEntity) {
|
|
|
|
|