diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/DemandScheduleServiceImpl.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/DemandScheduleServiceImpl.java index eb21b6c5f9..8c69a5bc17 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/DemandScheduleServiceImpl.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/DemandScheduleServiceImpl.java @@ -29,11 +29,8 @@ public class DemandScheduleServiceImpl implements BaseDemandScheduleService { public void updateDemandSyncScheduleConfig(List bugSyncConfigs, String projectId, String currentUser) { List syncCron = bugSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.CASE_RELATED_CONFIG.CASE_RELATED.name() + "_" + ProjectApplicationType.CASE_RELATED_CONFIG.CRON_EXPRESSION.name())).toList(); List caseEnable = bugSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.CASE_RELATED_CONFIG.CASE_RELATED.name() + "_" + ProjectApplicationType.CASE_RELATED_CONFIG.CASE_ENABLE.name())).toList(); - List syncEnable = bugSyncConfigs.stream().filter(config -> config.getType().equals(ProjectApplicationType.CASE_RELATED_CONFIG.CASE_RELATED.name() + "_" + ProjectApplicationType.CASE_RELATED_CONFIG.SYNC_ENABLE.name())).toList(); if (CollectionUtils.isNotEmpty(syncCron)) { - Boolean enableCase = Boolean.valueOf(caseEnable.getFirst().getTypeValue()); - Boolean enableSync = Boolean.valueOf(syncEnable.getFirst().getTypeValue()); - Boolean enable = enableCase && enableSync; + Boolean enable = Boolean.valueOf(caseEnable.getFirst().getTypeValue()); String typeValue = syncCron.getFirst().getTypeValue(); Schedule schedule = scheduleService.getScheduleByResource(projectId, DemandSyncJob.class.getName()); Optional optional = Optional.ofNullable(schedule); diff --git a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java index b1df71fcc4..35eb99ad0e 100644 --- a/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java +++ b/backend/services/project-management/src/test/java/io/metersphere/project/controller/ProjectApplicationControllerTests.java @@ -466,7 +466,6 @@ public class ProjectApplicationControllerTests extends BaseTest { Map configs = new HashMap<>(); configs.put("DEMAND_PLATFORM_CONFIG", jsonConfig); configs.put("CASE_ENABLE", "true"); - configs.put("SYNC_ENABLE", "true"); configs.put("CRON_EXPRESSION", "0 0 0 * * ?"); return configs; } @@ -476,7 +475,6 @@ public class ProjectApplicationControllerTests extends BaseTest { Map configs = new HashMap<>(); configs.put("DEMAND_PLATFORM_CONFIG", jsonConfig); configs.put("CASE_ENABLE", "false"); - configs.put("SYNC_ENABLE", "true"); configs.put("CRON_EXPRESSION", "0 0 0/1 * * ?"); return configs; } diff --git a/frontend/src/views/project-management/projectAndPermission/menuManagement/components/relatedCase.vue b/frontend/src/views/project-management/projectAndPermission/menuManagement/components/relatedCase.vue index daa69bcc0b..3f6a376a2c 100644 --- a/frontend/src/views/project-management/projectAndPermission/menuManagement/components/relatedCase.vue +++ b/frontend/src/views/project-management/projectAndPermission/menuManagement/components/relatedCase.vue @@ -35,38 +35,8 @@ :form-rule="platformRules" @mounted="handleMounted" /> - - - - - - - {{ t('project.menu.updateSync') }} - - - -
- -
-
-
- + @@ -147,12 +117,10 @@ const form = reactive({ PLATFORM_KEY: '', CASE_ENABLE: 'false', // 关联需求开关 - SYNC_ENABLE: 'false', // 同步开关 + SYNC_ENABLE: 'true', // 同步开关 CRON_EXPRESSION: '0 0 0 * * ?', // 同步频率 }); - const hasChange = ref(false); - const formCreateValue = ref>({}); const okDisabled = computed(() => !form.PLATFORM_KEY); @@ -241,7 +209,6 @@ // 如果平台key存在调用平台change拉取插件字段 await handlePlatformChange(res.platform_key); form.CASE_ENABLE = res.case_enable; - hasChange.value = res.sync_enable === 'true'; form.PLATFORM_KEY = res.platform_key; form.SYNC_ENABLE = res.sync_enable; form.CRON_EXPRESSION = res.cron_expression; @@ -267,12 +234,6 @@ setValue(); } - function handleSwitchChange(value: string | number | boolean) { - if (typeof value === 'string') { - hasChange.value = value === 'true'; - } - } - watch( () => props.visible, (val) => {