|
@@ -19,6 +19,7 @@ import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.utils.UserUtil;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.zhdd.domain.Resource;
|
|
|
import com.ruoyi.zhdd.domain.ResourceDetail;
|
|
|
import com.ruoyi.zhdd.domain.bo.ResourceBo;
|
|
@@ -67,6 +68,7 @@ public class ResourceController extends BaseController {
|
|
|
|
|
|
private final IResourceService iResourceService;
|
|
|
private final IResourceDetailService iResourceDetailService;
|
|
|
+ private final ISysDeptService sysDeptService;
|
|
|
|
|
|
/**
|
|
|
* 查询应急资源列表
|
|
@@ -113,7 +115,19 @@ public class ResourceController extends BaseController {
|
|
|
Set<String> userRole = cacheLoginUser.getUserRole();
|
|
|
boolean admin = CollUtil.containsAny(userRole, CollUtil.newHashSet("admin"));
|
|
|
if (!admin) {
|
|
|
- bo.setManageUnitId(cacheLoginUser.getUser().getOrgId());
|
|
|
+ // 查询部门以及子部门资源
|
|
|
+ List<String> deptIds = sysDeptService.queryChildDeptId(cacheLoginUser.getUser().getOrgId());
|
|
|
+ if (deptIds == null || deptIds.size() == 0) {
|
|
|
+ TableDataInfo<ResourceVo> rspData = new TableDataInfo<>();
|
|
|
+ rspData.setCode(HttpStatus.HTTP_OK);
|
|
|
+ rspData.setMsg("查询成功");
|
|
|
+ rspData.setRows(Collections.emptyList());
|
|
|
+ rspData.setTotal(0);
|
|
|
+ rspData.setPageNum(bo.getPageNum());
|
|
|
+ rspData.setPageSize(bo.getPageSize());
|
|
|
+ return rspData;
|
|
|
+ }
|
|
|
+ bo.setDeptIds(deptIds);
|
|
|
}
|
|
|
return iResourceService.queryPageList(bo);
|
|
|
}
|