refactor(系统设置): 权限增加license

This commit is contained in:
wxg0103 2024-05-29 15:50:18 +08:00 committed by 刘瑞斌
parent 1d91d6adc7
commit 8b30364300
3 changed files with 26 additions and 15 deletions

View File

@ -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<FunctionalCaseDemand> 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<DemandDTO> demandDTOList, FunctionalCaseDemandRequest request, String userId, List<FunctionalCaseDemand> existDemands, FunctionalCaseDemandMapper functionalCaseDemandMapper) {
Map<String, List<FunctionalCaseDemand>> existMap = existDemands.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getDemandId));
Map<String, List<FunctionalCaseDemand>> existParentMap = existDemands.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getParent));
Map<String, List<DemandDTO>> insertMap = demandDTOList.stream().filter(t->StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(DemandDTO::getDemandId));
Map<String, List<FunctionalCaseDemand>> existMap = existDemands.stream().filter(t -> StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getDemandId));
Map<String, List<FunctionalCaseDemand>> existParentMap = existDemands.stream().filter(t -> StringUtils.isNotBlank(t.getDemandId())).collect(Collectors.groupingBy(FunctionalCaseDemand::getParent));
Map<String, List<DemandDTO>> 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<PlatformDemandDTO> 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());

View File

@ -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",

View File

@ -63,7 +63,7 @@
// ids
const firstLevelAllIds = computed(() => {
if (isHasChildren) {
if (isHasChildren.value) {
return props.currentData.map((item) => item[props.rowKey]);
}
return [];