From 616d8898b40a2bb6f784495bb21a569b69f2434a Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Mon, 24 Oct 2022 13:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E5=8A=9F=E8=83=BD=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permission2/SystemAbilityController.java | 30 +++++++++---------- .../permission/SystemAbilityService.java | 2 ++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/club/joylink/rtss/controller/permission2/SystemAbilityController.java b/src/main/java/club/joylink/rtss/controller/permission2/SystemAbilityController.java index 4721c687d..559005c0e 100644 --- a/src/main/java/club/joylink/rtss/controller/permission2/SystemAbilityController.java +++ b/src/main/java/club/joylink/rtss/controller/permission2/SystemAbilityController.java @@ -22,45 +22,45 @@ import static club.joylink.rtss.controller.advice.AuthenticateInterceptor.LOGIN_ public class SystemAbilityController { @Autowired private SystemAbilityService abilityService; - /** + /* * 添加权限功能 */ - @PostMapping("/basic") + /*@PostMapping("/basic") public void addAbility(@RequestBody BasicSystemAbilityVo req, @RequestAttribute(value = LOGIN_INFO_KEY) LoginUserInfoVO userInfoVO){ this.abilityService.saveOrUpdateBasicAbility(req,userInfoVO); - } - /** + }*/ + /* * 修改权限功能的名称和描述 */ - @PutMapping("/basic") +/* @PutMapping("/basic") public void updateAbilityBasic(@RequestBody BasicSystemAbilityVo req,@RequestAttribute(value = LOGIN_INFO_KEY) LoginUserInfoVO userInfoVO){ this.abilityService.saveOrUpdateBasicAbility(req,userInfoVO); - } - /** + }*/ + /* * 修改权限功能的类型和关联的具体功能 */ - @PutMapping("/function") +/* @PutMapping("/function") public void updateAbilityTypeAndFunc(@RequestBody UpdateAbilityFunctionReqVo req){ this.abilityService.updateTypeAndFunc(req); - } + }*/ - /** + /* * 全部添加 * @param vo * @param userInfoVO */ - @PostMapping("/save") + /*@PostMapping("/save") public void autoCreateAbility(@RequestBody AutoCreateSystemAbilityReqVo vo, @RequestAttribute(value = LOGIN_INFO_KEY) LoginUserInfoVO userInfoVO){ this.abilityService.autoCreateAbility(vo,userInfoVO.getAccountVO().getId()); - } - /** + }*/ + /* * 删除权限功能,注意对于已经启用的不能删除 * @return 返回成功删除的权限功能的id列表 */ - @DeleteMapping +/* @DeleteMapping public void deleteAbilities(@RequestBody DeleteAbilitiesReqVo req){ this.abilityService.remove(req); - } + }*/ /** * 根据权限功能的id查询完整信息 */ diff --git a/src/main/java/club/joylink/rtss/services/permission/SystemAbilityService.java b/src/main/java/club/joylink/rtss/services/permission/SystemAbilityService.java index b3abfe3c3..c1eaf0ca9 100644 --- a/src/main/java/club/joylink/rtss/services/permission/SystemAbilityService.java +++ b/src/main/java/club/joylink/rtss/services/permission/SystemAbilityService.java @@ -135,11 +135,13 @@ public class SystemAbilityService { public void remove(DeleteAbilitiesReqVo reqVo){ BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(!CollectionUtils.isEmpty(reqVo.getIds()),"删除数据的id不能为空"); List newIds = reqVo.getIds().stream().distinct().collect(Collectors.toList()); + PermissionSystemAbilityExample pe = new PermissionSystemAbilityExample(); pe.createCriteria().andSystemAbilityIdIn(newIds); List psaList = this.permissionSystemAbilityDAO.selectByExample(pe); Map> psaMapList = psaList.stream() .collect(Collectors.groupingBy(PermissionSystemAbility::getSystemAbilityId)); + StringBuilder sb = new StringBuilder(); psaMapList.forEach((k,v)->{ sb.append(String.format("id=%s有绑定的权限数量=%s,不能删除",k,v.size()));