|  |  |  | @ -7,12 +7,14 @@ import com.glxp.api.dao.basic.SysWorkplaceDocumentDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.schedule.ScheduledDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.inv.InvProductRationEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.system.ScheduledEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.system.SystemParamConfigEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.WorkBindBusTypeRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.collect.CollectOrderRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.system.ScheduledRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.basic.SysWorkplaceDocumentResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.collect.IoCollectOriginService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.inv.InvProductRationService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.system.SystemParamConfigService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.MsDateUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.StringUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import org.slf4j.Logger; | 
			
		
	
	
		
			
				
					|  |  |  | @ -41,6 +43,8 @@ public class AsyncIoCollectOrderDownloadTask implements SchedulingConfigurer { | 
			
		
	
		
			
				
					|  |  |  |  |     SysWorkplaceDocumentDao sysWorkplaceDocumentDao; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     IoCollectOriginService collectOriginService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SystemParamConfigService systemParamConfigService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -59,21 +63,30 @@ public class AsyncIoCollectOrderDownloadTask implements SchedulingConfigurer { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private void process() { | 
			
		
	
		
			
				
					|  |  |  |  |         ThreadUtil.execAsync(() -> { | 
			
		
	
		
			
				
					|  |  |  |  |             WorkBindBusTypeRequest workBindBusTypeRequest = new WorkBindBusTypeRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |             List<SysWorkplaceDocumentResponse> sysWorkplaceDocumentResponses = sysWorkplaceDocumentDao.filterList(workBindBusTypeRequest); | 
			
		
	
		
			
				
					|  |  |  |  |             if (CollUtil.isNotEmpty(sysWorkplaceDocumentResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 //包装开始和结束的日期
 | 
			
		
	
		
			
				
					|  |  |  |  |             //获取下载的起始时间
 | 
			
		
	
		
			
				
					|  |  |  |  |             SystemParamConfigEntity startDownloadTime = systemParamConfigService.selectByParamKey("startDownloadTime"); | 
			
		
	
		
			
				
					|  |  |  |  |             if (startDownloadTime != null && StrUtil.isNotBlank(startDownloadTime.getParamValue() )){ | 
			
		
	
		
			
				
					|  |  |  |  |                 //获取当前时间
 | 
			
		
	
		
			
				
					|  |  |  |  |                 String paramValue = startDownloadTime.getParamValue(); | 
			
		
	
		
			
				
					|  |  |  |  |                 String nowTime = MsDateUtil.getDateTime(); | 
			
		
	
		
			
				
					|  |  |  |  |                 CollectOrderRequest collectOrderRequest = new CollectOrderRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |                 String date = MsDateUtil.getDate(); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setStartTime(date); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setEndTime(date); | 
			
		
	
		
			
				
					|  |  |  |  |                 for (SysWorkplaceDocumentResponse sysWorkplaceDocumentResponse : sysWorkplaceDocumentResponses) { | 
			
		
	
		
			
				
					|  |  |  |  |                     Long workplaceCode = sysWorkplaceDocumentResponse.getWorkplaceCode(); | 
			
		
	
		
			
				
					|  |  |  |  |                     String documentTypeCode = sysWorkplaceDocumentResponse.getDocumentTypeCode(); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderRequest.setBusType(documentTypeCode); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderRequest.setWorkPlaceCode(workplaceCode); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOriginService.downloadOrderV2(collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setStartTime(paramValue); | 
			
		
	
		
			
				
					|  |  |  |  |                 collectOrderRequest.setEndTime(nowTime); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 WorkBindBusTypeRequest workBindBusTypeRequest = new WorkBindBusTypeRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |                 List<SysWorkplaceDocumentResponse> sysWorkplaceDocumentResponses = sysWorkplaceDocumentDao.filterList(workBindBusTypeRequest); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (CollUtil.isNotEmpty(sysWorkplaceDocumentResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |                     //包装开始和结束的日期
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     for (SysWorkplaceDocumentResponse sysWorkplaceDocumentResponse : sysWorkplaceDocumentResponses) { | 
			
		
	
		
			
				
					|  |  |  |  |                         String documentTypeCode = sysWorkplaceDocumentResponse.getDocumentTypeCode(); | 
			
		
	
		
			
				
					|  |  |  |  |                         collectOrderRequest.setBusType(documentTypeCode); | 
			
		
	
		
			
				
					|  |  |  |  |                         collectOriginService.downloadOrderV2(collectOrderRequest); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 startDownloadTime.setParamValue(nowTime); | 
			
		
	
		
			
				
					|  |  |  |  |                 systemParamConfigService.updateById(startDownloadTime); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |