From 6d97f71040026129574b97d45bc62e11e60ccb37 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 23 Oct 2023 15:47:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=94=BB=E5=83=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/dashboard/handle/ApplicationHandler.java | 15 +++++++++------ .../scheduler/task/CheckProvincialReviewResultTask.java | 8 ++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/ApplicationHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/ApplicationHandler.java index 8aaf1c8..39c36ea 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/ApplicationHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/dashboard/handle/ApplicationHandler.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Component; import java.util.List; import java.util.Map; +import java.util.Objects; /** * @Classname ApplicationHandler @@ -42,12 +43,14 @@ public class ApplicationHandler { generateOutputEntity(DashboardConstant.Protrait.PROJECT_SIGNS)); //2.查询应用 Project project = projectService.getProjectByCode(projectCode); - List apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectVersion, project.getVersion()) - .eq(ProjectApplication::getProjectCode, projectCode)); - for(ProjectApplication app : apps){ - String appName = StringUtils.isNotBlank(app.getApplicationName()) ? app.getApplicationName() : app.getRelatedExistsApplication(); - res.put(appName,generateOutputEntity(appName)); + if(Objects.nonNull(project)){ + List apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) + .eq(ProjectApplication::getProjectVersion, project.getVersion()) + .eq(ProjectApplication::getProjectCode, projectCode)); + for(ProjectApplication app : apps){ + String appName = StringUtils.isNotBlank(app.getApplicationName()) ? app.getApplicationName() : app.getRelatedExistsApplication(); + res.put(appName,generateOutputEntity(appName)); + } } return res; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java index 9edd232..99661f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java @@ -5,6 +5,7 @@ import cn.hutool.http.HttpStatus; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; @@ -47,8 +48,15 @@ public class CheckProvincialReviewResultTask { @Value("${hostname}") private String HOST_NAME; + @Value("${spring.profiles.active}") + private String active; + @Scheduled(cron = "0 */1 * * * ?") public void statusFlow() throws UnknownHostException { + if(BizConst.DEV.equals(active)){ + log.info("测试环境 省局 接口 暂时关闭"); + return; + } // if (HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) { //1. 定时取 省级部门联审中的项目 去取项目