|  |  | @ -10,6 +10,7 @@ import com.alibaba.fastjson.TypeReference; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.res.BaseResponse; |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.ConstantStatus; |  |  |  | import com.glxp.api.constant.ConstantStatus; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.controller.alihealth.AlihealthBusController; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.dao.basic.UdiRelevanceDao; |  |  |  | import com.glxp.api.dao.basic.UdiRelevanceDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.auth.AuthAliUser; |  |  |  | import com.glxp.api.entity.auth.AuthAliUser; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.UdiProductEntity; |  |  |  | import com.glxp.api.entity.basic.UdiProductEntity; | 
			
		
	
	
		
		
			
				
					|  |  | @ -231,7 +232,8 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     ThirdAliDrugService thirdAliDrugService; |  |  |  |     ThirdAliDrugService thirdAliDrugService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |     @Resource | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private AlihealthBusController alihealthBusController; | 
			
		
	
		
		
			
				
					
					|  |  |  |     //    @Transactional
 |  |  |  |     //    @Transactional
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void createOnlyMainId(String mainId) { |  |  |  |     public void createOnlyMainId(String mainId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); |  |  |  |         FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -322,57 +324,26 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (StrUtil.isEmpty(udiProductEntity.getZczbhhzbapzbh()) || StrUtil.isEmpty(udiProductEntity.getCpmctymc())) { |  |  |  |                 if (StrUtil.isEmpty(udiProductEntity.getZczbhhzbapzbh()) || StrUtil.isEmpty(udiProductEntity.getCpmctymc())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     return; |  |  |  |                     return; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list( |  |  |  |                 // 本地查询先注释了
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         new QueryWrapper<ThirdAliDrug>() |  |  |  |                 List<ThirdAliDrug> thirdAliDrugList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                 .eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc()) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 .eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh()) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 .eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory()) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (CollUtil.isNotEmpty(thirdAliDrugList)) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Map map = new HashMap(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (StringUtils.isNotEmpty(udiProductEntity.getCpmctymc())) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         map.put("cpmctymc", udiProductEntity.getCpmctymc()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh())) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         map.put("approvalNum", udiProductEntity.getZczbhhzbapzbh()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (StringUtils.isNotEmpty(udiProductEntity.getManufactory())) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         map.put("manufacturer", udiProductEntity.getManufactory()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     List<ThirdAliDrug> thirdAliDrugsListGjk = null; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     try { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         String response = HttpUtil.get(udiUrl + "/udiwms/aliDrug/getDrugLevelList", map); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         BaseResponse<PageSimpleResponse<ThirdAliDrug>> udiDlDeviceResponse = |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThirdAliDrug>>>() { |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 }); |  |  |  | //                List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list(
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         if (udiDlDeviceResponse != null) { |  |  |  | //                        new QueryWrapper<ThirdAliDrug>()
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             // 查询国家库是否有值 有值直接返回没值查询阿里接口
 |  |  |  | //                                .eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             thirdAliDrugsListGjk = udiDlDeviceResponse.getData().getList(); |  |  |  | //                                .eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | //                                .eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  | //                );
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     } catch (Exception e) { |  |  |  | //                if (CollUtil.isNotEmpty(thirdAliDrugList)) {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         log.error("国家库查询阿里产品访问出现错误===" + e.getMessage()); |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  | //                } else {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (thirdAliDrugService.addOrUpdate(thirdAliDrugsListGjk)) { |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         List<ThirdAliDrug> thirdAliDrugListNew = null; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     AuthAliUser authAliUser = authAliUserService.getOne(); |  |  |  |                     AuthAliUser authAliUser = authAliUserService.getOne(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); |  |  |  |                     AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     alihealthThirdAliDrugInsertReqeust.setErpId(authAliUser.getErpid()); |  |  |  |                     alihealthThirdAliDrugInsertReqeust.setErpId(authAliUser.getErpid()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     alihealthThirdAliDrugInsertReqeust.setAppSecret(authAliUser.getAppsecret()); |  |  |  |                     alihealthThirdAliDrugInsertReqeust.setAppSecret(authAliUser.getAppsecret()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         alihealthThirdAliDrugInsertReqeust.setManufactory(udiProductEntity.getManufactory()); |  |  |  | //                    alihealthThirdAliDrugInsertReqeust.setManufactory(udiProductEntity.getManufactory());
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     alihealthThirdAliDrugInsertReqeust.setYbDrug(ybDrug); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); |  |  |  |                     AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     alihealthKytDrugrescodeReqeust.setPhysic_name(udiProductEntity.getCpmctymc()); |  |  |  |                     alihealthKytDrugrescodeReqeust.setPhysic_name(udiProductEntity.getCpmctymc()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     alihealthKytDrugrescodeReqeust.setApproval_licence_no(udiProductEntity.getZczbhhzbapzbh()); |  |  |  |                     alihealthKytDrugrescodeReqeust.setApproval_licence_no(udiProductEntity.getZczbhhzbapzbh()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -382,51 +353,50 @@ 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.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust); |  |  |  |                         BaseResponse baseResponse = alihealthBusController.thirdAliDrugList(alihealthThirdAliDrugInsertReqeust); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         if (baseResponse.getCode() == 20000) { |  |  |  |                         if (baseResponse.getCode() == 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 thirdAliDrugListNew = baseResponse.getData(); |  |  |  |                             thirdAliDrugList = (List) baseResponse.getData(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                 if (thirdAliDrugService.addOrUpdate(thirdAliDrugListNew)) { |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            if (thirdAliDrugService.addOrUpdate((List) baseResponse.getData())) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                thirdAliDrugList = thirdAliDrugService.list(
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                        new QueryWrapper<ThirdAliDrug>()
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                                .eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                                .eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                                .eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                );
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            } else {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                log.info("供应商平台获取阿里和国家库码段信息===未查到产品信息");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                                udiProductService.insertUdiInfo(udiProductEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     log.error("阿里接口未查到产品信息==="); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } else { |  |  |  |                         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 log.error("阿里接口未查到产品信息===" + baseResponse.getMessage()); |  |  |  |                             log.error("供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                 udiProductService.insertUdiInfo(udiProductEntity); |  |  |  | //                        udiProductEntity.setBasicPrductRemak8("供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage());
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                                throw new JsonException(500, "阿里接口未查到产品信息");
 |  |  |  | //                        error = "供应商平台获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage();
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         } catch (Exception e) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             log.error("阿里接口查询产品信息出现错误===" + e.getMessage()); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if (thirdAliDrugListNew != null && thirdAliDrugListNew.size() > 0) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                             try { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 // 上传到国家库
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 Map mapNew = new HashMap(); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 mapNew.put("list", thirdAliDrugListNew); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 String response = HttpUtil.post(udiUrl + "/udiwms/aliDrug/addThirdAliDrug", JSONUtil.toJsonStr(mapNew)); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 BaseResponse baseResponseAdd = JSONUtil.toBean(response, BaseResponse.class); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 log.info("成功上传国家库阿里产品数据"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } catch (Exception e) { |  |  |  |                     } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 log.error("国家库上传阿里产品访问出现错误===" + e.getMessage()); |  |  |  |                         log.error("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  | //                            udiProductEntity.setBasicPrductRemak8("供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage());
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  | //                            error = "供应商平台获取阿里和国家库码段信息出现错误===" + e.getMessage();
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     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())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                                     .eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory()) |  |  |  | //                                    .eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     ); |  |  |  | //                    );
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 |  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  | //                }
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thirdAliDrugList  = disposeYbDrugList(thirdAliDrugList,ybDrug); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) { |  |  |  |                 if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         for (int i = 0; i < thirdAliDrugList.size(); i++) { |  |  |  |                         for (int i = 0; i < thirdAliDrugList.size(); i++) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -489,10 +459,6 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             udiProductEntity.setId(IdUtil.getSnowflakeNextId()); |  |  |  |                             udiProductEntity.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |                             udiProductService.insertUdiInfo(udiProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         udiProductService.insertUdiInfo(udiProductEntity); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     try { |  |  |  |                     try { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType())); |  |  |  |                         udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType())); | 
			
		
	
	
		
		
			
				
					|  |  | @ -604,23 +570,26 @@ public class UdiContrastService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     public List<ThirdAliDrug> disposeYbDrugList(List<ThirdAliDrug> thirdAliDrugList,YbDrug ybDrug){ |  |  |  |     public List<ThirdAliDrug> disposeYbDrugList(List<ThirdAliDrug> thirdAliDrugList,YbDrug ybDrug){ | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<ThirdAliDrug> list1 = new ArrayList<>(); |  |  |  |         List<ThirdAliDrug> list1 = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<ThirdAliDrug> list2 = new ArrayList<>(); |  |  |  |         if(thirdAliDrugList!=null && thirdAliDrugList.size() >0){ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //        List<ThirdAliDrug> list2 = new ArrayList<>();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (ThirdAliDrug thirdAliDrug : thirdAliDrugList) { |  |  |  |             for (ThirdAliDrug thirdAliDrug : thirdAliDrugList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 String str = drugRulesVerify(ybDrug,thirdAliDrug); |  |  |  |                 String str = drugRulesVerify(ybDrug,thirdAliDrug); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if(StringUtils.isNotEmpty(str)){ |  |  |  |                 if(StringUtils.isNotEmpty(str)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(str.equals("1")){ |  |  |  |                     if(str.equals("1")){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         list1.add(thirdAliDrug); |  |  |  |                         list1.add(thirdAliDrug); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }else if(str.equals("2")){ |  |  |  |                     }else if(str.equals("2")){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     list2.add(thirdAliDrug); |  |  |  |                         list1.add(thirdAliDrug); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(list1 !=null && list1.size() >0){ |  |  |  | //        if(list1 !=null && list1.size() >0){
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return list1; |  |  |  | //            return list1;
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         }else if(list2 !=null && list2.size() >0){ |  |  |  | //        }else if(list2 !=null && list2.size() >0){
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             return list2; |  |  |  | //            return list2;
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         return new ArrayList<>(); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return list1; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     public String drugRulesVerify(YbDrug ybDrug,ThirdAliDrug thirdAliDrug ){ |  |  |  |     public String drugRulesVerify(YbDrug ybDrug,ThirdAliDrug thirdAliDrug ){ | 
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  |         try { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |