|  |  |  | @ -6,7 +6,9 @@ import cn.hutool.core.util.StrUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.basic.BasicProductsDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.basic.UdiRelevanceDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicProductsEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.UdiRelevanceEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrder; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.IoCollectOrderBiz; | 
			
		
	
	
		
			
				
					|  |  |  | @ -52,7 +54,8 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
			
				
					|  |  |  |  |             BaseResponse<PageSimpleResponse<IoCollectOrder>> baseResponse = erpBasicClient.getThrOrders(filterThrOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |             if (baseResponse.getCode() == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |                 List<IoCollectOrder> list = baseResponse.getData().getList(); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderService.importPrescribe(list,collectOrderRequest.getBusType()); | 
			
		
	
		
			
				
					|  |  |  |  |                 // TODO: 2024/9/11  2024/9/11 添加一张中间表(io_collect_order_origin)原始表做为转换
 | 
			
		
	
		
			
				
					|  |  |  |  |                 importThrOrder(list, collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |                 if ((list.size() >= limit && !baseResponse.getData().getTotal().equals(-666)) || IntUtil.value(baseResponse.getData().getTotal()) == -555) { | 
			
		
	
		
			
				
					|  |  |  |  |                     page++; | 
			
		
	
		
			
				
					|  |  |  |  |                 } else { | 
			
		
	
	
		
			
				
					|  |  |  | @ -68,6 +71,8 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
			
				
					|  |  |  |  |     //    }
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     UdiRelevanceDao udiRelevanceDao; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     BasicProductsDao basicProductsDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 下载至单据 | 
			
		
	
	
		
			
				
					|  |  |  | @ -97,6 +102,10 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
			
				
					|  |  |  |  |                     UdiRelevanceEntity basicUdirelEntity = udiRelevanceDao.selectOne(new LambdaQueryWrapper<UdiRelevanceEntity>().eq(UdiRelevanceEntity::getMainId, entity.getThrCode())); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (basicUdirelEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         collectOrderBiz.setRelId(basicUdirelEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |                         BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new LambdaQueryWrapper<BasicProductsEntity>().eq(BasicProductsEntity::getUuid, basicUdirelEntity.getUuid()).last("limit 1")); | 
			
		
	
		
			
				
					|  |  |  |  |                         if (StrUtil.isEmpty(basicProductsEntity.getNameCode())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         errorMsg.append(entity.getCpmctymc()).append("字典未对照").append(";"); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -111,6 +120,9 @@ public class ThrOrderDownload implements IDownload { | 
			
		
	
		
			
				
					|  |  |  |  |                 ioCollectOrder.setBizList(bizList); | 
			
		
	
		
			
				
					|  |  |  |  |                 ioCollectOrderList.add(ioCollectOrder); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             collectOrderService.importPrescribe(ioCollectOrderList, collectOrderRequest.getBusType()); | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.success("下载成功"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |