소스 검색

补PDF文件

tags/24080901
PoffyZhang 1 년 전
부모
커밋
531c2576f4
2개의 변경된 파일44개의 추가작업 그리고 0개의 파일을 삭제
  1. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  2. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java

+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java 파일 보기

@@ -111,4 +111,11 @@ public class GovProjectCollectionController {
public void stagingConvertPdf(@RequestParam(required = false) String projId) {
collectionTask.stagingConvertPdf(projId);
}

@PostMapping("/staging-convert-pdf2")
@ApiOperation("把库存的项目归集的文件approval_file重新转换")
@WebLog("把库存的项目归集的文件approval_file重新转换")
public void stagingConvertPdf2(@RequestParam(required = false) String projId) {
collectionTask.stagingConvertPdf2(projId);
}
}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java 파일 보기

@@ -135,6 +135,43 @@ public class SynProjectCollectionTask {
log.info("项目归集库存转换PDF任务结束====={}s",stopWatch.getTotalTimeSeconds());
}

public void stagingConvertPdf2(String projId) {
log.info("项目归集库存转换PDF任务2开始=====");
StopWatch stopWatch = new StopWatch();
stopWatch.start();
ProjectListReq req = new ProjectListReq();
req.setPageNumber(1);
req.setPageSize(BizConst.MAX_EXPORT_COUNT);
List<GovBizProjectApprove> projects = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectApprove::getBaseProjId,projId)
.isNotNull(GovBizProjectApprove::getApprovalFile)
.isNull(GovBizProjectApprove::getApprovalFilePdf));

if(CollUtil.isEmpty(projects)){
log.info("没有项目归集 任务终止");
return;
}

for(GovBizProjectApprove project : projects){
String baseProjId = project.getBaseProjId();
//开始转换PDF
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getBaseProjId,baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(approve)){
return;
}
if(StringUtils.isBlank(approve.getApprovalFilePdf()) && StringUtils.isNotBlank(approve.getApprovalFile())){
StringJoiner sj = collectionManage.convertAndUpload(approve.getApprovalFile());
approve.setApprovalFilePdf(sj.toString());
}
}

stopWatch.stop();
log.info("项目归集库存转换PDF任务2结束====={}s",stopWatch.getTotalTimeSeconds());
}

//开始转换PDF
private void convertPdfVo(String baseProjId) {
convertPdfApply(baseProjId);


불러오는 중...
취소
저장