From 53ebfbbd12f883c24a1d757d5700a5247212f8a6 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 24 Apr 2025 11:54:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=B8=8E=E5=8F=91=E5=B8=83=E6=A8=A1=E5=9D=97=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B0=E9=87=8F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1406390524936192]集成与发布模块定时作业数量不对 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1406390524936192 --- ...ployAppModuleEnvAutoConfigInstanceApi.java | 1 + .../api/schedule/ListDeployScheduleApi.java | 130 +++++++++--------- .../dao/mapper/DeployAppConfigMapper.xml | 52 +++---- .../deploy/dao/mapper/DeployJobMapper.xml | 4 +- .../dao/mapper/DeployScheduleMapper.java | 2 +- .../dao/mapper/DeployScheduleMapper.xml | 26 +--- .../deploy/dao/mapper/DeployVersionMapper.xml | 5 +- .../schedule/plugin/DeployJobScheduleJob.java | 16 ++- 8 files changed, 116 insertions(+), 120 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/api/appconfig/env/SearchDeployAppModuleEnvAutoConfigInstanceApi.java b/src/main/java/neatlogic/module/deploy/api/appconfig/env/SearchDeployAppModuleEnvAutoConfigInstanceApi.java index 47cd7944..d8a08564 100644 --- a/src/main/java/neatlogic/module/deploy/api/appconfig/env/SearchDeployAppModuleEnvAutoConfigInstanceApi.java +++ b/src/main/java/neatlogic/module/deploy/api/appconfig/env/SearchDeployAppModuleEnvAutoConfigInstanceApi.java @@ -58,6 +58,7 @@ public class SearchDeployAppModuleEnvAutoConfigInstanceApi extends PrivateApiCom @Param(name = "appModuleId", type = ApiParamType.LONG, isRequired = true, desc = "模块 id"), @Param(name = "envId", type = ApiParamType.LONG, isRequired = true, desc = "环境 id"), @Param(name = "isAutoConfig", type = ApiParamType.INTEGER, desc = "是否有AutoConfig"), + @Param(name = "defaultValue", type = ApiParamType.JSONARRAY, desc = "默认值"), @Param(name = "currentPage", type = ApiParamType.INTEGER, desc = "当前页"), @Param(name = "pageSize", type = ApiParamType.INTEGER, desc = "每页数据条目"), @Param(name = "needPage", type = ApiParamType.BOOLEAN, desc = "是否需要分页,默认true") diff --git a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java index eaeb732e..017a1c59 100644 --- a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java +++ b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java @@ -106,83 +106,85 @@ public class ListDeployScheduleApi extends PrivateApiComponentBase { searchVo.setRowNum(rowNum); if (searchVo.getCurrentPage() <= searchVo.getPageCount()) { IAppSystemMapper appSystemMapper = CrossoverServiceFactory.getApi(IAppSystemMapper.class); - tbodyList = deployScheduleMapper.getScheduleList(searchVo); - List idList = tbodyList.stream().map(DeployScheduleVo::getId).collect(Collectors.toList()); - List scheduleAuditCountList = deployScheduleMapper.getScheduleAuditCountListByIdList(idList); - Map scheduleMap = scheduleAuditCountList.stream().collect(Collectors.toMap(e -> e.getId(), e -> e)); - Map appSystemMap = new HashMap<>(); - List appSystemIdList = tbodyList.stream().map(DeployScheduleVo::getAppSystemId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(appSystemIdList)) { - List appSystemList = appSystemMapper.getAppSystemListByIdList(appSystemIdList); - appSystemMap = appSystemList.stream().collect(Collectors.toMap(e -> e.getId(), e -> e)); - } - Map appModuleMap = new HashMap<>(); - List appModuleIdList = tbodyList.stream().map(DeployScheduleVo::getAppModuleId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(appModuleIdList)) { - List appModuleList = appSystemMapper.getAppModuleListByIdList(appModuleIdList); - appModuleMap = appModuleList.stream().collect(Collectors.toMap(e -> e.getId(), e -> e)); - } - List pipelineIdList = tbodyList.stream().map(DeployScheduleVo::getPipelineId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(pipelineIdList)) { - pipelineIdList = deployPipelineMapper.checkHasAuthPipelineIdList(pipelineIdList, userUuid); - } - boolean hasPipelineModify = AuthActionChecker.check(PIPELINE_MODIFY.class); - for (DeployScheduleVo scheduleVo : tbodyList) { - DeployScheduleVo scheduleAuditCount = scheduleMap.get(scheduleVo.getId()); - if (scheduleAuditCount != null) { - scheduleVo.setExecCount(scheduleAuditCount.getExecCount()); + List idList = deployScheduleMapper.getScheduleIdList(searchVo); + if (CollectionUtils.isNotEmpty(idList)) { + tbodyList = deployScheduleMapper.getScheduleListByIdList(idList); + List scheduleAuditCountList = deployScheduleMapper.getScheduleAuditCountListByIdList(idList); + Map scheduleMap = scheduleAuditCountList.stream().collect(Collectors.toMap(DeployScheduleVo::getId, e -> e)); + Map appSystemMap = new HashMap<>(); + List appSystemIdList = tbodyList.stream().map(DeployScheduleVo::getAppSystemId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appSystemIdList)) { + List appSystemList = appSystemMapper.getAppSystemListByIdList(appSystemIdList); + appSystemMap = appSystemList.stream().collect(Collectors.toMap(AppSystemVo::getId, e -> e)); } - String type = scheduleVo.getType(); - if (type.equals(ScheduleType.GENERAL.getValue())) { - Long appSystemId = scheduleVo.getAppSystemId(); - AppSystemVo appSystemVo = appSystemMap.get(appSystemId); - if (appSystemVo != null) { - scheduleVo.setAppSystemName(appSystemVo.getName()); - scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); - } - AppModuleVo appModuleVo = appModuleMap.get(scheduleVo.getAppModuleId()); - if (appModuleVo != null) { - scheduleVo.setAppModuleName(appModuleVo.getName()); - scheduleVo.setAppModuleAbbrName(appModuleVo.getAbbrName()); - } - DeployScheduleConfigVo config = scheduleVo.getConfig(); - Set actionSet = DeployAppAuthChecker.builder(appSystemId) - .addEnvAction(config.getEnvId()) - .addScenarioAction(config.getScenarioId()) - .check(); - if (actionSet.contains(config.getEnvId().toString()) && actionSet.contains(config.getScenarioId().toString())) { - scheduleVo.setEditable(1); - scheduleVo.setDeletable(1); - } - } else if(type.equals(ScheduleType.PIPELINE.getValue())) { - String name = deployPipelineMapper.getPipelineNameById(scheduleVo.getPipelineId()); - if (StringUtils.isNotBlank(name)) { - scheduleVo.setPipelineName(name); + Map appModuleMap = new HashMap<>(); + List appModuleIdList = tbodyList.stream().map(DeployScheduleVo::getAppModuleId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appModuleIdList)) { + List appModuleList = appSystemMapper.getAppModuleListByIdList(appModuleIdList); + appModuleMap = appModuleList.stream().collect(Collectors.toMap(AppModuleVo::getId, e -> e)); + } + List pipelineIdList = tbodyList.stream().map(DeployScheduleVo::getPipelineId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(pipelineIdList)) { + pipelineIdList = deployPipelineMapper.checkHasAuthPipelineIdList(pipelineIdList, userUuid); + } + boolean hasPipelineModify = AuthActionChecker.check(PIPELINE_MODIFY.class); + for (DeployScheduleVo scheduleVo : tbodyList) { + DeployScheduleVo scheduleAuditCount = scheduleMap.get(scheduleVo.getId()); + if (scheduleAuditCount != null) { + scheduleVo.setExecCount(scheduleAuditCount.getExecCount()); } - String pipelineType = scheduleVo.getPipelineType(); - if (pipelineType.equals(PipelineType.APPSYSTEM.getValue())) { + String type = scheduleVo.getType(); + if (type.equals(ScheduleType.GENERAL.getValue())) { Long appSystemId = scheduleVo.getAppSystemId(); AppSystemVo appSystemVo = appSystemMap.get(appSystemId); if (appSystemVo != null) { scheduleVo.setAppSystemName(appSystemVo.getName()); scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); } - if (pipelineIdList.contains(scheduleVo.getPipelineId())) { + AppModuleVo appModuleVo = appModuleMap.get(scheduleVo.getAppModuleId()); + if (appModuleVo != null) { + scheduleVo.setAppModuleName(appModuleVo.getName()); + scheduleVo.setAppModuleAbbrName(appModuleVo.getAbbrName()); + } + DeployScheduleConfigVo config = scheduleVo.getConfig(); + Set actionSet = DeployAppAuthChecker.builder(appSystemId) + .addEnvAction(config.getEnvId()) + .addScenarioAction(config.getScenarioId()) + .check(); + if (actionSet.contains(config.getEnvId().toString()) && actionSet.contains(config.getScenarioId().toString())) { scheduleVo.setEditable(1); scheduleVo.setDeletable(1); - } else { - Set actionSet = DeployAppAuthChecker.builder(appSystemId) - .addOperationAction(DeployAppConfigAction.PIPELINE.getValue()) - .check(); - if (actionSet.contains(DeployAppConfigAction.PIPELINE.getValue())) { + } + } else if(type.equals(ScheduleType.PIPELINE.getValue())) { + String name = deployPipelineMapper.getPipelineNameById(scheduleVo.getPipelineId()); + if (StringUtils.isNotBlank(name)) { + scheduleVo.setPipelineName(name); + } + String pipelineType = scheduleVo.getPipelineType(); + if (pipelineType.equals(PipelineType.APPSYSTEM.getValue())) { + Long appSystemId = scheduleVo.getAppSystemId(); + AppSystemVo appSystemVo = appSystemMap.get(appSystemId); + if (appSystemVo != null) { + scheduleVo.setAppSystemName(appSystemVo.getName()); + scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); + } + if (pipelineIdList.contains(scheduleVo.getPipelineId())) { + scheduleVo.setEditable(1); + scheduleVo.setDeletable(1); + } else { + Set actionSet = DeployAppAuthChecker.builder(appSystemId) + .addOperationAction(DeployAppConfigAction.PIPELINE.getValue()) + .check(); + if (actionSet.contains(DeployAppConfigAction.PIPELINE.getValue())) { + scheduleVo.setEditable(1); + scheduleVo.setDeletable(1); + } + } + } else if (pipelineType.equals(PipelineType.GLOBAL.getValue())) { + if (hasPipelineModify || pipelineIdList.contains(scheduleVo.getPipelineId())) { scheduleVo.setEditable(1); scheduleVo.setDeletable(1); } - } - } else if (pipelineType.equals(PipelineType.GLOBAL.getValue())) { - if (hasPipelineModify || pipelineIdList.contains(scheduleVo.getPipelineId())) { - scheduleVo.setEditable(1); - scheduleVo.setDeletable(1); } } } diff --git a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml index 38d4f728..ee01bf36 100644 --- a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml +++ b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml @@ -940,7 +940,10 @@ along with this program. If not, see .--> #{item} - + + AND + + and b.`config` is not NULL @@ -963,32 +966,29 @@ along with this program. If not, see .--> - - AND - (daca.app_system_id is null - OR - (daca.action_type = 'operation' - AND daca.action IN - ('all' - , - - #{item} - - - ) - AND daca.auth_uuid IN - ( - 'alluser' - - , - - #{item} - - - ) - ) - ) + (daca.app_system_id is null + OR + (daca.action_type = 'operation' + AND daca.action IN + ('all' + , + + #{item} + + ) + AND daca.auth_uuid IN + ( + 'alluser' + + , + + #{item} + + + ) + ) + ) SELECT - COUNT(1) + COUNT(DISTINCT a.`id`) FROM `deploy_schedule` a LEFT JOIN `deploy_app_config_authority` daca ON daca.`app_system_id` = a.`app_system_id` @@ -100,31 +100,15 @@ along with this program. If not, see .--> - SELECT - a.`id`, - a.`uuid`, - a.`name`, - a.`begin_time` AS beginTime, - a.`end_time` AS endTime, - a.`cron`, - a.`is_active` AS isActive, - a.`config` AS configStr, - a.`type`, - a.`fcd`, - a.`fcu`, - a.`lcd`, - a.`lcu`, - a.`app_system_id` AS appSystemId, - a.`app_module_id` AS appModuleId, - a.`pipeline_id` AS pipelineId, - a.`pipeline_type` AS pipelineType + DISTINCT a.`id` FROM `deploy_schedule` a LEFT JOIN `deploy_app_config_authority` daca ON daca.`app_system_id` = a.`app_system_id` - ORDER BY a.`lcd` + ORDER BY a.`id` LIMIT #{startNum}, #{pageSize} diff --git a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployVersionMapper.xml b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployVersionMapper.xml index d191a631..81cd4a4c 100644 --- a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployVersionMapper.xml +++ b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployVersionMapper.xml @@ -150,7 +150,10 @@ along with this program. If not, see .--> dv.`fcd` <= FROM_UNIXTIME(#{startTimeRange[1]}) ) - + + AND + + diff --git a/src/main/java/neatlogic/module/deploy/schedule/plugin/DeployJobScheduleJob.java b/src/main/java/neatlogic/module/deploy/schedule/plugin/DeployJobScheduleJob.java index 7723a043..d21d7a6c 100644 --- a/src/main/java/neatlogic/module/deploy/schedule/plugin/DeployJobScheduleJob.java +++ b/src/main/java/neatlogic/module/deploy/schedule/plugin/DeployJobScheduleJob.java @@ -33,6 +33,7 @@ import neatlogic.module.deploy.dao.mapper.DeployPipelineMapper; import neatlogic.module.deploy.dao.mapper.DeployScheduleMapper; import neatlogic.module.deploy.service.DeployBatchJobService; import neatlogic.module.deploy.service.DeployJobService; +import org.apache.commons.collections4.CollectionUtils; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; import org.springframework.stereotype.Component; @@ -98,12 +99,15 @@ public class DeployJobScheduleJob extends JobBase { int pageCount = searchVo.getPageCount(); for (int currentPage = 1; currentPage <= pageCount; currentPage++) { searchVo.setCurrentPage(currentPage); - List list = deployScheduleMapper.getScheduleList(searchVo); - for (DeployScheduleVo scheduleVo : list) { - JobObject.Builder jobObjectBuilder = new JobObject - .Builder(scheduleVo.getUuid(), this.getGroupName(), this.getClassName(), TenantContext.get().getTenantUuid()); - JobObject jobObject = jobObjectBuilder.build(); - this.reloadJob(jobObject); + List idList = deployScheduleMapper.getScheduleIdList(searchVo); + if (CollectionUtils.isNotEmpty(idList)) { + List list = deployScheduleMapper.getScheduleListByIdList(idList); + for (DeployScheduleVo scheduleVo : list) { + JobObject.Builder jobObjectBuilder = new JobObject + .Builder(scheduleVo.getUuid(), this.getGroupName(), this.getClassName(), TenantContext.get().getTenantUuid()); + JobObject jobObject = jobObjectBuilder.build(); + this.reloadJob(jobObject); + } } } } -- Gitee From 3d71daa32df4dd4a03063f5a8b9674137ad469eb Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 24 Apr 2025 12:03:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=B8=8E=E5=8F=91=E5=B8=83=E6=A8=A1=E5=9D=97=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B0=E9=87=8F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1406390524936192]集成与发布模块定时作业数量不对 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1406390524936192 --- .../api/schedule/ListDeployScheduleApi.java | 128 +++++++++--------- 1 file changed, 63 insertions(+), 65 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java index 017a1c59..ba6f7cfe 100644 --- a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java +++ b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java @@ -107,85 +107,83 @@ public class ListDeployScheduleApi extends PrivateApiComponentBase { if (searchVo.getCurrentPage() <= searchVo.getPageCount()) { IAppSystemMapper appSystemMapper = CrossoverServiceFactory.getApi(IAppSystemMapper.class); List idList = deployScheduleMapper.getScheduleIdList(searchVo); - if (CollectionUtils.isNotEmpty(idList)) { - tbodyList = deployScheduleMapper.getScheduleListByIdList(idList); - List scheduleAuditCountList = deployScheduleMapper.getScheduleAuditCountListByIdList(idList); - Map scheduleMap = scheduleAuditCountList.stream().collect(Collectors.toMap(DeployScheduleVo::getId, e -> e)); - Map appSystemMap = new HashMap<>(); - List appSystemIdList = tbodyList.stream().map(DeployScheduleVo::getAppSystemId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(appSystemIdList)) { - List appSystemList = appSystemMapper.getAppSystemListByIdList(appSystemIdList); - appSystemMap = appSystemList.stream().collect(Collectors.toMap(AppSystemVo::getId, e -> e)); - } - Map appModuleMap = new HashMap<>(); - List appModuleIdList = tbodyList.stream().map(DeployScheduleVo::getAppModuleId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(appModuleIdList)) { - List appModuleList = appSystemMapper.getAppModuleListByIdList(appModuleIdList); - appModuleMap = appModuleList.stream().collect(Collectors.toMap(AppModuleVo::getId, e -> e)); - } - List pipelineIdList = tbodyList.stream().map(DeployScheduleVo::getPipelineId).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(pipelineIdList)) { - pipelineIdList = deployPipelineMapper.checkHasAuthPipelineIdList(pipelineIdList, userUuid); + tbodyList = deployScheduleMapper.getScheduleListByIdList(idList); + List scheduleAuditCountList = deployScheduleMapper.getScheduleAuditCountListByIdList(idList); + Map scheduleMap = scheduleAuditCountList.stream().collect(Collectors.toMap(DeployScheduleVo::getId, e -> e)); + Map appSystemMap = new HashMap<>(); + List appSystemIdList = tbodyList.stream().map(DeployScheduleVo::getAppSystemId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appSystemIdList)) { + List appSystemList = appSystemMapper.getAppSystemListByIdList(appSystemIdList); + appSystemMap = appSystemList.stream().collect(Collectors.toMap(AppSystemVo::getId, e -> e)); + } + Map appModuleMap = new HashMap<>(); + List appModuleIdList = tbodyList.stream().map(DeployScheduleVo::getAppModuleId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appModuleIdList)) { + List appModuleList = appSystemMapper.getAppModuleListByIdList(appModuleIdList); + appModuleMap = appModuleList.stream().collect(Collectors.toMap(AppModuleVo::getId, e -> e)); + } + List pipelineIdList = tbodyList.stream().map(DeployScheduleVo::getPipelineId).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(pipelineIdList)) { + pipelineIdList = deployPipelineMapper.checkHasAuthPipelineIdList(pipelineIdList, userUuid); + } + boolean hasPipelineModify = AuthActionChecker.check(PIPELINE_MODIFY.class); + for (DeployScheduleVo scheduleVo : tbodyList) { + DeployScheduleVo scheduleAuditCount = scheduleMap.get(scheduleVo.getId()); + if (scheduleAuditCount != null) { + scheduleVo.setExecCount(scheduleAuditCount.getExecCount()); } - boolean hasPipelineModify = AuthActionChecker.check(PIPELINE_MODIFY.class); - for (DeployScheduleVo scheduleVo : tbodyList) { - DeployScheduleVo scheduleAuditCount = scheduleMap.get(scheduleVo.getId()); - if (scheduleAuditCount != null) { - scheduleVo.setExecCount(scheduleAuditCount.getExecCount()); + String type = scheduleVo.getType(); + if (type.equals(ScheduleType.GENERAL.getValue())) { + Long appSystemId = scheduleVo.getAppSystemId(); + AppSystemVo appSystemVo = appSystemMap.get(appSystemId); + if (appSystemVo != null) { + scheduleVo.setAppSystemName(appSystemVo.getName()); + scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); } - String type = scheduleVo.getType(); - if (type.equals(ScheduleType.GENERAL.getValue())) { + AppModuleVo appModuleVo = appModuleMap.get(scheduleVo.getAppModuleId()); + if (appModuleVo != null) { + scheduleVo.setAppModuleName(appModuleVo.getName()); + scheduleVo.setAppModuleAbbrName(appModuleVo.getAbbrName()); + } + DeployScheduleConfigVo config = scheduleVo.getConfig(); + Set actionSet = DeployAppAuthChecker.builder(appSystemId) + .addEnvAction(config.getEnvId()) + .addScenarioAction(config.getScenarioId()) + .check(); + if (actionSet.contains(config.getEnvId().toString()) && actionSet.contains(config.getScenarioId().toString())) { + scheduleVo.setEditable(1); + scheduleVo.setDeletable(1); + } + } else if(type.equals(ScheduleType.PIPELINE.getValue())) { + String name = deployPipelineMapper.getPipelineNameById(scheduleVo.getPipelineId()); + if (StringUtils.isNotBlank(name)) { + scheduleVo.setPipelineName(name); + } + String pipelineType = scheduleVo.getPipelineType(); + if (pipelineType.equals(PipelineType.APPSYSTEM.getValue())) { Long appSystemId = scheduleVo.getAppSystemId(); AppSystemVo appSystemVo = appSystemMap.get(appSystemId); if (appSystemVo != null) { scheduleVo.setAppSystemName(appSystemVo.getName()); scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); } - AppModuleVo appModuleVo = appModuleMap.get(scheduleVo.getAppModuleId()); - if (appModuleVo != null) { - scheduleVo.setAppModuleName(appModuleVo.getName()); - scheduleVo.setAppModuleAbbrName(appModuleVo.getAbbrName()); - } - DeployScheduleConfigVo config = scheduleVo.getConfig(); - Set actionSet = DeployAppAuthChecker.builder(appSystemId) - .addEnvAction(config.getEnvId()) - .addScenarioAction(config.getScenarioId()) - .check(); - if (actionSet.contains(config.getEnvId().toString()) && actionSet.contains(config.getScenarioId().toString())) { + if (pipelineIdList.contains(scheduleVo.getPipelineId())) { scheduleVo.setEditable(1); scheduleVo.setDeletable(1); - } - } else if(type.equals(ScheduleType.PIPELINE.getValue())) { - String name = deployPipelineMapper.getPipelineNameById(scheduleVo.getPipelineId()); - if (StringUtils.isNotBlank(name)) { - scheduleVo.setPipelineName(name); - } - String pipelineType = scheduleVo.getPipelineType(); - if (pipelineType.equals(PipelineType.APPSYSTEM.getValue())) { - Long appSystemId = scheduleVo.getAppSystemId(); - AppSystemVo appSystemVo = appSystemMap.get(appSystemId); - if (appSystemVo != null) { - scheduleVo.setAppSystemName(appSystemVo.getName()); - scheduleVo.setAppSystemAbbrName(appSystemVo.getAbbrName()); - } - if (pipelineIdList.contains(scheduleVo.getPipelineId())) { - scheduleVo.setEditable(1); - scheduleVo.setDeletable(1); - } else { - Set actionSet = DeployAppAuthChecker.builder(appSystemId) - .addOperationAction(DeployAppConfigAction.PIPELINE.getValue()) - .check(); - if (actionSet.contains(DeployAppConfigAction.PIPELINE.getValue())) { - scheduleVo.setEditable(1); - scheduleVo.setDeletable(1); - } - } - } else if (pipelineType.equals(PipelineType.GLOBAL.getValue())) { - if (hasPipelineModify || pipelineIdList.contains(scheduleVo.getPipelineId())) { + } else { + Set actionSet = DeployAppAuthChecker.builder(appSystemId) + .addOperationAction(DeployAppConfigAction.PIPELINE.getValue()) + .check(); + if (actionSet.contains(DeployAppConfigAction.PIPELINE.getValue())) { scheduleVo.setEditable(1); scheduleVo.setDeletable(1); } } + } else if (pipelineType.equals(PipelineType.GLOBAL.getValue())) { + if (hasPipelineModify || pipelineIdList.contains(scheduleVo.getPipelineId())) { + scheduleVo.setEditable(1); + scheduleVo.setDeletable(1); + } } } } -- Gitee From 7d2c12000c3234af1822d60e9c808b6f925f3211 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 24 Apr 2025 12:04:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=B8=8E=E5=8F=91=E5=B8=83=E6=A8=A1=E5=9D=97=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=95=B0=E9=87=8F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1406390524936192]集成与发布模块定时作业数量不对 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1406390524936192 --- .../module/deploy/api/schedule/ListDeployScheduleApi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java index ba6f7cfe..fada341f 100644 --- a/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java +++ b/src/main/java/neatlogic/module/deploy/api/schedule/ListDeployScheduleApi.java @@ -104,9 +104,9 @@ public class ListDeployScheduleApi extends PrivateApiComponentBase { int rowNum = deployScheduleMapper.getScheduleCount(searchVo); if (rowNum > 0) { searchVo.setRowNum(rowNum); - if (searchVo.getCurrentPage() <= searchVo.getPageCount()) { - IAppSystemMapper appSystemMapper = CrossoverServiceFactory.getApi(IAppSystemMapper.class); - List idList = deployScheduleMapper.getScheduleIdList(searchVo); + IAppSystemMapper appSystemMapper = CrossoverServiceFactory.getApi(IAppSystemMapper.class); + List idList = deployScheduleMapper.getScheduleIdList(searchVo); + if (CollectionUtils.isNotEmpty(idList)) { tbodyList = deployScheduleMapper.getScheduleListByIdList(idList); List scheduleAuditCountList = deployScheduleMapper.getScheduleAuditCountListByIdList(idList); Map scheduleMap = scheduleAuditCountList.stream().collect(Collectors.toMap(DeployScheduleVo::getId, e -> e)); -- Gitee