|  |  | @ -57,7 +57,7 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
		
			
				
					
					|  |  |  |             BaseResponse<PageSimpleResponse<IoCollectOrder>> baseResponse = erpBasicClient.getThrOrders(filterThrOrderRequest); |  |  |  |             BaseResponse<PageSimpleResponse<IoCollectOrder>> baseResponse = erpBasicClient.getThrOrders(filterThrOrderRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (baseResponse.getCode() == 20000) { |  |  |  |             if (baseResponse.getCode() == 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<IoCollectOrder> list = baseResponse.getData().getList(); |  |  |  |                 List<IoCollectOrder> list = baseResponse.getData().getList(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (list == null){ |  |  |  |                 if (list == null) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     return ResultVOUtils.error(500, "未查到此业务单据"); |  |  |  |                     return ResultVOUtils.error(500, "未查到此业务单据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 // TODO: 2024/9/11  2024/9/11 添加一张中间表(io_collect_order_origin)原始表做为转换
 |  |  |  |                 // TODO: 2024/9/11  2024/9/11 添加一张中间表(io_collect_order_origin)原始表做为转换
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -107,12 +107,24 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); |  |  |  |                     IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BeanUtil.copyProperties(entity, collectOrderBiz); |  |  |  |                     BeanUtil.copyProperties(entity, collectOrderBiz); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())){ |  |  |  |                     if (BusTypeConstant.QXCF001.getBusType().equals(collectOrderRequest.getBusType())) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         collectOrderBiz.setRelId(entity.getRelId()); |  |  |  |                         collectOrderBiz.setRelId(entity.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if(StrUtil.isNotEmpty(entity.getCheckCode())){ |  |  |  |                         if (StrUtil.isNotEmpty(entity.getCheckCode())) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().like(BasicProductsEntity::getYbbm,entity.getCheckCode())); |  |  |  |                             // 1. 先查询完全匹配的情况
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         }else{ |  |  |  |                             LambdaQueryWrapper<BasicProductsEntity> exactMatchWrapper = new LambdaQueryWrapper<>(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             exactMatchWrapper.eq(BasicProductsEntity::getYbbm, entity.getCheckCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             List<BasicProductsEntity> exactMatches = basicProductsDao.selectList(exactMatchWrapper); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             if (exactMatches.isEmpty()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 // 2. 如果没有完全匹配,则查询前20位匹配的情况
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 LambdaQueryWrapper<BasicProductsEntity> prefixMatchWrapper = new LambdaQueryWrapper<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 prefixMatchWrapper.apply("LEFT(ybbm, 20) = LEFT({0}, 20)", entity.getCheckCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 exactMatches = basicProductsDao.selectList(prefixMatchWrapper); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             if (exactMatches.isEmpty()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1")); |  |  |  |                             BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getYbbm, entity.getYbbm()).last("limit 1")); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) { |  |  |  |                             if (basicProductsEntity == null || StrUtil.isEmpty(basicProductsEntity.getNameCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); |  |  |  |                                 errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -123,7 +135,7 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         collectOrderBiz.setUnTagCount(0); |  |  |  |                         collectOrderBiz.setUnTagCount(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         bizList.add(collectOrderBiz); |  |  |  |                         bizList.add(collectOrderBiz); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }else { |  |  |  |                     } else { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper<UdiRelevanceEntity>().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()).last("limit 1")); |  |  |  |                         UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper<UdiRelevanceEntity>().eq(UdiRelevanceEntity::getMainId, entity.getThrCode()).last("limit 1")); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if (basicUdirelEntity != null) { |  |  |  |                         if (basicUdirelEntity != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             collectOrderBiz.setRelId(basicUdirelEntity.getId()); |  |  |  |                             collectOrderBiz.setRelId(basicUdirelEntity.getId()); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |