Commit f0de4411 by 罗志长

fix: 平台端组织过滤当前范围

parent a821879d
...@@ -10,8 +10,6 @@ import com.makeit.entity.platform.auth.PlatOrg; ...@@ -10,8 +10,6 @@ import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.global.annotation.Action; import com.makeit.global.annotation.Action;
import com.makeit.service.platform.auth.PlatOrgService; import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.auth.PlatUserService; import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.utils.user.plat.PlatUserUtil;
import com.makeit.utils.user.plat.PlatUserVO;
import com.makeit.vo.platform.auth.PlatOrgQueryDTO; import com.makeit.vo.platform.auth.PlatOrgQueryDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -54,11 +52,7 @@ public class PlatOrgController { ...@@ -54,11 +52,7 @@ public class PlatOrgController {
@ApiOperation("树形列表") @ApiOperation("树形列表")
@PostMapping("list") @PostMapping("list")
public ApiResponseEntity<List<PlatOrg>> list(@RequestBody PlatOrgQueryDTO platOrgQueryDTO){ public ApiResponseEntity<List<PlatOrg>> list(@RequestBody PlatOrgQueryDTO platOrgQueryDTO){
PlatUserVO userVOCanNull = PlatUserUtil.getUserVOCanNull(); return ApiResponseUtils.success(platOrgService.currentOrg(platOrgQueryDTO));
String orgId = userVOCanNull.getOrgId();
List<String> orgIds = platOrgService.getCurrentAndSubIds(orgId);
platOrgQueryDTO.setOrgIds(orgIds);
return ApiResponseUtils.success(platOrgService.subOrgList(platOrgQueryDTO));
} }
@Action(module = "平台端-组织", name = "新增", code = "plat:org:add") @Action(module = "平台端-组织", name = "新增", code = "plat:org:add")
......
...@@ -89,6 +89,8 @@ public interface PlatOrgService extends IService<PlatOrg> { ...@@ -89,6 +89,8 @@ public interface PlatOrgService extends IService<PlatOrg> {
List<PlatOrg> subOrgList(PlatOrgQueryDTO platOrgQueryDTO); List<PlatOrg> subOrgList(PlatOrgQueryDTO platOrgQueryDTO);
List<PlatOrg> currentOrg(PlatOrgQueryDTO platOrgQueryDTO);
/** /**
* 组织表增加一条数据 * 组织表增加一条数据
* 增加告警配置 * 增加告警配置
......
...@@ -596,6 +596,20 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -596,6 +596,20 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
return orgTree; return orgTree;
} }
@Override
public List<PlatOrg> currentOrg(PlatOrgQueryDTO platOrgQueryDTO) {
PlatUserVO userVOCanNull = PlatUserUtil.getUserVOCanNull();
String orgId = userVOCanNull.getOrgId();
List<String> orgIds = this.getCurrentAndSubIds(orgId);
platOrgQueryDTO.setOrgIds(orgIds);
LambdaQueryWrapper<PlatOrg> queryWrapper = getLambdaQueryWrapper(platOrgQueryDTO);
List<PlatOrg> list = list(queryWrapper);
if(CollectionUtils.isEmpty(list)){
return new ArrayList<>();
}
return createOrgTree(list);
}
/** /**
* 返回parentId的 树 * 返回parentId的 树
* @param platOrgQueryDTO * @param platOrgQueryDTO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment