|
|
|
@ -3,6 +3,7 @@ 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;
|
|
|
|
@ -30,18 +31,18 @@ public class OrgChartController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取组织维度信息
|
|
|
|
|
* */
|
|
|
|
|
*/
|
|
|
|
|
@GET
|
|
|
|
|
@Path("/getCondition")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String getCondition(@Context HttpServletRequest request, @Context HttpServletResponse
|
|
|
|
|
response){
|
|
|
|
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
|
|
|
|
try{
|
|
|
|
|
response) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
//实例化Service 并调用业务类处理
|
|
|
|
|
apidatas = getOrgChartWrapper(user).getOptionCondition(ParamUtil.request2Map(request), user);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//异常处理
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
apidatas.put("api_status", false);
|
|
|
|
@ -53,18 +54,18 @@ public class OrgChartController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 组织架构数据
|
|
|
|
|
* */
|
|
|
|
|
*/
|
|
|
|
|
@GET
|
|
|
|
|
@Path("/companyData")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String getCompanyData(@Context HttpServletRequest request, @Context HttpServletResponse
|
|
|
|
|
response){
|
|
|
|
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
|
|
|
|
try{
|
|
|
|
|
response) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
//实例化Service 并调用业务类处理
|
|
|
|
|
apidatas = getOrgChartWrapper(user).getCompanyData(ParamUtil.request2Map(request), user);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//异常处理
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
apidatas.put("api_status", false);
|
|
|
|
@ -76,18 +77,18 @@ public class OrgChartController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 组织透视图
|
|
|
|
|
* */
|
|
|
|
|
*/
|
|
|
|
|
@GET
|
|
|
|
|
@Path("/userData")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String getUserData(@Context HttpServletRequest request, @Context HttpServletResponse
|
|
|
|
|
response){
|
|
|
|
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
|
|
|
|
try{
|
|
|
|
|
response) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
//实例化Service 并调用业务类处理
|
|
|
|
|
apidatas = getOrgChartWrapper(user).getUserData(ParamUtil.request2Map(request), user);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//异常处理
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
apidatas.put("api_status", false);
|
|
|
|
@ -104,13 +105,13 @@ public class OrgChartController {
|
|
|
|
|
@Path("/asyncUserData")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String asyncUserData(@Context HttpServletRequest request, @Context HttpServletResponse
|
|
|
|
|
response){
|
|
|
|
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
|
|
|
|
try{
|
|
|
|
|
response) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
//实例化Service 并调用业务类处理
|
|
|
|
|
apidatas = getOrgChartWrapper(user).asyncUserData(ParamUtil.request2Map(request), user);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//异常处理
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
apidatas.put("api_status", false);
|
|
|
|
@ -127,13 +128,13 @@ public class OrgChartController {
|
|
|
|
|
@Path("/asyncCompanyData")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public String asyncCompanyData(@Context HttpServletRequest request, @Context HttpServletResponse
|
|
|
|
|
response){
|
|
|
|
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
|
|
|
|
try{
|
|
|
|
|
response) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
//实例化Service 并调用业务类处理
|
|
|
|
|
apidatas = getOrgChartWrapper(user).asyncCompanyData(ParamUtil.request2Map(request), user);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//异常处理
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
apidatas.put("api_status", false);
|
|
|
|
@ -143,4 +144,17 @@ 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|