|
@@ -1,7 +1,10 @@
|
|
|
package com.github.zuihou.business.controller.productionResourceCenter;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.zuihou.authority.service.auth.UserService;
|
|
|
import com.github.zuihou.base.request.PageParams;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
@@ -17,6 +20,8 @@ import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
import com.github.zuihou.base.controller.SuperController;
|
|
|
import com.github.zuihou.base.R;
|
|
|
+import com.github.zuihou.common.util.StringUtil;
|
|
|
+import com.github.zuihou.context.BaseContextHandler;
|
|
|
import com.github.zuihou.database.mybatis.auth.DataScope;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
|
|
@@ -26,6 +31,8 @@ import com.qiniu.common.Zone;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import com.github.zuihou.security.annotation.PreAuth;
|
|
@@ -47,6 +54,10 @@ import com.github.zuihou.security.annotation.PreAuth;
|
|
|
@Api(value = "ZZone", tags = "区域管理")
|
|
|
@SysLog(enabled = true)
|
|
|
public class ZZoneController extends SuperController<ZZoneService, Long, ZZone, ZZonePageDTO, ZZoneSaveDTO, ZZoneUpdateDTO> {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@Override
|
|
|
public void query(PageParams<ZZonePageDTO> params, IPage<ZZone> page, Long defSize) {
|
|
|
ZZonePageDTO data = params.getModel();
|
|
@@ -63,7 +74,15 @@ public class ZZoneController extends SuperController<ZZoneService, Long, ZZone,
|
|
|
@ApiOperation(value = "查询区域管理", notes = "查询区域管理")
|
|
|
@GetMapping("/all")
|
|
|
public R<List<ZZone>> list() {
|
|
|
- return success(baseService.list());
|
|
|
+ Long userId = BaseContextHandler.getUserId();
|
|
|
+ //获取用户权限访问机构
|
|
|
+ Map<String, Object> orgMap = userService.getDataScopeById(userId);
|
|
|
+ List<Long> orgIds = orgMap.containsKey("orgIds")? (List)orgMap.get("orgIds") : Lists.newArrayList();
|
|
|
+ QueryWrapper<ZZone> queryWrapper = null;
|
|
|
+ if(CollectionUtil.isNotEmpty(orgIds)){
|
|
|
+ queryWrapper = new QueryWrapper<ZZone>().in("org_id", orgIds);
|
|
|
+ }
|
|
|
+ return success(baseService.list(queryWrapper));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询区域管理", notes = "查询区域管理")
|