diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java index bec55eb..c659751 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java +++ b/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 projectCodes) throws UnknownHostException { + collectionTask.doTaskSingle(projectCodes); + } + @PostMapping("/staging-convert-pdf") @ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段") @WebLog("主动转换库存的文件都为PDF文件") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index b58584a..1523149 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index 3bfc006..7c9f243 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/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)){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java index c69ee44..4433989 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java +++ b/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 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 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 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 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()); + } }