|  |  |  | @ -55,18 +55,18 @@ public class AsyncIoCollectOrderUploadTask implements SchedulingConfigurer { | 
			
		
	
		
			
				
					|  |  |  |  |                     // 使用设置的轮询时间为准 这边进行转换
 | 
			
		
	
		
			
				
					|  |  |  |  |                     IoCollectSet ioCollectSet = collectSetService.getSet(); | 
			
		
	
		
			
				
					|  |  |  |  |                     String cron = null; | 
			
		
	
		
			
				
					|  |  |  |  |                     if(ioCollectSet!= null | 
			
		
	
		
			
				
					|  |  |  |  |                             && ioCollectSet.getStartUploadHour() !=null | 
			
		
	
		
			
				
					|  |  |  |  |                             && ioCollectSet.getStartUploadHour() >0 | 
			
		
	
		
			
				
					|  |  |  |  |                     ){ | 
			
		
	
		
			
				
					|  |  |  |  |                         if(ioCollectSet.getStartUploadHour() <= 24){ | 
			
		
	
		
			
				
					|  |  |  |  |                             cron =  "0 0 */"+ioCollectSet.getStartUploadHour()+" * * ? "; | 
			
		
	
		
			
				
					|  |  |  |  |                     if (ioCollectSet != null | 
			
		
	
		
			
				
					|  |  |  |  |                             && ioCollectSet.getStartUploadHour() != null | 
			
		
	
		
			
				
					|  |  |  |  |                             && ioCollectSet.getStartUploadHour() > 0 | 
			
		
	
		
			
				
					|  |  |  |  |                     ) { | 
			
		
	
		
			
				
					|  |  |  |  |                         if (ioCollectSet.getStartUploadHour() <= 24) { | 
			
		
	
		
			
				
					|  |  |  |  |                             cron = "0 0 */" + ioCollectSet.getStartUploadHour() + " * * ? "; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                     }else { | 
			
		
	
		
			
				
					|  |  |  |  |                          cron =  "0 0 0 */1 * ?"; | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         cron = "0 0 0 */1 * ?"; | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                     logger.info("已完成单据自动上传轮询设置cron表达式==="+cron); | 
			
		
	
		
			
				
					|  |  |  |  |                     logger.info("已完成单据自动上传轮询设置cron表达式===" + cron); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     if (cron.isEmpty()) { | 
			
		
	
		
			
				
					|  |  |  |  |                         logger.error("cron is null"); | 
			
		
	
	
		
			
				
					|  |  |  | @ -76,41 +76,39 @@ public class AsyncIoCollectOrderUploadTask implements SchedulingConfigurer { | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private void process() { | 
			
		
	
		
			
				
					|  |  |  |  |         ThreadUtil.execAsync(() -> { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             //获取下载的起始时间
 | 
			
		
	
		
			
				
					|  |  |  |  |             IoCollectSet ioCollectSet = collectSetService.getSet(); | 
			
		
	
		
			
				
					|  |  |  |  |             Date startUploadTime = ioCollectSet.getStartUploadTime(); | 
			
		
	
		
			
				
					|  |  |  |  |             String startUploadTimes = MsDateUtil.formatDateTime(startUploadTime); | 
			
		
	
		
			
				
					|  |  |  |  |             Boolean autoUploadOrder = ioCollectSet.getAutoUploadOrder(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             if (StrUtil.isNotBlank(startUploadTimes) && autoUploadOrder){ | 
			
		
	
		
			
				
					|  |  |  |  |                 //获取当前时间
 | 
			
		
	
		
			
				
					|  |  |  |  |                 String paramValue = startUploadTimes; | 
			
		
	
		
			
				
					|  |  |  |  |                 String nowTime = MsDateUtil.getDateTime(); | 
			
		
	
		
			
				
					|  |  |  |  |                 CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setStartTime(paramValue); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setEndTime(nowTime); | 
			
		
	
		
			
				
					|  |  |  |  |                 List<Integer> list = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |                 list.add(1); | 
			
		
	
		
			
				
					|  |  |  |  |                 list.add(3); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setUploadStatusList(list); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 //调用上传单据
 | 
			
		
	
		
			
				
					|  |  |  |  |                 List<IoCollectOrderResponse> orderResponses = ioCollectOrderBackupService.filterList(collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (CollUtil.isNotEmpty(orderResponses)){ | 
			
		
	
		
			
				
					|  |  |  |  |                     orderResponses.forEach( item -> { | 
			
		
	
		
			
				
					|  |  |  |  |                         AuthAdmin authAdmin = new AuthAdmin(); | 
			
		
	
		
			
				
					|  |  |  |  |                         ioCollectOrderBackupService.orderUpload(item.getBillNo(),authAdmin); | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 // 无限循环去上传单据不做限制了
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //获取下载的起始时间
 | 
			
		
	
		
			
				
					|  |  |  |  |         IoCollectSet ioCollectSet = collectSetService.getSet(); | 
			
		
	
		
			
				
					|  |  |  |  |         Date startUploadTime = ioCollectSet.getStartUploadTime(); | 
			
		
	
		
			
				
					|  |  |  |  |         String startUploadTimes = MsDateUtil.formatDateTime(startUploadTime); | 
			
		
	
		
			
				
					|  |  |  |  |         Boolean autoUploadOrder = ioCollectSet.getAutoUploadOrder(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotBlank(startUploadTimes) && autoUploadOrder) { | 
			
		
	
		
			
				
					|  |  |  |  |             //获取当前时间
 | 
			
		
	
		
			
				
					|  |  |  |  |             String paramValue = startUploadTimes; | 
			
		
	
		
			
				
					|  |  |  |  |             String nowTime = MsDateUtil.getDateTime(); | 
			
		
	
		
			
				
					|  |  |  |  |             CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             collectOrderRequest.setStartTime(paramValue); | 
			
		
	
		
			
				
					|  |  |  |  |             collectOrderRequest.setEndTime(nowTime); | 
			
		
	
		
			
				
					|  |  |  |  |             List<Integer> list = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |             list.add(1); | 
			
		
	
		
			
				
					|  |  |  |  |             list.add(3); | 
			
		
	
		
			
				
					|  |  |  |  |             collectOrderRequest.setUploadStatusList(list); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             //调用上传单据
 | 
			
		
	
		
			
				
					|  |  |  |  |             List<IoCollectOrderResponse> orderResponses = ioCollectOrderBackupService.filterList(collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |             if (CollUtil.isNotEmpty(orderResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 orderResponses.forEach(item -> { | 
			
		
	
		
			
				
					|  |  |  |  |                     AuthAdmin authAdmin = new AuthAdmin(); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrderBackupService.orderUpload(item.getBillNo(), authAdmin); | 
			
		
	
		
			
				
					|  |  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             // 无限循环去上传单据不做限制了
 | 
			
		
	
		
			
				
					|  |  |  |  | //                ioCollectSet.setStartUploadTime(MsDateUtil.parseDate(nowTime));
 | 
			
		
	
		
			
				
					|  |  |  |  | //                collectSetService.updateById(ioCollectSet);
 | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |