|  |  |  | @ -380,6 +380,7 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |             if(syncDataSetEntity == null || StrUtil.isEmpty(syncDataSetEntity.getSyncIp())){ | 
			
		
	
		
			
				
					|  |  |  |  |                 return; | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         ThreadUtil.execAsync(() -> { | 
			
		
	
		
			
				
					|  |  |  |  |             List<IoCodeTempEntity> ioCodeTempEntities = ioCodeTempDao.selectList(new LambdaQueryWrapper<IoCodeTempEntity>().eq(IoCodeTempEntity::getCode, parentCode)); | 
			
		
	
		
			
				
					|  |  |  |  |             if (CollUtil.isNotEmpty(ioCodeTempEntities)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 IoCodeTempEntity codeTempEntity = ioCodeTempEntities.get(0); | 
			
		
	
	
		
			
				
					|  |  |  | @ -395,10 +396,10 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |                         .eq(RelCodeBatch::getCurCode, parentCode)); | 
			
		
	
		
			
				
					|  |  |  |  | //            codeTempEntity.getSupId()
 | 
			
		
	
		
			
				
					|  |  |  |  |                 //todo  if(navList)是空的  1.查供应商key;2:根据parentCode查阿里接口;3:根据返回结果,再次查询
 | 
			
		
	
		
			
				
					|  |  |  |  |             if(navList == null || navList.size() == 0 ){ | 
			
		
	
		
			
				
					|  |  |  |  |                 if (navList == null || navList.size() == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                     CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(codeTempEntity.getSupId()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 AlihealthRelCodeInsertReqeust alihealthRelCodeInsertReqeust= new AlihealthRelCodeInsertReqeust(); | 
			
		
	
		
			
				
					|  |  |  |  |                     AlihealthRelCodeInsertReqeust alihealthRelCodeInsertReqeust = new AlihealthRelCodeInsertReqeust(); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthRelCodeInsertReqeust.setAppKey(customerInfoEntity.getAppKey()); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthRelCodeInsertReqeust.setAppSecret(customerInfoEntity.getAppSecret()); | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthRelCodeInsertReqeust.setCustomerId(codeTempEntity.getSupId()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -406,37 +407,37 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |                     alihealthRelCodeInsertReqeust.setRefEntId(customerInfoEntity.getRefEntId()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     BaseResponse<AlihealthKytSinglerelationResponse> baseResponse = alihealthUtils.relCodeInsert(alihealthRelCodeInsertReqeust); | 
			
		
	
		
			
				
					|  |  |  |  |                 if(baseResponse.getCode() == 20000){ | 
			
		
	
		
			
				
					|  |  |  |  |                     if (baseResponse.getCode() == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |                         AlihealthKytSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData(); | 
			
		
	
		
			
				
					|  |  |  |  |                         // 返回的码关联关系进行插入
 | 
			
		
	
		
			
				
					|  |  |  |  |                     RelCodeBatch relCodeBatch =  alihealthKytSinglerelationResponse.disposeRelCodeBatch( alihealthRelCodeInsertReqeust.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |                     RelCodeBatch relCodeBatchOne  = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("productCode",relCodeBatch.getProductCode()) | 
			
		
	
		
			
				
					|  |  |  |  |                         RelCodeBatch relCodeBatch = alihealthKytSinglerelationResponse.disposeRelCodeBatch(alihealthRelCodeInsertReqeust.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |                         RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode()) | 
			
		
	
		
			
				
					|  |  |  |  |                                 .last("limit 1") | 
			
		
	
		
			
				
					|  |  |  |  |                         ); | 
			
		
	
		
			
				
					|  |  |  |  |                     if(Objects.isNull(relCodeBatchOne)){ | 
			
		
	
		
			
				
					|  |  |  |  |                         if (Objects.isNull(relCodeBatchOne)) { | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeBatch.setCreateUser(alihealthRelCodeInsertReqeust.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeBatch.setCreateTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeBatchService.save(relCodeBatch); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     }else { | 
			
		
	
		
			
				
					|  |  |  |  |                         relCodeBatchService.update(relCodeBatch,new QueryWrapper<RelCodeBatch>().eq("productCode",relCodeBatch.getProductCode())); | 
			
		
	
		
			
				
					|  |  |  |  |                         } else { | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeBatchService.update(relCodeBatch, new QueryWrapper<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode())); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                     Integer  id = Objects.isNull(relCodeBatch.getId()) ? relCodeBatchOne.getId() :relCodeBatch.getId(); | 
			
		
	
		
			
				
					|  |  |  |  |                         Integer id = Objects.isNull(relCodeBatch.getId()) ? relCodeBatchOne.getId() : relCodeBatch.getId(); | 
			
		
	
		
			
				
					|  |  |  |  |                         // 进行查询
 | 
			
		
	
		
			
				
					|  |  |  |  |                         List<RelCodeDetail> list = alihealthKytSinglerelationResponse.disposeRelRodeDetailList(id); | 
			
		
	
		
			
				
					|  |  |  |  |                     if(list!=null && list.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |                         if (list != null && list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                             List curCodeList = new ArrayList(); | 
			
		
	
		
			
				
					|  |  |  |  |                             for (RelCodeDetail relCodeDetail : list) { | 
			
		
	
		
			
				
					|  |  |  |  |                                 curCodeList.add(relCodeDetail.getCurCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |  |                         relCodeDetailService.remove(new QueryWrapper<RelCodeDetail>().in("curCode",curCodeList)); | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeDetailService.remove(new QueryWrapper<RelCodeDetail>().in("curCode", curCodeList)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                             relCodeDetailService.saveBatch(list); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                         // 插入成功就重新查询一下
 | 
			
		
	
		
			
				
					|  |  |  |  |                         navList = this.list(new LambdaQueryWrapper<RelCodeBatch>() | 
			
		
	
		
			
				
					|  |  |  |  |                                 .eq(RelCodeBatch::getCurCode, parentCode)); | 
			
		
	
		
			
				
					|  |  |  |  |                 }else { | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         log.error(baseResponse.getMessage()); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
	
		
			
				
					|  |  |  | @ -456,7 +457,7 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |