|  |  | @ -1,6 +1,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.controller.sync; |  |  |  | package com.glxp.api.controller.sync; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.collection.CollUtil; |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.util.IdUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.json.JSONUtil; |  |  |  | import cn.hutool.json.JSONUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; |  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.Constant; |  |  |  | import com.glxp.api.constant.Constant; | 
			
		
	
	
		
		
			
				
					|  |  | @ -65,12 +66,19 @@ public class SyncDataSetController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         syncDataSetEntity.setUpdateTime(new Date()); |  |  |  |         syncDataSetEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         syncDataSetEntity.setId(1); |  |  |  |         syncDataSetEntity.setId(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<SyncDataBustypeEntity> busTypes = syncDataSetResponse.getBusTypes(); |  |  |  |         List<SyncDataBustypeEntity> busTypes = syncDataSetResponse.getBusTypes(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //重新生成id防止插入时单据类型被覆盖
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SyncDataBustypeEntity s:busTypes) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             s.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         syncDataBustypeService.deleteAll(1); |  |  |  |         syncDataBustypeService.deleteAll(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(busTypes)) { |  |  |  |         if (CollUtil.isNotEmpty(busTypes)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             syncDataBustypeService.inserts(busTypes); |  |  |  |             syncDataBustypeService.inserts(busTypes); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<SyncDataBustypeEntity> toInBusTypes = syncDataSetResponse.getToInBusTypes(); |  |  |  |         List<SyncDataBustypeEntity> toInBusTypes = syncDataSetResponse.getToInBusTypes(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SyncDataBustypeEntity s : toInBusTypes) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             s.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         syncDataBustypeService.deleteAll(2); |  |  |  |         syncDataBustypeService.deleteAll(2); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(toInBusTypes)) { |  |  |  |         if (CollUtil.isNotEmpty(toInBusTypes)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             syncDataBustypeService.inserts(toInBusTypes); |  |  |  |             syncDataBustypeService.inserts(toInBusTypes); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |