|  |  | @ -11,6 +11,7 @@ import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.util.ResultVOUtils; |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.*; |  |  |  | import com.glxp.api.constant.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.controller.sync.SpsSyncWebSocket; |  |  |  | import com.glxp.api.controller.sync.SpsSyncWebSocket; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.constant.Constant; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.dao.basic.BasicProductsDao; |  |  |  | import com.glxp.api.dao.basic.BasicProductsDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.*; |  |  |  | import com.glxp.api.entity.basic.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.*; |  |  |  | import com.glxp.api.entity.inout.*; | 
			
		
	
	
		
		
			
				
					|  |  | @ -37,12 +38,10 @@ import com.glxp.api.service.inv.DeviceInspectTaskDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inv.DeviceInspectTaskService; |  |  |  | import com.glxp.api.service.inv.DeviceInspectTaskService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.purchase.*; |  |  |  | import com.glxp.api.service.purchase.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.thrsys.IThrBusTypeOriginService; |  |  |  | import com.glxp.api.service.thrsys.IThrBusTypeOriginService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.CustomUtil; |  |  |  | import com.glxp.api.util.*; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.DateUtil; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.JsonUtils; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.RedisUtil; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import lombok.RequiredArgsConstructor; |  |  |  | import lombok.RequiredArgsConstructor; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.commons.lang3.exception.ExceptionUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.slf4j.Logger; |  |  |  | import org.slf4j.Logger; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.slf4j.LoggerFactory; |  |  |  | import org.slf4j.LoggerFactory; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.beans.BeanUtils; |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
	
		
		
			
				
					|  |  | @ -101,6 +100,7 @@ public class SpsSyncDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         log.info("创建单据同步任务"); |  |  |  |         log.info("创建单据同步任务"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         //自动创建要求被下载已完成单据任务.
 |  |  |  |         //自动创建要求被下载已完成单据任务.
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        1.判断是否同步任务已存在
 |  |  |  | //        1.判断是否同步任务已存在
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Date curTime = new Date(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) |  |  |  |         BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .eq(BasicExportStatusEntity::getType, NEW_ALL_ORDER) |  |  |  |                 .eq(BasicExportStatusEntity::getType, NEW_ALL_ORDER) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .orderByDesc(BasicExportStatusEntity::getStartTime) |  |  |  |                 .orderByDesc(BasicExportStatusEntity::getStartTime) | 
			
		
	
	
		
		
			
				
					|  |  | @ -108,8 +108,8 @@ public class SpsSyncDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         ); |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //首次任务or上次任务结束
 |  |  |  |         //首次任务or上次任务结束
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (basicExportStatusEntity1 == null || BasicExportStatusEnum.COMPLETED.getCode().equals(basicExportStatusEntity1.getStatus())) { |  |  |  |         if (basicExportStatusEntity1 == null || IntUtil.value(BasicExportStatusEnum.COMPLETED.getCode()) == IntUtil.value(basicExportStatusEntity1.getStatus())) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |             log.info("no2:" + basicExportStatusEntity1.getStatus() + "---" + BasicExportStatusEnum.COMPLETED.getCode()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); |  |  |  |             SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (lastUpdateTime != null) |  |  |  |             if (lastUpdateTime != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime)); |  |  |  |                 spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime)); | 
			
		
	
	
		
		
			
				
					|  |  | @ -124,7 +124,7 @@ public class SpsSyncDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 orderStatusEntity.setType(NEW_ALL_ORDER); |  |  |  |                 orderStatusEntity.setType(NEW_ALL_ORDER); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 orderStatusEntity.setUpdateTime(new Date()); |  |  |  |                 orderStatusEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_SYNC.getCode()); |  |  |  |                 orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_SYNC.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 orderStatusEntity.setStartTime(new Date()); |  |  |  |                 orderStatusEntity.setStartTime(curTime); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); |  |  |  |                 orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (lastUpdateTime != null) { |  |  |  |                 if (lastUpdateTime != null) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |