diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java index daf2840..d850df4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java @@ -108,15 +108,4 @@ public class BeanConfig { .setRetryHandler(new DefaultHttpRequestRetryHandler(2, true)) .build(); } - - @Bean(value = "projectThreadPool") - public ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){ - ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); - threadPoolTaskExecutor.setCorePoolSize(5); - threadPoolTaskExecutor.setKeepAliveSeconds(200); - threadPoolTaskExecutor.setMaxPoolSize(10); - threadPoolTaskExecutor.setQueueCapacity(20); - threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - return threadPoolTaskExecutor; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java index fecfab9..c9e327f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java @@ -24,13 +24,12 @@ public interface RegionConst { * 丽水行政区划编码 */ String RC_LS = "331100"; + //丽水开发区 String LS_KF = "331118"; String LS_KF_IRS = "331151"; String RC_LS_SBJ_IRS = "331101"; //遂昌县 String RC_SC = "331123"; - //丽水开发区 - String LS_KF = "331118"; String LS_KF_NAME = "开发区"; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index 248662d..e994689 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -42,6 +42,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; @@ -89,8 +90,8 @@ public class GovProjectCollectionManage { private final WpsConvertManage wpsConvertManage; - @Resource(name = "projectThreadPool") - private ThreadPoolTaskExecutor projectThreadPool; + @Resource + private ThreadPoolTaskScheduler threadPoolTaskScheduler; @Value("${project.push-url}") private String pushUrl; @@ -445,7 +446,7 @@ public class GovProjectCollectionManage { saveApply.setUpdateBy(user.getUsername()); saveApply.setUpdateOn(LocalDateTime.now()); if(projectApplyService.saveOrUpdate(saveApply)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); } } @@ -470,7 +471,7 @@ public class GovProjectCollectionManage { saveApprove.setUpdateBy(user.getUsername()); saveApprove.setUpdateOn(LocalDateTime.now()); if(approveService.saveOrUpdate(saveApprove)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); } } @@ -496,7 +497,7 @@ public class GovProjectCollectionManage { saveCimplement.setUpdateBy(user.getUsername()); saveCimplement.setUpdateOn(LocalDateTime.now()); if(cimplementService.saveOrUpdate(saveCimplement)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); } }