From 8b303643000e6da74b11d55d4a0e488bb8999842 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 29 May 2024 15:50:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E6=9D=83=E9=99=90=E5=A2=9E=E5=8A=A0license?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/FunctionalCaseDemandService.java | 15 +++++++----- .../src/main/resources/permission.json | 24 ++++++++++++------- .../components/pure/ms-table/select-all.vue | 2 +- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java index d77640ddea..b0dba7e8b1 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseDemandService.java @@ -210,7 +210,10 @@ public class FunctionalCaseDemandService { * @param id 需求关系ID */ public void deleteDemand(String id) { - FunctionalCaseDemand functionalCaseDemandInDb= functionalCaseDemandMapper.selectByPrimaryKey(id); + FunctionalCaseDemand functionalCaseDemandInDb = functionalCaseDemandMapper.selectByPrimaryKey(id); + if (functionalCaseDemandInDb == null) { + return; + } FunctionalCaseDemandExample functionalCaseDemandExample = new FunctionalCaseDemandExample(); functionalCaseDemandExample.createCriteria().andParentEqualTo(functionalCaseDemandInDb.getDemandId()); List functionalCaseDemands = functionalCaseDemandMapper.selectByExample(functionalCaseDemandExample); @@ -254,16 +257,16 @@ public class FunctionalCaseDemandService { functionalCaseDemandRequest.setCaseId(t); functionalCaseDemandRequest.setDemandPlatform(request.getDemandPlatform()); //过滤已存在的 - insertDemand(demandDTOList, functionalCaseDemandRequest, userId, existDemands, functionalCaseDemandMapper); + insertDemand(demandDTOList, functionalCaseDemandRequest, userId, existDemands, functionalCaseDemandMapper); }); sqlSession.flushStatements(); SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory); } private void insertDemand(List demandDTOList, FunctionalCaseDemandRequest request, String userId, List existDemands, FunctionalCaseDemandMapper functionalCaseDemandMapper) { - Map> existMap = existDemands.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getDemandId)); - Map> existParentMap = existDemands.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getParent)); - Map> insertMap = demandDTOList.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(DemandDTO::getDemandId)); + Map> existMap = existDemands.stream().filter(t -> StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getDemandId)); + Map> existParentMap = existDemands.stream().filter(t -> StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getParent)); + Map> insertMap = demandDTOList.stream().filter(t -> StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(DemandDTO::getDemandId)); for (DemandDTO demandDTO : demandDTOList) { FunctionalCaseDemand functionalCaseDemand = buildFunctionalCaseDemand(request.getCaseId(), request.getDemandPlatform(), userId, demandDTO); @@ -348,7 +351,7 @@ public class FunctionalCaseDemandService { public PluginPager pageDemand(FunctionalThirdDemandPageRequest request) { DemandPageRequest demandPageRequest = new DemandPageRequest(); - demandPageRequest.setQuery(StringUtils.replace(request.getKeyword(),"\\","")); + demandPageRequest.setQuery(StringUtils.replace(request.getKeyword(), "\\", "")); demandPageRequest.setFilter(request.getFilter()); demandPageRequest.setStartPage(request.getCurrent()); demandPageRequest.setPageSize(request.getPageSize()); diff --git a/backend/services/system-setting/src/main/resources/permission.json b/backend/services/system-setting/src/main/resources/permission.json index cbf69410ba..2490d8f101 100644 --- a/backend/services/system-setting/src/main/resources/permission.json +++ b/backend/services/system-setting/src/main/resources/permission.json @@ -84,7 +84,8 @@ "id": "SYSTEM_TEST_RESOURCE_POOL:READ" }, { - "id": "SYSTEM_TEST_RESOURCE_POOL:READ+ADD" + "id": "SYSTEM_TEST_RESOURCE_POOL:READ+ADD", + "license": true }, { "id": "SYSTEM_TEST_RESOURCE_POOL:READ+UPDATE" @@ -126,27 +127,33 @@ }, { "id": "SYSTEM_PARAMETER_SETTING_DISPLAY:READ", - "name": "permission.system_parameter_setting_display.read" + "name": "permission.system_parameter_setting_display.read", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_DISPLAY:READ+UPDATE", - "name": "permission.system_parameter_setting_display.update" + "name": "permission.system_parameter_setting_display.update", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_AUTH:READ", - "name": "permission.system_parameter_setting_auth.read" + "name": "permission.system_parameter_setting_auth.read", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_AUTH:READ+ADD", - "name": "permission.system_parameter_setting_auth.add" + "name": "permission.system_parameter_setting_auth.add", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_AUTH:READ+UPDATE", - "name": "permission.system_parameter_setting_auth.update" + "name": "permission.system_parameter_setting_auth.update", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_AUTH:READ+DELETE", - "name": "permission.system_parameter_setting_auth.delete" + "name": "permission.system_parameter_setting_auth.delete", + "license": true }, { "id": "SYSTEM_PARAMETER_SETTING_MEMORY_CLEAN:READ", @@ -168,7 +175,8 @@ { "id": "SYSTEM_AUTH:READ+UPDATE" } - ] + ], + "license": true }, { "id": "SYSTEM_LOG", diff --git a/frontend/src/components/pure/ms-table/select-all.vue b/frontend/src/components/pure/ms-table/select-all.vue index c9367d7464..964e1e6d05 100644 --- a/frontend/src/components/pure/ms-table/select-all.vue +++ b/frontend/src/components/pure/ms-table/select-all.vue @@ -63,7 +63,7 @@ // 获取数据第一层级的ids,用来判断全选或者半选 const firstLevelAllIds = computed(() => { - if (isHasChildren) { + if (isHasChildren.value) { return props.currentData.map((item) => item[props.rowKey]); } return [];