Browse Source

补PDF文件

master
PoffyZhang 1 year ago
parent
commit
531c2576f4
2 changed files with 44 additions and 0 deletions
  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 View File

@@ -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 View File

@@ -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);


Loading…
Cancel
Save