浏览代码

酒店数据为空 2

wuweihao 3 年之前
父节点
当前提交
1b43f23b8c

+ 1 - 1
gis_admin/src/main/java/com/gis/admin/service/impl/SysRoleServiceImpl.java

@@ -200,7 +200,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRoleEntity
     public List<String> getScopeById(Long roleId) {
         String hotelIds = entityMapper.getScopeById(roleId);
         // 产品经理要求的处理方式
-        BaseRuntimeException.isBlank(hotelIds, null, "暂无数据");
+        BaseRuntimeException.isBlank(hotelIds, null, "请联系系统管理员授权");
         String[] split = hotelIds.split(",");
         return Arrays.asList(split);
 

+ 4 - 6
gis_cms/src/main/java/com/gis/cms/service/impl/HotelServiceImpl.java

@@ -45,12 +45,6 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
     @Override
     public Result search(HotelPageDto param) {
 
-        Long roleId = iBaseService.getRoleId();
-        log.info("角色id: {}", roleId);
-        BaseRuntimeException.isNull(roleId, null,"请联系系统管理员授权");
-
-
-
         BaseUtil.startPage(param);
         IPage<HotelEntity> page = new Page<>(param.getPageNum() , param.getPageSize());
 
@@ -73,6 +67,10 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
         Integer isAdmin = iBaseService.getIsAdmin();
         if (isAdmin != 1){
             log.info("非管理员查询");
+            Long roleId = iBaseService.getRoleId();
+            log.info("角色id: {}", roleId);
+            BaseRuntimeException.isNull(roleId, null,"请联系系统管理员授权");
+
             List<String> hotelIds = roleService.getScopeById(roleId);
             log.info("酒店id: {}", hotelIds);
             wrapper.in(HotelEntity::getId, hotelIds);