选入药品阿里不能抛出异常

dev_unify
qiuyt 7 months ago
parent 94fff63ebb
commit b3b8376d9a

@ -227,7 +227,7 @@ public class UdiContrastService {
@Resource @Resource
ThirdAliDrugService thirdAliDrugService; ThirdAliDrugService thirdAliDrugService;
@Transactional // @Transactional
public void createOnlyMainId(String mainId) { public void createOnlyMainId(String mainId) {
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setCode(mainId); filterThrProductsRequest.setCode(mainId);
@ -346,7 +346,7 @@ public class UdiContrastService {
if(thirdAliDrugService.addOrUpdate(thirdAliDrugsListGjk)){ if(thirdAliDrugService.addOrUpdate(thirdAliDrugsListGjk)){
}else { }else {
List<ThirdAliDrug> thirdAliDrugListNew; List<ThirdAliDrug> thirdAliDrugListNew = null;
String customerId =customerService.getCustomerId(); String customerId =customerService.getCustomerId();
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(customerId); CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(customerId);
@ -366,13 +366,14 @@ public class UdiContrastService {
if(baseResponse.getCode() == 20000){ if(baseResponse.getCode() == 20000){
thirdAliDrugListNew = baseResponse.getData(); thirdAliDrugListNew = baseResponse.getData();
thirdAliDrugService.addOrUpdate(thirdAliDrugListNew); thirdAliDrugService.addOrUpdate(thirdAliDrugListNew);
}else { }else {
log.error("阿里接口未查到产品信息==="+baseResponse.getMessage()); log.error("阿里接口未查到产品信息==="+baseResponse.getMessage());
throw new JsonException(500, "阿里接口未查到产品信息"); // throw new JsonException(500, "阿里接口未查到产品信息");
} }
// 上传到国家库 if(thirdAliDrugListNew!=null && thirdAliDrugListNew.size() > 0 ){
try { try {
// 上传到国家库
Map mapNew = new HashMap(); Map mapNew = new HashMap();
mapNew.put("list",thirdAliDrugListNew); mapNew.put("list",thirdAliDrugListNew);
String response = HttpUtil.post(udiUrl+"/udiwms/aliDrug/addThirdAliDrug", JSONUtil.toJsonStr(mapNew)); String response = HttpUtil.post(udiUrl+"/udiwms/aliDrug/addThirdAliDrug", JSONUtil.toJsonStr(mapNew));
@ -381,6 +382,7 @@ public class UdiContrastService {
} catch (Exception e) { } catch (Exception e) {
log.error("国家库上传阿里产品访问出现错误==="+e.getMessage()); log.error("国家库上传阿里产品访问出现错误==="+e.getMessage());
} }
}
} }

Loading…
Cancel
Save