Browse Source

debug 文件解析

tags/24080901
PoffyZhang 1 year ago
parent
commit
3421307c2f
2 changed files with 10 additions and 7 deletions
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  2. +8
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java View File

@@ -108,7 +108,7 @@ public class GovProjectCollectionController {
@PostMapping("/staging-convert-pdf") @PostMapping("/staging-convert-pdf")
@ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段") @ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段")
@WebLog("主动转换库存的文件都为PDF文件") @WebLog("主动转换库存的文件都为PDF文件")
public void stagingConvertPdf() {
collectionTask.stagingConvertPdf();
public void stagingConvertPdf(@PathVariable String projId) {
collectionTask.stagingConvertPdf(projId);
} }
} }

+ 8
- 5
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java View File

@@ -44,6 +44,8 @@ public class SynProjectCollectionTask {
private GovProjectCollectionManage collectionManage; private GovProjectCollectionManage collectionManage;


@Autowired @Autowired
private IGovBizProjectBaseinfoService baseinfoService;
@Autowired
private IGovBizProjectApplyService applyService; private IGovBizProjectApplyService applyService;
@Autowired @Autowired
private IGovBizProjectApproveService approveService; private IGovBizProjectApproveService approveService;
@@ -105,22 +107,23 @@ public class SynProjectCollectionTask {
/** /**
* 把库存的项目归集里 没有转换PDF文件的 都转换一遍 存入数据库 * 把库存的项目归集里 没有转换PDF文件的 都转换一遍 存入数据库
*/ */
public void stagingConvertPdf() {
public void stagingConvertPdf(String projId) {
log.info("项目归集库存转换PDF任务开始====="); log.info("项目归集库存转换PDF任务开始=====");
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
ProjectListReq req = new ProjectListReq(); ProjectListReq req = new ProjectListReq();
req.setPageNumber(1); req.setPageNumber(1);
req.setPageSize(BizConst.MAX_EXPORT_COUNT); req.setPageSize(BizConst.MAX_EXPORT_COUNT);
PageVo<GovBizProjectListVO> pageRes = collectionManage.list(req);
List<GovBizProjectBaseinfo> projects = baseinfoService.list(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectBaseinfo::getBaseProjId,projId));


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


Collection<GovBizProjectListVO> records = pageRes.getRecords();
for(GovBizProjectListVO project : records){
for(GovBizProjectBaseinfo project : projects){
//开始转换PDF //开始转换PDF
convertPdfVo(project.getBaseProjId()); convertPdfVo(project.getBaseProjId());
} }


Loading…
Cancel
Save