Commit e20c8276 authored by 李腾威's avatar 李腾威

接口修改

parent ddc2b669
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import java.util.Collection;
import java.util.List;
import java.util.Map;
......@@ -15,10 +17,10 @@ import java.util.Map;
public interface IOrgUsrService {
String selectUpUnitByParam(String parent_id);
List<OrgMenu> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
List<OrgMenuVo> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
List<OrgMenu> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuVo> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception;
}
......@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -179,12 +180,12 @@ public class OrgDepartmentController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取部门树", notes = "获取部门树")
public ResponseModel< List<OrgMenu>> selectCompanyTree() throws Exception {
public ResponseModel< List<OrgMenuVo>> selectCompanyTree() throws Exception {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
Collection<OrgUsr> list = iOrgUsrService.listByMap(columnMap);
List<OrgMenu> menus = iOrgUsrService.getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
List<OrgMenuVo> menus = iOrgUsrService.getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
return ResponseHelper.buildResponse(menus);
}
......
......@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -173,11 +174,11 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取单位树", notes = "获取单位树")
public ResponseModel selectCompanyTree() throws Exception {
public ResponseModel< List<OrgMenuVo>>selectCompanyTree() throws Exception {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_COMPANY);
List<OrgMenu> menus = iOrgUsrService.getTree(null, iOrgUsrService.listByMap(columnMap), OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
List<OrgMenuVo> menus = iOrgUsrService.getTree(null, iOrgUsrService.listByMap(columnMap), OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
return ResponseHelper.buildResponse(menus);
}
......
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,8 +40,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
@Override
@SuppressWarnings("unchecked")
public List<OrgMenu> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception {
List<OrgMenu> resultList = new ArrayList<>();
public List<OrgMenuVo> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception {
List<OrgMenuVo> resultList = new ArrayList<>();
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
......@@ -70,12 +71,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if (parentId == null || topId == parentId) {
OrgMenu menu = new OrgMenu(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
OrgMenuVo menu = new OrgMenuVo(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
resultList.add(menu);
}
}
//获取每个顶层元素的子数据集合
for (OrgMenu entity : resultList) {
for (OrgMenuVo entity : resultList) {
entity.setChildren(getSub(entity.getKey(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, OrgTypeMethodName));
}
......@@ -84,8 +85,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
@SuppressWarnings("unchecked")
@Override
public List<OrgMenu> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception{
List<OrgMenu> childList=new ArrayList<>();
public List<OrgMenuVo> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception{
List<OrgMenuVo> childList=new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz= Class.forName(packageURL);
......@@ -117,12 +118,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
if (parentId == null) {
if (topId == parentId) {
OrgMenu menu = new OrgMenu(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
OrgMenuVo menu = new OrgMenuVo(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
childList.add(menu);
}
} else {
if (topId.longValue() == parentId.longValue()) {
OrgMenu menu = new OrgMenu(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), true);
OrgMenuVo menu = new OrgMenuVo(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, String.valueOf(OrgTypeMethodNameme.invoke(entity)), true);
childList.add(menu);
}
}
......@@ -130,7 +131,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
//子集的间接子对象
for (OrgMenu entity : childList) {
for (OrgMenuVo entity : childList) {
entity.setChildren(getSub(entity.getKey(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, OrgTypeMethodName));
}
......
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 to comment