|
|
@@ -407,16 +407,32 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
|
|
|
@PassToken
|
|
|
@DESRespondSecret(validated = true)
|
|
|
public CommonResult delSmartAuthorGroup(Integer id) {
|
|
|
+ QueryWrapper<SmartAuthorGroup> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("parent_id", id);
|
|
|
+ queryWrapper1.eq("deleted",0);
|
|
|
+ List<SmartAuthorGroup> list1 = smartAuthorGroupService.getAuthorGroupByKey(queryWrapper1);
|
|
|
SmartAuthorGroup rns = new SmartAuthorGroup();
|
|
|
rns.setId(id);
|
|
|
rns.setDeleted(1);
|
|
|
int result = smartAuthorGroupService.updateSmartAuthorGroup(rns);
|
|
|
SmartAuthority smartAuthority = new SmartAuthority();
|
|
|
smartAuthority.setDeleted(1);
|
|
|
- QueryWrapper<SmartAuthority> queryWrapperA = new QueryWrapper<>();
|
|
|
- queryWrapperA.eq("group_id", id);
|
|
|
- boolean m = smartAuthorityService.update(smartAuthority,queryWrapperA);
|
|
|
- return result > 0 && m ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
|
|
|
+ QueryWrapper<SmartAuthority> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("group_id", id);
|
|
|
+ boolean m = smartAuthorityService.update(smartAuthority,queryWrapper2);
|
|
|
+ SmartAuthorGroup rns2 = new SmartAuthorGroup();
|
|
|
+ rns2.setDeleted(1);
|
|
|
+ QueryWrapper<SmartAuthorGroup> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("parent_id", id);
|
|
|
+ boolean result2 = smartAuthorGroupService.update(rns2, queryWrapper3);
|
|
|
+ SmartAuthority smartAuthority2 = new SmartAuthority();
|
|
|
+ smartAuthority2.setDeleted(1);
|
|
|
+ QueryWrapper<SmartAuthority> queryWrapper4 = new QueryWrapper<>();
|
|
|
+ List<Integer> gid = list1.stream().map(SmartAuthorGroup::getId).collect(Collectors.toList());
|
|
|
+ queryWrapper4.in("group_id", gid);
|
|
|
+ queryWrapper4.eq("deleted",0);
|
|
|
+ boolean m2 = smartAuthorityService.update(smartAuthority2,queryWrapper4);
|
|
|
+ return result > 0 && result2 && m && m2 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -464,7 +480,7 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
|
|
|
queryWrapperB.in("id", users);
|
|
|
queryWrapperB.eq("deleted", 0);
|
|
|
List<SmartUser> ulist = smartUserService.list(queryWrapperB);
|
|
|
- if (ulist.isEmpty() || ulist.size()!=newUserId.length){
|
|
|
+ if (!userId.equals("") && (ulist.isEmpty() || ulist.size()!=newUserId.length)){
|
|
|
return CommonResult.fail("有用户已删除");
|
|
|
}
|
|
|
for (int i = 0; i < oldUserId.length; i++) {
|
|
|
@@ -596,7 +612,7 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
|
|
|
|
|
|
@PassToken
|
|
|
@Override
|
|
|
- @DESRespondSecret(validated = true)
|
|
|
+ @DESRespondSecret(validated = false)
|
|
|
public CommonResult queryUserAuthor(String userId) {
|
|
|
String[] userids = userId.split(",");
|
|
|
QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
|