修复权限查询都是全部的bug

dev
liuguijing 1 year ago
parent 500e44fb47
commit 4be1c7d249

@ -1,5 +1,7 @@
package com.shxy.xymanager_common.bean; package com.shxy.xymanager_common.bean;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.enums.CommonStatus;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,7 +23,7 @@ public class PermissionDetail {
private List<Integer> termpList = new ArrayList<>(); private List<Integer> termpList = new ArrayList<>();
private boolean isSuper = false; private Integer isSuper = CommonStatus.DELETE.value();
} }

@ -7,7 +7,6 @@ import com.shxy.xymanager_common.dto.DyLineAndTowertDto;
import com.shxy.xymanager_common.entity.DyLevel; import com.shxy.xymanager_common.entity.DyLevel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public interface DyLevelDao { public interface DyLevelDao {
@ -24,7 +23,7 @@ public interface DyLevelDao {
List<DyLevel> selectAll(@Param("status") Integer status); List<DyLevel> selectAll(@Param("status") Integer status);
List<DyLineAndTerminalWithHeartDto> selectTreeList(@Param("status") Integer status, @Param("dyid")List<Integer> dyplist, @Param("lineid")List<Integer> lineplist, @Param("towerid")List<Integer> towplist); List<DyLineAndTerminalWithHeartDto> selectTreeList(@Param("status") Integer status, @Param("dyid") List<Integer> dyplist, @Param("lineid") List<Integer> lineplist, @Param("towerid") List<Integer> towplist, @Param("isSuper") Integer isSuper);
List<DyLineAndTerminalWithHeartDto> selectListTreeList( @Param("status") Integer status,@Param("list") List<Integer> list); List<DyLineAndTerminalWithHeartDto> selectListTreeList( @Param("status") Integer status,@Param("list") List<Integer> list);

@ -207,7 +207,7 @@
left join terminals d on c.id = d.tower_id ) left join terminals d on c.id = d.tower_id )
left join terminal_status e on e.term_id = d.id) left join terminal_status e on e.term_id = d.id)
where b.status = #{status} and a.status = #{status} and c.status = #{status} and d.status = #{status} where b.status = #{status} and a.status = #{status} and c.status = #{status} and d.status = #{status}
<if test="dyid != null and dyid.size > 0 and lineid != null and lineid.size > 0 and towerid != null and towerid.size > 0"> <if test="isSuper == 0">
and ( and (
false false
<if test="dyid != null and dyid.size > 0"> <if test="dyid != null and dyid.size > 0">

@ -30,8 +30,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.shxy.xymanager_common.constant.Constants.SUPER_ADMIN;
/** /**
* *
*/ */
@ -102,10 +100,10 @@ public class DyLevelServiceImpl implements DyLevelService {
List<Integer> dypList = permissionDetail.getDypList(); List<Integer> dypList = permissionDetail.getDypList();
List<Integer> linepList = permissionDetail.getLinepList(); List<Integer> linepList = permissionDetail.getLinepList();
List<Integer> towerpList = permissionDetail.getTowerpList(); List<Integer> towerpList = permissionDetail.getTowerpList();
boolean aSuper = permissionDetail.isSuper(); Integer aSuper = permissionDetail.getIsSuper();
List<DyLineAndTerminalWithHeartDto> list = new ArrayList<>(); List<DyLineAndTerminalWithHeartDto> list = new ArrayList<>();
if (CollectionUtil.isNotEmpty(dypList) || CollectionUtil.isNotEmpty(linepList) || CollectionUtil.isNotEmpty(towerpList) || aSuper) { if (CollectionUtil.isNotEmpty(dypList) || CollectionUtil.isNotEmpty(linepList) || CollectionUtil.isNotEmpty(towerpList) || aSuper.intValue()==1) {
list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList); list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList,aSuper);
} }
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {

@ -10,6 +10,7 @@ import com.shxy.xymanager_common.entity.TbPermission;
import com.shxy.xymanager_common.entity.TbPermissionExample; import com.shxy.xymanager_common.entity.TbPermissionExample;
import com.shxy.xymanager_common.entity.TbRole; import com.shxy.xymanager_common.entity.TbRole;
import com.shxy.xymanager_common.entity.TbRoleExample; import com.shxy.xymanager_common.entity.TbRoleExample;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.enums.PermissionDetailEnum; import com.shxy.xymanager_common.enums.PermissionDetailEnum;
import com.shxy.xymanager_common.exception.ApiException; import com.shxy.xymanager_common.exception.ApiException;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
@ -133,7 +134,7 @@ public class RoleServiceImpl implements RoleService {
} }
} }
} else { } else {
permissionDetail.setSuper(true); permissionDetail.setIsSuper(CommonStatus.EFFECTIVE.value());
} }
return permissionDetail; return permissionDetail;
} }

Loading…
Cancel
Save