选入药品逻辑更改以后以国家库为标准

dev_drug
qiuyt 3 months ago
parent eb9a2bafa6
commit d32c2f476c

@ -105,7 +105,7 @@ public class AlihealthBusController extends BaseController {
List<ThirdAliDrug> 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<CodeRel> list = new ArrayList<>();
for (ThirdAliDrug thirdAliDrug : thirdAliDrugsListGjk) {

@ -93,9 +93,11 @@ public class ThirdAliDrugController extends BaseController {
}
thirdAliDrug.setNameCodeIn(nameCodeIn);
List<ThirdAliDrug> list = new ArrayList<>();
// 不查本地库全查阿里的库
List<ThirdAliDrug> list = thirdAliDrugService.filterList(thirdAliDrug);
if(list == null || list.size() == 0){
// List<ThirdAliDrug> 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<ThirdAliDrug> pageInfo = new PageInfo<>(list);
PageSimpleResponse<ThirdAliDrug> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());

@ -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<String> nameCodeIn;
private AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust;
}

@ -568,17 +568,27 @@ public class UdiContrastService {
}
}
public List<ThirdAliDrug> disposeYbDrugList(List<ThirdAliDrug> thirdAliDrugList,YbDrug ybDrug){
public List<ThirdAliDrug> disposeYbDrugList(List<ThirdAliDrug> thirdAliDrugList,YbDrug ybDrug,List<String> codeIn){
List<ThirdAliDrug> list1 = new ArrayList<>();
String result=null;
if(codeIn!=null && codeIn.size() >0){
result = String.join(", ", codeIn);
}
if(thirdAliDrugList!=null && thirdAliDrugList.size() >0){
// 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")){
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);
}
}
}
}

Loading…
Cancel
Save