瀏覽代碼

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


Loading…
取消
儲存