BUG修复,权限控制
This commit is contained in:
parent
3acec4730d
commit
5cce107318
|
|
@ -21,5 +21,4 @@ public interface OrgChartService {
|
|||
|
||||
Map<String, Object> asyncCompanyData(Map<String, Object> request2Map, User user);
|
||||
|
||||
Map<String, Object> getHasRight();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,14 +21,24 @@ import java.util.*;
|
|||
public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||
|
||||
private RecordSet grs = new RecordSet();
|
||||
private static final String RIGHT_NAME = "OrgChart:All";
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
String type = (String) request2Map.get("type");
|
||||
String rightName = "OrgChart:All";
|
||||
// 组织透视
|
||||
if ("user".equals(type)) {
|
||||
rightName = "OrgPerspective:All";
|
||||
}
|
||||
boolean hasRight = HasRightUtil.hasRight(user, rightName, true);
|
||||
result.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return result;
|
||||
}
|
||||
|
||||
rs.executeQuery("select id, companyname from HrmCompanyVirtual order by id");
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<Map<String, Object>> fclasslist = new ArrayList<>();
|
||||
Map<String, Object> defaultItem = new HashMap<>();
|
||||
defaultItem.put("id", "0");
|
||||
|
|
@ -323,13 +333,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
returnMap.put("hasRight", hasRight);
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
private void findUserItemByParantId(String id, int currentLevel, String level, RecordSet rs, List<Map<String, Object>> list, String whereSql, boolean expand) {
|
||||
rs.executeQuery("select t.id, t.fname, t.ftype, t.fparentid, t.fleadername, t.fleaderimg, t.fleaderjob, t.fplan, t.fonjob, t.fnumber from jcl_org_map t " + whereSql + " and t.fparentid = " + id);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.engine.organization.web;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.OrgChartWrapper;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -144,17 +143,4 @@ public class OrgChartController {
|
|||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getHasRight")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// TODO 权限控制调整
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getOrgChartWrapper(user).getHasRight());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,4 @@ public class OrgChartWrapper extends Service {
|
|||
return getOrgChartService(user).asyncCompanyData(request2Map, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> getHasRight(){
|
||||
return getOrgChartService(user).getHasRight();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue