|
|
@@ -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()); |
|
|
|
} |
|
|
|
} |