|  |  | @ -231,6 +231,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(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -263,7 +264,7 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 UdiProductEntity udiProductEntity = new UdiProductEntity(); |  |  |  |                 UdiProductEntity udiProductEntity = new UdiProductEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 BeanUtils.copyProperties(thrProductsEntity, udiProductEntity); |  |  |  |                 BeanUtils.copyProperties(thrProductsEntity, udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 YbDrug ybDrug=new YbDrug(); |  |  |  |                 YbDrug ybDrug = new YbDrug(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 // 数据处理
 |  |  |  |                 // 数据处理
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 udiProductEntity.setId(IdUtil.getSnowflakeNextId()); |  |  |  |                 udiProductEntity.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -290,7 +291,7 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (list != null && list.size() > 0) { |  |  |  |                 if (list != null && list.size() > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     ybDrug = list.get(0); |  |  |  |                     ybDrug = list.get(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     // 数据做处理好查询阿里接口
 |  |  |  |                     // 数据做处理好查询阿里接口
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(ybDrug.getApprovalCode().contains("(")){ |  |  |  |                     if (ybDrug.getApprovalCode().contains("(")) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         String[] charArr = ybDrug.getRegisteredProductName().split("\\("); |  |  |  |                         String[] charArr = ybDrug.getRegisteredProductName().split("\\("); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ybDrug.setApprovalCode(charArr[0]); |  |  |  |                         ybDrug.setApprovalCode(charArr[0]); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
	
		
		
			
				
					|  |  | @ -315,34 +316,31 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //商品条码 essentialDrugMarkName sptm
 |  |  |  |                     //商品条码 essentialDrugMarkName sptm
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //                    udiProductEntity.setSptm(ybDrug.getBusinessLicense());
 |  |  |  | //                    udiProductEntity.setSptm(ybDrug.getBusinessLicense());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     udiProductEntity.setPrepnUnit(ybDrug.getRealityMedicinemodel()); |  |  |  |                     udiProductEntity.setPrepnUnit(ybDrug.getRealityMedicinemodel()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 if (StrUtil.isEmpty(udiProductEntity.getZczbhhzbapzbh()) || StrUtil.isEmpty(udiProductEntity.getCpmctymc())) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |                     return; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list( |  |  |  |                 List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list( | 
			
		
	
		
		
			
				
					
					|  |  |  |                         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()) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 ); |  |  |  |                 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollUtil.isNotEmpty(thirdAliDrugList)) { |  |  |  |                 if (CollUtil.isNotEmpty(thirdAliDrugList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Map map = new HashMap(); |  |  |  |                     Map map = new HashMap(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc())){ |  |  |  |                     if (StringUtils.isNotEmpty(udiProductEntity.getCpmctymc())) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         map.put("cpmctymc",udiProductEntity.getCpmctymc()); |  |  |  |                         map.put("cpmctymc", udiProductEntity.getCpmctymc()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh())){ |  |  |  |                     if (StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh())) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         map.put("approvalNum",udiProductEntity.getZczbhhzbapzbh()); |  |  |  |                         map.put("approvalNum", udiProductEntity.getZczbhhzbapzbh()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     List<ThirdAliDrug> thirdAliDrugsListGjk = null; |  |  |  |                     List<ThirdAliDrug> thirdAliDrugsListGjk = null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     try { |  |  |  |                     try { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         String response =  HttpUtil.get(udiUrl+"/udiwms/aliDrug/getDrugLevelList",map); |  |  |  |                         String response = HttpUtil.get(udiUrl + "/udiwms/aliDrug/getDrugLevelList", map); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         BaseResponse<PageSimpleResponse<ThirdAliDrug>> udiDlDeviceResponse = |  |  |  |                         BaseResponse<PageSimpleResponse<ThirdAliDrug>> udiDlDeviceResponse = | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThirdAliDrug>>>() { |  |  |  |                                 JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThirdAliDrug>>>() { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -354,12 +352,12 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } catch (Exception e) { |  |  |  |                     } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         log.error("国家库查询阿里产品访问出现错误==="+e.getMessage()); |  |  |  |                         log.error("国家库查询阿里产品访问出现错误===" + e.getMessage()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(thirdAliDrugService.addOrUpdate(thirdAliDrugsListGjk)){ |  |  |  |                     if (thirdAliDrugService.addOrUpdate(thirdAliDrugsListGjk)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }else { |  |  |  |                     } else { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         List<ThirdAliDrug> thirdAliDrugListNew = null; |  |  |  |                         List<ThirdAliDrug> thirdAliDrugListNew = null; | 
			
		
	
		
		
			
				
					
					|  |  |  |                         AuthAliUser authAliUser = authAliUserService.getOne(); |  |  |  |                         AuthAliUser authAliUser = authAliUserService.getOne(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -375,36 +373,36 @@ 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.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust, true); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             if(baseResponse.getCode() == 20000){ |  |  |  |                             if (baseResponse.getCode() == 20000) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                                 thirdAliDrugListNew = baseResponse.getData(); |  |  |  |                                 thirdAliDrugListNew = baseResponse.getData(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 if(thirdAliDrugService.addOrUpdate(thirdAliDrugListNew)){ |  |  |  |                                 if (thirdAliDrugService.addOrUpdate(thirdAliDrugListNew)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 }else { |  |  |  |                                 } else { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                                     log.error("阿里接口未查到产品信息==="); |  |  |  |                                     log.error("阿里接口未查到产品信息==="); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |                                     udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 } |  |  |  |                                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                             }else { |  |  |  |                             } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                 log.error("阿里接口未查到产品信息==="+baseResponse.getMessage()); |  |  |  |                                 log.error("阿里接口未查到产品信息===" + baseResponse.getMessage()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                                 udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |                                 udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  | //                                throw new JsonException(500, "阿里接口未查到产品信息");
 |  |  |  | //                                throw new JsonException(500, "阿里接口未查到产品信息");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         }catch (Exception e){ |  |  |  |                         } catch (Exception e) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             log.error("阿里接口查询产品信息出现错误==="+e.getMessage()); |  |  |  |                             log.error("阿里接口查询产品信息出现错误===" + e.getMessage()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if(thirdAliDrugListNew!=null && thirdAliDrugListNew.size() > 0 ){ |  |  |  |                         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)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                 BaseResponse baseResponseAdd =  JSONUtil.toBean(response,BaseResponse.class); |  |  |  |                                 BaseResponse baseResponseAdd = JSONUtil.toBean(response, BaseResponse.class); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                                 log.info("成功上传国家库阿里产品数据"); |  |  |  |                                 log.info("成功上传国家库阿里产品数据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             } catch (Exception e) { |  |  |  |                             } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 log.error("国家库上传阿里产品访问出现错误==="+e.getMessage()); |  |  |  |                                 log.error("国家库上传阿里产品访问出现错误===" + e.getMessage()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -412,8 +410,8 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thirdAliDrugList = thirdAliDrugService.list( |  |  |  |                     thirdAliDrugList = thirdAliDrugService.list( | 
			
		
	
		
		
			
				
					
					|  |  |  |                             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()) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     ); |  |  |  |                     ); | 
			
		
	
		
		
			
				
					
					|  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 |  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |