选入药品做转换匹配阿里

阿里关联关系优化
dev_unify
qiuyt 4 months ago
parent 1b688f400e
commit aefadc1062

@ -122,7 +122,7 @@ public class AlihealthBusController extends BaseController {
return ResultVOUtils.success(thirdAliDrugsListGjk); return ResultVOUtils.success(thirdAliDrugsListGjk);
}else { }else {
List<ThirdAliDrug> thirdAliDrugListNew; List<ThirdAliDrug> thirdAliDrugListNew;
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true); BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
if(baseResponse.getCode() == 20000){ if(baseResponse.getCode() == 20000){
thirdAliDrugListNew = baseResponse.getData(); thirdAliDrugListNew = baseResponse.getData();
}else { }else {

@ -17,6 +17,7 @@ import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.dao.inout.IoCodeDao;
import com.glxp.api.dao.inout.IoCodeTempDao; import com.glxp.api.dao.inout.IoCodeTempDao;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.CustomerInfoEntity; import com.glxp.api.entity.auth.CustomerInfoEntity;
@ -136,7 +137,7 @@ public class IoOrderReviewController extends BaseController {
@Resource @Resource
private RelCodeDetailService relCodeDetailService; private RelCodeDetailService relCodeDetailService;
@Resource @Resource
private IoCodeTempDao ioCodeTempDao; private IoCodeDao ioCodeDao;
//前端二次审核 //前端二次审核
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/spms/inout/order/web/updateStatus") @PostMapping("/spms/inout/order/web/updateStatus")
@ -480,36 +481,32 @@ public class IoOrderReviewController extends BaseController {
alihealthYljgUploadinoutbillReqeust.setPhysic_type(3); alihealthYljgUploadinoutbillReqeust.setPhysic_type(3);
alihealthYljgUploadinoutbillReqeust.setClient_type("2"); alihealthYljgUploadinoutbillReqeust.setClient_type("2");
// 查询改单据传的码 // 查询改单据传的码
List<IoCodeTempEntity> ioCodeEntityList = ioCodeTempDao.selectList(new QueryWrapper<IoCodeTempEntity>().eq("orderId", orderEntity.getBillNo())); List<IoCodeEntity> ioCodeEntityList = ioCodeDao.selectList(new QueryWrapper<IoCodeEntity>().eq("orderId", orderEntity.getBillNo()));
if(ioCodeEntityList!=null && ioCodeEntityList.size() >0){ if(ioCodeEntityList!=null && ioCodeEntityList.size() >0){
List<String> codeList = new ArrayList<>(); List<String> codeList = new ArrayList<>();
for (IoCodeTempEntity ioCodeEntity : ioCodeEntityList) { for (IoCodeEntity ioCodeEntity : ioCodeEntityList) {
codeList.add(ioCodeEntity.getCode()); codeList.add(ioCodeEntity.getCode());
} }
Set<String> set = new HashSet<>(codeList);
alihealthYljgUploadinoutbillReqeust.setTrace_codes( String.join(",", codeList)); alihealthYljgUploadinoutbillReqeust.setTrace_codes( String.join(",", codeList));
BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust,orderEntity.getFromCorp()); BaseResponse baseResponseUploadinoutbill = alihealthYljgUtils.yljgUploadinoutbill(alihealthYljgUploadinoutbillReqeust,orderEntity.getFromCorp());
if(baseResponseUploadinoutbill.getCode() == 20000){ // if(baseResponseUploadinoutbill.getCode() == 20000){
try { try {
Thread.sleep(1000); Thread.sleep(1000);
for (IoCodeTempEntity ioCodeEntity : ioCodeEntityList) { relCodeBatchService.addRelCodeAli(set, orderEntity.getFromCorp());
AlihealthYljgSinglerelationReqeust alihealthYljgSinglerelationReqeust = new AlihealthYljgSinglerelationReqeust();
alihealthYljgSinglerelationReqeust.setCode(ioCodeEntity.getCode());
BaseResponse<AlihealthYljgSinglerelationResponse> baseResponse = alihealthYljgUtils.relCodeInsert(alihealthYljgSinglerelationReqeust);
if (baseResponse.getCode() == 20000) {
relCodeBatchService.addRelCodeAli(baseResponse, orderEntity.getFromCorp());
} else {
log.error("阿里调用码关联关系失败==="+baseResponse.getMessage());
}
}
} catch (InterruptedException e) {
}
//2.下载关联关系存到关联关系表
}else {
log.error("阿里调用上传单据失败==="+baseResponseUploadinoutbill.getMessage());
} catch (InterruptedException e) {
} }
// }else {
// log.error("阿里调用上传单据失败==="+baseResponseUploadinoutbill.getMessage());
//
// }
} }
}); });

@ -105,7 +105,7 @@ public class TestCodeController {
alihealthKytDrugrescodeReqeust.setApp_key("31721223"); alihealthKytDrugrescodeReqeust.setApp_key("31721223");
alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0"); alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0");
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true); BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
if(baseResponse.getCode() == 20000){ if(baseResponse.getCode() == 20000){
List<ThirdAliDrug> list = baseResponse.getData(); List<ThirdAliDrug> list = baseResponse.getData();
if(list!=null && list.size() >0){ if(list!=null && list.size() >0){

@ -55,20 +55,29 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
this.setProduce_info_list(codeRelationDto.getJSONObject("produce_info_list")); this.setProduce_info_list(codeRelationDto.getJSONObject("produce_info_list"));
} }
} }
public RelCodeBatch disposeRelCodeBatch(String customerId){ public List<RelCodeBatch> disposeRelCodeBatch(String customerId){
JSONArray jsonArrayBaseInfoDto = this.getBase_infos_dto().getJSONObject("base_info_list").getJSONArray("base_info_dto"); JSONArray jsonArrayBaseInfoDto = this.getBase_infos_dto().getJSONObject("base_info_list").getJSONArray("base_info_dto");
JSONObject jsonObject = (JSONObject) jsonArrayBaseInfoDto.get(0); JSONObject jsonObject = (JSONObject) jsonArrayBaseInfoDto.get(0);
RelCodeBatch relCodeBatch = new RelCodeBatch(); // RelCodeBatch relCodeBatch = new RelCodeBatch();
List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info"); List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info");
List<String> list = new ArrayList<>();
if (jsonArray != null && jsonArray.size() > 0) {
for (Map<String, String> map : jsonArray) {
list.add(map.get("parent_code"));
}
}
Set<String> set = new HashSet<>(list);
List<RelCodeBatch> batchList = new ArrayList<>();
for (String parentCode : set) {
if(StringUtils.isNotEmpty(parentCode)){
RelCodeBatch relCodeBatch = new RelCodeBatch();
Integer oneLevelCount = 0; Integer oneLevelCount = 0;
Integer twoLevelCount = 0; Integer twoLevelCount = 0;
Integer threeLevelCount = 0; Integer threeLevelCount = 0;
String parentCode = null;
if (jsonArray != null && jsonArray.size() > 0) {
parentCode = jsonArray.get(0).get("parent_code");
relCodeBatch.setCurCode(parentCode);
for (Map<String, String> map : jsonArray) { for (Map<String, String> map : jsonArray) {
if(!parentCode.equals(map.get("code")) && parentCode.equals(map.get("parent_code"))){
switch (map.get("code_level")) { switch (map.get("code_level")) {
case "1": case "1":
oneLevelCount++; oneLevelCount++;
@ -81,8 +90,10 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
break; break;
} }
} }
} }
// relCodeBatch.setId(); relCodeBatch.setCurCode(parentCode);
relCodeBatch.setProductCode(FilterUdiUtils.getUdi(parentCode).getUdi()); relCodeBatch.setProductCode(FilterUdiUtils.getUdi(parentCode).getUdi());
relCodeBatch.setSubTypeNo(this.getCode_active_info_dto().getStr("relation_type")); relCodeBatch.setSubTypeNo(this.getCode_active_info_dto().getStr("relation_type"));
relCodeBatch.setCascadeRatio(jsonObject.getStr("pkg_ratio")); relCodeBatch.setCascadeRatio(jsonObject.getStr("pkg_ratio"));
@ -106,8 +117,14 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
relCodeBatch.setOneLevelCount(oneLevelCount); relCodeBatch.setOneLevelCount(oneLevelCount);
relCodeBatch.setTwoLevelCount(twoLevelCount); relCodeBatch.setTwoLevelCount(twoLevelCount);
relCodeBatch.setThreeLevelCount(threeLevelCount); relCodeBatch.setThreeLevelCount(threeLevelCount);
batchList.add(relCodeBatch);
}
}
// relCodeBatch.setId();
return relCodeBatch; return batchList;
} }
@ -116,7 +133,7 @@ public class AlihealthYljgSinglerelationResponse extends AlihealthKytCommonParam
List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info"); List<Map<String, String>> jsonArray = (List) this.getCode_relation_list().get("code_info");
if (jsonArray != null && jsonArray.size() > 0) { if (jsonArray != null && jsonArray.size() > 0) {
for (Map<String, String> map : jsonArray) { for (Map<String, String> map : jsonArray) {
if (!Objects.isNull(map)) { if (!Objects.isNull(map) && StringUtils.isNotEmpty(map.get("parent_code"))) {
RelCodeDetail relCodeDetail = new RelCodeDetail(); RelCodeDetail relCodeDetail = new RelCodeDetail();
relCodeDetail.setCurCode(map.get("code")); relCodeDetail.setCurCode(map.get("code"));
relCodeDetail.setPackLayer(Integer.valueOf(map.get("code_level"))); relCodeDetail.setPackLayer(Integer.valueOf(map.get("code_level")));

@ -324,6 +324,8 @@ public class UdiContrastService {
new QueryWrapper<ThirdAliDrug>() new QueryWrapper<ThirdAliDrug>()
.eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc()) .eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
.eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh()) .eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
.eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
); );
if (CollUtil.isNotEmpty(thirdAliDrugList)) { if (CollUtil.isNotEmpty(thirdAliDrugList)) {
@ -374,7 +376,7 @@ public class UdiContrastService {
alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid()); alihealthKytDrugrescodeReqeust.setRef_ent_id(authAliUser.getRefentid());
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
try { try {
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust, true); BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
if (baseResponse.getCode() == 20000) { if (baseResponse.getCode() == 20000) {
thirdAliDrugListNew = baseResponse.getData(); thirdAliDrugListNew = baseResponse.getData();
if (thirdAliDrugService.addOrUpdate(thirdAliDrugListNew)) { if (thirdAliDrugService.addOrUpdate(thirdAliDrugListNew)) {
@ -413,6 +415,7 @@ public class UdiContrastService {
new QueryWrapper<ThirdAliDrug>() new QueryWrapper<ThirdAliDrug>()
.eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc()) .eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
.eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh()) .eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
.eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
); );
// udiProductService.insertUdiInfo(udiProductEntity); // udiProductService.insertUdiInfo(udiProductEntity);
} }

@ -30,6 +30,7 @@ import com.glxp.api.entity.sync.SyncDataSetEntity;
import com.glxp.api.entity.system.CompanyEntity; import com.glxp.api.entity.system.CompanyEntity;
import com.glxp.api.exception.JsonException; import com.glxp.api.exception.JsonException;
import com.glxp.api.req.alihealth.AlihealthYljgCodedetailReqeust; import com.glxp.api.req.alihealth.AlihealthYljgCodedetailReqeust;
import com.glxp.api.req.alihealth.AlihealthYljgSinglerelationReqeust;
import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust; import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust;
import com.glxp.api.req.alihealth.local.AlihealthYljgLocaCodedetailReqeust; import com.glxp.api.req.alihealth.local.AlihealthYljgLocaCodedetailReqeust;
import com.glxp.api.req.collect.RelCodeBatchRequest; import com.glxp.api.req.collect.RelCodeBatchRequest;
@ -45,6 +46,7 @@ import com.glxp.api.service.basic.UdiProductService;
import com.glxp.api.service.sync.SyncDataSetService; import com.glxp.api.service.sync.SyncDataSetService;
import com.glxp.api.service.system.CompanyService; import com.glxp.api.service.system.CompanyService;
import com.glxp.api.util.HttpClient; import com.glxp.api.util.HttpClient;
import com.glxp.api.util.StringUtils;
import com.glxp.api.util.alihealth.AlihealthUtils; import com.glxp.api.util.alihealth.AlihealthUtils;
import com.glxp.api.util.alihealth.AlihealthYljgUtils; import com.glxp.api.util.alihealth.AlihealthYljgUtils;
import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.FilterUdiUtils;
@ -698,12 +700,23 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode
} }
return; return;
} }
@Resource
AlihealthYljgUtils alihealthYljgUtils;
// 处理阿里新增关联关系 // 处理阿里新增关联关系
public void addRelCodeAli(BaseResponse<AlihealthYljgSinglerelationResponse> baseResponse, String erpId){ public void addRelCodeAli( Set<String> set, String erpId){
try {
List<String> relCodeBatchList =new ArrayList<>();
//2.下载关联关系存到关联关系表
for (String code : set) {
AlihealthYljgSinglerelationReqeust alihealthYljgSinglerelationReqeust = new AlihealthYljgSinglerelationReqeust();
alihealthYljgSinglerelationReqeust.setCode(code);
BaseResponse<AlihealthYljgSinglerelationResponse> baseResponse = alihealthYljgUtils.relCodeInsert(alihealthYljgSinglerelationReqeust);
if (baseResponse.getCode() == 20000) {
AlihealthYljgSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData(); AlihealthYljgSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData();
// 返回的码关联关系进行插入 // 返回的码关联关系进行插入
RelCodeBatch relCodeBatch = alihealthKytSinglerelationResponse.disposeRelCodeBatch(erpId); List<RelCodeBatch> batchList = alihealthKytSinglerelationResponse.disposeRelCodeBatch(erpId);
RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode()) for (RelCodeBatch relCodeBatch : batchList) {
RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("curCode", relCodeBatch.getCurCode())
.last("limit 1") .last("limit 1")
); );
if (Objects.isNull(relCodeBatchOne)) { if (Objects.isNull(relCodeBatchOne)) {
@ -712,9 +725,22 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode
relCodeBatchService.save(relCodeBatch); relCodeBatchService.save(relCodeBatch);
} else { } else {
relCodeBatchService.update(relCodeBatch, new QueryWrapper<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode())); if(relCodeBatchOne.getOneLevelCount()!=null){
relCodeBatch.setOneLevelCount(relCodeBatchOne.getOneLevelCount() +relCodeBatch.getOneLevelCount() );
} }
Integer id = Objects.isNull(relCodeBatch.getId()) ? relCodeBatchOne.getId() : relCodeBatch.getId(); if(relCodeBatchOne.getTwoLevelCount()!=null){
relCodeBatch.setTwoLevelCount(relCodeBatchOne.getTwoLevelCount() +relCodeBatch.getTwoLevelCount() );
}
if(relCodeBatchOne.getThreeLevelCount()!=null){
relCodeBatch.setThreeLevelCount(relCodeBatchOne.getThreeLevelCount() +relCodeBatch.getThreeLevelCount() );
}
relCodeBatchService.update(relCodeBatch, new QueryWrapper<RelCodeBatch>().eq("curCode", relCodeBatch.getCurCode()));
}
relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("curCode", relCodeBatch.getCurCode()));
Integer id = relCodeBatchOne.getId();
relCodeBatchList.add(relCodeBatchOne.getCurCode());
// 进行查询 // 进行查询
List<RelCodeDetail> list = alihealthKytSinglerelationResponse.disposeRelRodeDetailList(id); List<RelCodeDetail> list = alihealthKytSinglerelationResponse.disposeRelRodeDetailList(id);
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
@ -726,5 +752,29 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode
relCodeDetailService.saveBatch(list); relCodeDetailService.saveBatch(list);
} }
}
} else {
log.error("阿里调用码关联关系失败==="+baseResponse.getMessage());
}
}
}catch (Exception E){
E.printStackTrace();
}
// 父级编码
// if(relCodeBatchList!=null && relCodeBatchList.size() >0){
// List<RelCodeDetail> list = relCodeDetailService.list(
// new QueryWrapper<RelCodeDetail>().in("curCode",relCodeBatchList)
// );
// if(list!=null && list.size() >0){
// RelCodeBatch relCodeBatch =new RelCodeBatch();
// relCodeBatchService.update(relCodeBatch, new QueryWrapper<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode()));
//
// }
// }
} }
} }

@ -101,13 +101,69 @@ public class AlihealthUtils {
} }
} }
public BaseResponse<List<ThirdAliDrug>> thirdAliDrugInsertAll(AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust){
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = alihealthThirdAliDrugInsertReqeust.getAlihealthKytDrugrescodeReqeust();
String physicName = alihealthKytDrugrescodeReqeust.getPhysic_name();
List<ThirdAliDrug> list = new ArrayList<>();
BaseResponse<List<ThirdAliDrug>> baseResponse = thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust);
if(baseResponse.getCode() == 20000){
List<ThirdAliDrug> thirdAliDrugList = baseResponse.getData();
list.addAll(thirdAliDrugList);
}
if ( (physicName.contains("(") || physicName.contains(""))) {
if (physicName.contains("(")) {
physicName = physicName.replace("(", "").replace(")", "");
} else if (physicName.contains("")) {
physicName = physicName.replace("", "(").replace("", ")");
}
alihealthKytDrugrescodeReqeust.setPhysic_name(physicName);
baseResponse = thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust);
if(baseResponse.getCode() == 20000){
List<ThirdAliDrug> thirdAliDrugList = baseResponse.getData();
list.addAll(thirdAliDrugList);
}
}
physicName = alihealthKytDrugrescodeReqeust.getPhysic_name();
if ( physicName.contains("") || physicName.contains("I")
|| physicName.contains("Ⅱ") || physicName.contains("II")
|| physicName.contains("Ⅲ") || physicName.contains("III"))
{
if (physicName.contains("")
|| physicName.contains("Ⅱ")
|| physicName.contains("Ⅲ")) {
physicName = physicName.replaceAll("", "I")
.replace("Ⅱ", "II")
.replace("Ⅲ", "III");
} else if (physicName.contains("I")
|| physicName.contains("II")
|| physicName.contains("III")) {
physicName = physicName.replaceAll("I", "")
.replace("II", "Ⅱ")
.replace("III", "Ⅲ");
}
alihealthKytDrugrescodeReqeust.setPhysic_name(physicName);
baseResponse = thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust);
if(baseResponse.getCode() == 20000){
List<ThirdAliDrug> thirdAliDrugList = baseResponse.getData();
list.addAll(thirdAliDrugList);
}
}
if(list!=null && list.size() >0){
baseResponse.setData(list);
}
return baseResponse;
}
/** /**
* *
* *
* @param alihealthThirdAliDrugInsertReqeust * @param alihealthThirdAliDrugInsertReqeust
*/ */
public BaseResponse<List<ThirdAliDrug>> thirdAliDrugInsert(AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust, Boolean callBool) { public BaseResponse<List<ThirdAliDrug>> thirdAliDrugInsert(AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust) {
if (alihealthThirdAliDrugInsertReqeust.getAlihealthKytDrugrescodeReqeust() == null) { if (alihealthThirdAliDrugInsertReqeust.getAlihealthKytDrugrescodeReqeust() == null) {
return ResultVOUtils.error("入参不能为空"); return ResultVOUtils.error("入参不能为空");
} }
@ -132,31 +188,38 @@ public class AlihealthUtils {
} else { } else {
return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空"); return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空");
} }
if (alihealthKytDrugrescodeResponse.judgeCall(alihealthThirdAliDrugInsertReqeust.getManufactory()) ) {
List<ThirdAliDrug> list = alihealthKytDrugrescodeResponse.disposeThirdAliDrugList(alihealthThirdAliDrugInsertReqeust.getErpId());
return ResultVOUtils.success(list);
} else {
String physicName = alihealthKytDrugrescodeReqeust.getPhysic_name(); String physicName = alihealthKytDrugrescodeReqeust.getPhysic_name();
// 重新上传标识为true就改变一下
if ("未查询到相关信息".equals(alihealthKytDrugrescodeResponse.getMsg_info())
&& callBool && (physicName.contains("(") || physicName.contains(""))) {
if (physicName.contains("(")) {
physicName = physicName.replace("(", "").replace(")", "");
} else if (physicName.contains("")) {
physicName = physicName.replace("", "(").replace("", ")");
} if (alihealthKytDrugrescodeResponse.judgeCall() ) {
alihealthKytDrugrescodeReqeust.setPhysic_name(physicName); List<ThirdAliDrug> listNew = alihealthKytDrugrescodeResponse.disposeThirdAliDrugList(alihealthThirdAliDrugInsertReqeust.getErpId());
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); return ResultVOUtils.success(listNew);
thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust, false); } else {
} //
// // 重新上传标识为true就改变一下
// if ("未查询到相关信息".equals(alihealthKytDrugrescodeResponse.getMsg_info())
// && callBool && (physicName.contains("(") || physicName.contains(""))) {
// if (physicName.contains("(")) {
// physicName = physicName.replace("(", "").replace(")", "");
//
// } else if (physicName.contains("")) {
// physicName = physicName.replace("", "(").replace("", ")");
//
// }
// alihealthKytDrugrescodeReqeust.setPhysic_name(physicName);
// alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
// thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust, false);
// }
return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthKytDrugrescodeResponse.getMsg_info()); return ResultVOUtils.error("阿里健康接口调用失败===" + alihealthKytDrugrescodeResponse.getMsg_info());
} }
// if(physicName.equals("(")){
// thirdAliDrugInsert();
// }
// if(physicName.equals("")){
// thirdAliDrugInsert();
// }
} }
//TODO 调用阿里接口用码进行批量处理只测试了两个包装层级的 暂时没有三个包装层级的数据做测试 到时候有数据之后要好好测试一下 //TODO 调用阿里接口用码进行批量处理只测试了两个包装层级的 暂时没有三个包装层级的数据做测试 到时候有数据之后要好好测试一下

Loading…
Cancel
Save