@@ -162,6 +162,13 @@ public class GovProjectCollectionController { | |||||
collectionTask.doTask(); | collectionTask.doTask(); | ||||
} | } | ||||
@PostMapping("/push-task-single") | |||||
@ApiOperation("主动调用定时器方法") | |||||
@WebLog("主动调用定时器方法") | |||||
public void pushTaskSingle(@RequestBody List<String> projectCodes) throws UnknownHostException { | |||||
collectionTask.doTaskSingle(projectCodes); | |||||
} | |||||
@PostMapping("/staging-convert-pdf") | @PostMapping("/staging-convert-pdf") | ||||
@ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段") | @ApiOperation("把库存的项目归集的文件 都转换成PDF文件存入字段") | ||||
@WebLog("主动转换库存的文件都为PDF文件") | @WebLog("主动转换库存的文件都为PDF文件") | ||||
@@ -193,6 +193,7 @@ public class GovProjectCollectionManage { | |||||
.gt(Objects.nonNull(req.getCreateOnMin()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMin()) | .gt(Objects.nonNull(req.getCreateOnMin()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMin()) | ||||
.le(Objects.nonNull(req.getCreateOnMax()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMax()) | .le(Objects.nonNull(req.getCreateOnMax()),GovBizProjectBaseinfo::getTongTime,req.getCreateOnMax()) | ||||
.eq(StringUtils.isNotBlank(req.getProjectType()),GovBizProjectBaseinfo::getBaseProjType,req.getProjectType()) | .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()), | .in(Objects.nonNull(req.getOldProjectType()) && ProjectTypeEnum.BUILD.getCode().equals(req.getOldProjectType()), | ||||
GovBizProjectBaseinfo::getBaseProjType, Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(), | GovBizProjectBaseinfo::getBaseProjType, Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(), | ||||
ProjectTypeNewEnum.SJ_BUILD.getCode(),ProjectTypeNewEnum.SZ_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()) | .gt(Objects.nonNull(req.getCreateOnMin()),GovOperationProjectBaseinfo::getTongTime,req.getCreateOnMin()) | ||||
.le(Objects.nonNull(req.getCreateOnMax()),GovOperationProjectBaseinfo::getTongTime,req.getCreateOnMax()) | .le(Objects.nonNull(req.getCreateOnMax()),GovOperationProjectBaseinfo::getTongTime,req.getCreateOnMax()) | ||||
.eq(StringUtils.isNotBlank(req.getProjectType()),GovOperationProjectBaseinfo::getBaseProjType,req.getProjectType()) | .eq(StringUtils.isNotBlank(req.getProjectType()),GovOperationProjectBaseinfo::getBaseProjType,req.getProjectType()) | ||||
.in(CollUtil.isNotEmpty(req.getProjectCodes()),GovOperationProjectBaseinfo::getBaseProjId,req.getProjectCodes()) | |||||
.eq(GovOperationProjectBaseinfo::getDeleted,Boolean.FALSE) | .eq(GovOperationProjectBaseinfo::getDeleted,Boolean.FALSE) | ||||
.orderByDesc(GovOperationProjectBaseinfo::getBizTime); | .orderByDesc(GovOperationProjectBaseinfo::getBizTime); | ||||
operationProjectBaseinfoService.page(page,wrapper); | operationProjectBaseinfoService.page(page,wrapper); | ||||
@@ -396,7 +396,7 @@ public class ProjectRenewalFundManage { | |||||
} | } | ||||
//判断金额 | //判断金额 | ||||
checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount()); | |||||
// checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount()); | |||||
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); | declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); | ||||
if(Objects.nonNull(project)){ | if(Objects.nonNull(project)){ | ||||
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.scheduler.task; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import cn.hutool.core.date.StopWatch; | import cn.hutool.core.date.StopWatch; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.file.service.FileService; | import com.ningdatech.file.service.FileService; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | import com.ningdatech.pmapi.common.constant.BizConst; | ||||
@@ -432,4 +433,58 @@ public class SynProjectCollectionTask { | |||||
procureService.updateById(procure); | 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()); | |||||
} | |||||
} | } |