|  |  |  | @ -68,6 +68,7 @@ import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | import java.math.BigDecimal; | 
			
		
	
		
			
				
					|  |  |  |  | import java.text.ParseException; | 
			
		
	
		
			
				
					|  |  |  |  | import java.text.SimpleDateFormat; | 
			
		
	
		
			
				
					|  |  |  |  | import java.time.LocalDateTime; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.*; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.concurrent.atomic.AtomicInteger; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.stream.Collectors; | 
			
		
	
	
		
			
				
					|  |  |  | @ -119,6 +120,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse handleExternalThrInvSfOrder(FilterInvProductRequest filterInvProductRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (thrInvOrderMapper.countDownloadsInRange(filterInvProductRequest.getStartDate(), filterInvProductRequest.getEndDate()) <= 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("自动抓取第三方收费出入库明细生成单据定时任务结束=" + filterInvProductRequest.getStartDate() + "---" + filterInvProductRequest.getEndDate()); | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("已下载忽略"); | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(20001, "已下载忽略"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         BaseResponse<PageSimpleResponse<ThrInvResultResponse>> baseResponse = erpInvClient.getInvSfResult(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if (baseResponse.getCode() == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |             List<ThrInvResultResponse> list = baseResponse.getData().getList(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -162,6 +170,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public void handleExternalThrInvPhOrder(FilterInvProductRequest filterInvProductRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         BaseResponse<PageSimpleResponse<ThrInvResultResponse>> baseResponse = erpInvClient.getInvPhResult(filterInvProductRequest); | 
			
		
	
	
		
			
				
					|  |  |  | @ -341,21 +350,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setStartDate(stringToDate(days + " 00:00:00")); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setEndDate(stringToDate(days + " 12:59:59")); | 
			
		
	
		
			
				
					|  |  |  |  |         if (thrInvOrderMapper.countDownloadsInRange(filterInvProductRequest.getStartDate(), filterInvProductRequest.getEndDate()) <= 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             handleExternalThrInvSfOrder(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("自动抓取第三方收费出入库明细生成单据定时任务结束"); | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("已下载户略"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         handleExternalThrInvSfOrder(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setStartDate(stringToDate(days + " 13:00:00")); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setEndDate(stringToDate(days + " 23:59:59")); | 
			
		
	
		
			
				
					|  |  |  |  |         if (thrInvOrderMapper.countDownloadsInRange(filterInvProductRequest.getStartDate(), filterInvProductRequest.getEndDate()) <= 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             handleExternalThrInvSfOrder(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("自动抓取第三方收费出入库明细生成单据定时任务结束"); | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             log.info("已下载户略"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         handleExternalThrInvSfOrder(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -820,8 +819,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |         log.info("手动抓取第三方收费出入库明细生成单据定时任务开始"); | 
			
		
	
		
			
				
					|  |  |  |  |         FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setThirdSys(filterDownloadInvOrderRequest.getThirdSysFk()); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setStartDate(stringToDate(filterDownloadInvOrderRequest.getStartDate() + " 00:00:00")); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setEndDate(stringToDate(filterDownloadInvOrderRequest.getEndDate() + " 23:59:59")); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setStartDate(stringToDate(filterDownloadInvOrderRequest.getStartDate())); | 
			
		
	
		
			
				
					|  |  |  |  |         filterInvProductRequest.setEndDate(stringToDate(filterDownloadInvOrderRequest.getEndDate())); | 
			
		
	
		
			
				
					|  |  |  |  |         log.info("手动抓取第三方收费出入库明细生成单据定时任务结束"); | 
			
		
	
		
			
				
					|  |  |  |  |         return handleExternalThrInvSfOrder(filterInvProductRequest); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |