|  |  | @ -3,10 +3,13 @@ package com.glxp.api.admin.thread; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.collection.CollUtil; |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.json.JSONUtil; |  |  |  | import cn.hutool.json.JSONUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.constant.BasicProcessStatus; |  |  |  | import com.glxp.api.admin.constant.BasicProcessStatus; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.admin.constant.ThirdSysConstant; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.dao.basic.BasicThirdSysDao; |  |  |  | import com.glxp.api.admin.dao.basic.BasicThirdSysDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.admin.dao.basic.BasicThirdSysDetailDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.dao.schedule.ScheduledDao; |  |  |  | import com.glxp.api.admin.dao.schedule.ScheduledDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.dao.schedule.SystemParamConfigDao; |  |  |  | import com.glxp.api.admin.dao.schedule.SystemParamConfigDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity; |  |  |  | import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity; |  |  |  | import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.entity.info.ScheduledEntity; |  |  |  | import com.glxp.api.admin.entity.info.ScheduledEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.admin.entity.info.SystemParamConfigEntity; |  |  |  | import com.glxp.api.admin.entity.info.SystemParamConfigEntity; | 
			
		
	
	
		
		
			
				
					|  |  | @ -62,6 +65,8 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |     private ErpBasicClient erpBasicClient; |  |  |  |     private ErpBasicClient erpBasicClient; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     private BussinessOriginTypeService bussinessOriginTypeService; |  |  |  |     private BussinessOriginTypeService bussinessOriginTypeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private BasicThirdSysDetailDao basicThirdSysDetailDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { |  |  |  |     public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -90,7 +95,9 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<String> thirdIds = basicThirdSysDao.selectEnabledThirdId(); |  |  |  |         List<String> thirdIds = basicThirdSysDao.selectEnabledThirdId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(thirdIds)) { |  |  |  |         if (CollUtil.isNotEmpty(thirdIds)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             for (String thirdId : thirdIds) { |  |  |  |             for (String thirdId : thirdIds) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                 //查询此系统的仓库仓位码配置详情
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BasicThirdSysDetailEntity warehouseConfig = basicThirdSysDetailDao.selectByKey(ThirdSysConstant.WAREHOUSE_QUERY_URL, thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (null != warehouseConfig && warehouseConfig.getFromType().equals(3) && warehouseConfig.getEnabled()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("自动下载第三方系统为:{} 的基础数据", thirdId); |  |  |  |                     log.info("自动下载第三方系统为:{} 的基础数据", thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("开始下载第三方系统的仓库数据"); |  |  |  |                     log.info("开始下载第三方系统的仓库数据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     BaseResponse baseResponse = thrInvWarehouseService.downloadThirdWarehouse(thirdId); |  |  |  |                     BaseResponse baseResponse = thrInvWarehouseService.downloadThirdWarehouse(thirdId); | 
			
		
	
	
		
		
			
				
					|  |  | @ -100,7 +107,10 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         log.info(thirdId + " 仓库数据下载失败"); |  |  |  |                         log.info(thirdId + " 仓库数据下载失败"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         log.error(JSONUtil.toJsonStr(baseResponse)); |  |  |  |                         log.error(JSONUtil.toJsonStr(baseResponse)); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BasicThirdSysDetailEntity corpConfig = basicThirdSysDetailDao.selectByKey(ThirdSysConstant.CORP_URL, thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (null != corpConfig && corpConfig.getFromType().equals(3) && corpConfig.getEnabled()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("开始下载第三方系统的往来单位数据"); |  |  |  |                     log.info("开始下载第三方系统的往来单位数据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     ThrCorpImportLogEntity thrCorpImportLogEntity = new ThrCorpImportLogEntity(); |  |  |  |                     ThrCorpImportLogEntity thrCorpImportLogEntity = new ThrCorpImportLogEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     String genKey = CustomUtil.getId(); |  |  |  |                     String genKey = CustomUtil.getId(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -112,7 +122,10 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity); |  |  |  |                     thrCorpImportLogService.insertImportLog(thrCorpImportLogEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thrCorpsDlService.importCorps(genKey, null, thirdId); |  |  |  |                     thrCorpsDlService.importCorps(genKey, null, thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("第三方系统往来单位数据下载完成"); |  |  |  |                     log.info("第三方系统往来单位数据下载完成"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BasicThirdSysDetailEntity productConfig = basicThirdSysDetailDao.selectByKey(ThirdSysConstant.PI_QUERY_URL, thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (null != productConfig && productConfig.getFromType().equals(3) && productConfig.getEnabled()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("开始下载第三方系统的产品信息数据"); |  |  |  |                     log.info("开始下载第三方系统的产品信息数据"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     ThrProductsImportLogEntity thrProductsImportLogEntity = new ThrProductsImportLogEntity(); |  |  |  |                     ThrProductsImportLogEntity thrProductsImportLogEntity = new ThrProductsImportLogEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     String genKey1 = CustomUtil.getId(); |  |  |  |                     String genKey1 = CustomUtil.getId(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -129,7 +142,10 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     filterThrProductsRequest.setLimit(100); |  |  |  |                     filterThrProductsRequest.setLimit(100); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thrProductsDlService.importProducrs(genKey1, filterThrProductsRequest); |  |  |  |                     thrProductsDlService.importProducrs(genKey1, filterThrProductsRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("第三方系统往来产品信息数据下载完成"); |  |  |  |                     log.info("第三方系统往来产品信息数据下载完成"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 BasicThirdSysDetailEntity busConfig = basicThirdSysDetailDao.selectByKey(ThirdSysConstant.BUS_TYPE_QUERY_URL, thirdId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (null != busConfig && busConfig.getFromType().equals(3) && busConfig.getEnabled()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     log.info("开始下载第三方系统单据类型"); |  |  |  |                     log.info("开始下载第三方系统单据类型"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest = new FilterBasicThirdSysDetailRequest(); |  |  |  |                     FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest = new FilterBasicThirdSysDetailRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     filterBasicThirdSysDetailRequest.setThirdSysFk(thirdId); |  |  |  |                     filterBasicThirdSysDetailRequest.setThirdSysFk(thirdId); | 
			
		
	
	
		
		
			
				
					|  |  | @ -167,6 +183,8 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         log.info("第三方系统往来产品信息数据下载完成"); |  |  |  |                         log.info("第三方系统往来产品信息数据下载完成"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |