Browse Source

财政编码 可以为空

tags/24080901
PoffyZhang 1 year ago
parent
commit
4045fa0e13
2 changed files with 9 additions and 5 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java
  2. +8
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java View File

@@ -109,7 +109,7 @@ public class BeanConfig {
.build();
}

@Bean
@Bean(value = "projectThreadPool")
public ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setCorePoolSize(5);


+ 8
- 4
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java View File

@@ -35,6 +35,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -45,6 +46,8 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import javax.annotation.Resources;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
@@ -86,7 +89,8 @@ public class GovProjectCollectionManage {

private final WpsConvertManage wpsConvertManage;

private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Resource(name = "projectThreadPool")
private ThreadPoolTaskExecutor projectThreadPool;

@Value("${project.push-url}")
private String pushUrl;
@@ -441,7 +445,7 @@ public class GovProjectCollectionManage {
saveApply.setUpdateBy(user.getUsername());
saveApply.setUpdateOn(LocalDateTime.now());
if(projectApplyService.saveOrUpdate(saveApply)){
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply));
projectThreadPool.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply));
}
}

@@ -466,7 +470,7 @@ public class GovProjectCollectionManage {
saveApprove.setUpdateBy(user.getUsername());
saveApprove.setUpdateOn(LocalDateTime.now());
if(approveService.saveOrUpdate(saveApprove)){
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove));
projectThreadPool.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove));
}
}

@@ -492,7 +496,7 @@ public class GovProjectCollectionManage {
saveCimplement.setUpdateBy(user.getUsername());
saveCimplement.setUpdateOn(LocalDateTime.now());
if(cimplementService.saveOrUpdate(saveCimplement)){
threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement));
projectThreadPool.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement));
}
}



Loading…
Cancel
Save