|
|
@@ -3,7 +3,7 @@ package com.usoftchina.bi.server.service.dashboard;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.usoftchina.bi.core.base.BaseContextHolder;
|
|
|
+import com.usoftchina.bi.core.base.*;
|
|
|
import com.usoftchina.bi.core.exception.MyException;
|
|
|
import com.usoftchina.bi.core.utils.EncryUtil;
|
|
|
import com.usoftchina.bi.server.dao.chart.ChartsConfigMapper;
|
|
|
@@ -15,9 +15,6 @@ import com.usoftchina.bi.server.model.bo.DashOrder;
|
|
|
import com.usoftchina.bi.server.model.bo.ShareReqBO;
|
|
|
import com.usoftchina.bi.server.model.po.ChartConfig;
|
|
|
import com.usoftchina.bi.server.model.po.Dashboards;
|
|
|
-import com.usoftchina.bi.core.base.RepCode;
|
|
|
-import com.usoftchina.bi.core.base.RepEntity;
|
|
|
-import com.usoftchina.bi.core.base.TestPage;
|
|
|
import com.usoftchina.bi.server.model.vo.configVo.ChangeOrderInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.configVo.DashboardsInfo;
|
|
|
import com.usoftchina.bi.server.model.vo.dataVo.DashboardCopyInfo;
|
|
|
@@ -186,7 +183,13 @@ public class DashboardsService {
|
|
|
*/
|
|
|
public RepEntity getListDashboards(String token, TestPage testPage) {
|
|
|
int id = BaseContextHolder.getUserId();
|
|
|
- List<Dashboards> getListDashboards = dashboardsMapper.getListDashboards(id, testPage.enablePaging());
|
|
|
+ String role = BaseContextHolder.getRole();
|
|
|
+ List<Dashboards> getListDashboards = new ArrayList<>();
|
|
|
+ if (RoleConstant.SUPER_ADMIN.getRole().equals(role)) {
|
|
|
+ getListDashboards = dashboardsMapper.getListDashboardsWithoutLimit(testPage.enablePaging());
|
|
|
+ }else {
|
|
|
+ getListDashboards = dashboardsMapper.getListDashboards(id, testPage.enablePaging());
|
|
|
+ }
|
|
|
PageInfo<Dashboards> pageInfo = new PageInfo<>(getListDashboards);
|
|
|
return new RepEntity(RepCode.success, pageInfo);
|
|
|
}
|
|
|
@@ -196,7 +199,13 @@ public class DashboardsService {
|
|
|
*/
|
|
|
public RepEntity getDashboards(String token, int id) {
|
|
|
int userId = BaseContextHolder.getUserId();
|
|
|
- Dashboards dashboards = dashboardsMapper.getDashboards(userId, id);
|
|
|
+ String role = BaseContextHolder.getRole();
|
|
|
+ Dashboards dashboards = new Dashboards();
|
|
|
+ if (RoleConstant.SUPER_ADMIN.getRole().equals(role)) {
|
|
|
+ dashboards = dashboardsMapper.getDashboardsWithoutLimit(id);
|
|
|
+ }else {
|
|
|
+ dashboards = dashboardsMapper.getDashboards(userId, id);
|
|
|
+ }
|
|
|
if (dashboards == null){
|
|
|
return new RepEntity(RepCode.DashboardNonExistent);
|
|
|
}
|
|
|
@@ -286,8 +295,9 @@ public class DashboardsService {
|
|
|
*/
|
|
|
public RepEntity changeDashOrder(String token, ChangeOrderInfo changeOrderInfo) {
|
|
|
int userId = BaseContextHolder.getUserId();
|
|
|
+ String role = BaseContextHolder.getRole();
|
|
|
int createId = dashboardsMapper.getCreateIdById(changeOrderInfo.getId());
|
|
|
- if (userId != createId) {
|
|
|
+ if (userId != createId && !RoleConstant.SUPER_ADMIN.getRole().equals(role)) {
|
|
|
return new RepEntity(RepCode.NoAuthority);
|
|
|
}
|
|
|
String name = userMapper.getName(changeOrderInfo.getUserId());
|