瀏覽代碼

项目归集 推送 支持 指定编号 推送

master
PoffyZhang 11 月之前
父節點
當前提交
8b56c8869c
共有 4 個檔案被更改,包括 65 行新增1 行删除
  1. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  2. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  4. +55
    -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 查看文件

@@ -162,6 +162,13 @@ public class GovProjectCollectionController {
collectionTask.doTask();
}

@PostMapping("/push-task-single")
@ApiOperation("主动调用定时器方法")
@WebLog("主动调用定时器方法")
public void pushTaskSingle(@RequestBody List<String> projectCodes) throws UnknownHostException {
collectionTask.doTaskSingle(projectCodes);
}

@PostMapping("/staging-convert-pdf")
@ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段")
@WebLog("主动转换库存的文件都为PDF文件")


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java 查看文件

@@ -193,6 +193,7 @@ public class GovProjectCollectionManage {
.gt(Objects.nonNull(req.getCreateOnMin()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()),GovBizProjectBaseinfo::getBaseProjType,req.getProjectType())
.in(CollUtil.isNotEmpty(req.getProjectCodes()),GovBizProjectBaseinfo::getBaseProjId,req.getProjectCodes())
.in(Objects.nonNull(req.getOldProjectType()) && ProjectTypeEnum.BUILD.getCode().equals(req.getOldProjectType()),
GovBizProjectBaseinfo::getBaseProjType, Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(),
ProjectTypeNewEnum.SJ_BUILD.getCode(),ProjectTypeNewEnum.SZ_BUILD.getCode()))
@@ -256,6 +257,7 @@ public class GovProjectCollectionManage {
.gt(Objects.nonNull(req.getCreateOnMin()),GovOperationProjectBaseinfo::getTongTime,req.getCreateOnMin())
.le(Objects.nonNull(req.getCreateOnMax()),GovOperationProjectBaseinfo::getTongTime,req.getCreateOnMax())
.eq(StringUtils.isNotBlank(req.getProjectType()),GovOperationProjectBaseinfo::getBaseProjType,req.getProjectType())
.in(CollUtil.isNotEmpty(req.getProjectCodes()),GovOperationProjectBaseinfo::getBaseProjId,req.getProjectCodes())
.eq(GovOperationProjectBaseinfo::getDeleted,Boolean.FALSE)
.orderByDesc(GovOperationProjectBaseinfo::getBizTime);
operationProjectBaseinfoService.page(page,wrapper);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java 查看文件

@@ -396,7 +396,7 @@ public class ProjectRenewalFundManage {
}

//判断金额
checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount());
// checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount());

declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
if(Objects.nonNull(project)){


+ 55
- 0
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java 查看文件

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.scheduler.task;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.common.constant.BizConst;
@@ -432,4 +433,58 @@ public class SynProjectCollectionTask {
procureService.updateById(procure);
}
}

public void doTaskSingle(List<String> projectCodes) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();

log.info("数据同步任务 指定项目编号 :{}",projectCodes);

if(CollUtil.isEmpty(projectCodes)){
throw new BizException("不能为空!");
}

//全量项目归集
ProjectListReq req = new ProjectListReq();
req.setPageNumber(PAGE_NUMBER);
req.setPageSize(1000);
PageVo<GovBizProjectListVO> projectCollectionPage = collectionManage.list(req);

log.info("projectCollections size :{}",projectCollectionPage.getTotal());

for(GovBizProjectListVO vo : projectCollectionPage.getRecords()){
GovBizProjectDetailVO projectDetail = collectionManage.detail(vo.getBaseProjId());
collectionManage.pushProjectVo(projectDetail);
}

//2.运维备案项目
PageVo<GovBizProjectListVO> operationList = collectionManage.operationList(req);
log.info("operation list size :{}",operationList.getTotal());
for(GovBizProjectListVO vo : operationList.getRecords()){
GovOperationProjectDetailVO operationDetail = collectionManage.operationDetail(vo.getBaseProjId());
GovOperationProjectBaseinfoVO baseinfo = operationDetail.getBaseinfo();
if(Objects.isNull(baseinfo) || Objects.isNull(baseinfo.getPush()) ||
Boolean.FALSE.equals(baseinfo.getPush())){
log.info("此运维项目不用推送:" + vo.getBaseProjId());
}
collectionManage.pushProjectVo(operationDetail);
}

//3.申报项目 需要推送的项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest,Boolean.TRUE)
.eq(Project::getPush,Boolean.TRUE)
.in(Project::getProjectCode,projectCodes));
log.info("projects need push size :{}",projects.size());
for(Project project : projects){
ProjectDetailVO projectDetailVO = projectLibManage.detailProjectCode(project.getProjectCode());
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO,fileService);
if(Objects.nonNull(vo)){
collectionManage.pushProjectVo(vo);
}
}

stopWatch.stop();
log.info("数据同步任务 指定项目编号 结束====={}s",stopWatch.getTotalTimeSeconds());
}
}

Loading…
取消
儲存