14 changed files with 210 additions and 215 deletions
@ -1,28 +1,28 @@ |
|||||
package com.zdxt.auth.common.flow; |
//package com.zdxt.auth.common.flow;
|
||||
|
//
|
||||
import cn.hutool.core.bean.BeanUtil; |
//import cn.hutool.core.bean.BeanUtil;
|
||||
import com.zdxt.auth.common.utils.security.ShiroUtils; |
//import com.zdxt.auth.common.utils.security.ShiroUtils;
|
||||
import com.zdxt.domain.auth.User; |
//import com.zdxt.domain.auth.User;
|
||||
import com.zdxt.flow.bean.FlowUserBean; |
//import com.zdxt.flow.bean.FlowUserBean;
|
||||
import com.zdxt.flow.common.IFlowUserInfoApi; |
//import com.zdxt.flow.common.IFlowUserInfoApi;
|
||||
import org.springframework.stereotype.Component; |
//import org.springframework.stereotype.Component;
|
||||
|
//
|
||||
/** |
///**
|
||||
* 工作流用户信息接口实现类 |
// * 工作流用户信息接口实现类
|
||||
* |
// *
|
||||
* @author QingWang.Li |
// * @author QingWang.Li
|
||||
* @date 2020/4/2 9:53 |
// * @date 2020/4/2 9:53
|
||||
*/ |
// */
|
||||
@Component |
//@Component
|
||||
public class FlowUserInfo implements IFlowUserInfoApi { |
//public class FlowUserInfo implements IFlowUserInfoApi {
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public FlowUserBean getUserInfo() { |
// public FlowUserBean getUserInfo() {
|
||||
FlowUserBean flowUserBean = new FlowUserBean(); |
// FlowUserBean flowUserBean = new FlowUserBean();
|
||||
User sysUser = ShiroUtils.getSysUser(); |
// User sysUser = ShiroUtils.getSysUser();
|
||||
BeanUtil.copyProperties(sysUser, flowUserBean); |
// BeanUtil.copyProperties(sysUser, flowUserBean);
|
||||
return flowUserBean; |
// return flowUserBean;
|
||||
} |
// }
|
||||
|
//
|
||||
|
//
|
||||
} |
//}
|
||||
|
|||||
@ -1,128 +1,128 @@ |
|||||
package com.zdxt.auth.common.organization; |
//package com.zdxt.auth.common.organization;
|
||||
|
//
|
||||
import com.zdxt.auth.common.constant.UserConstants; |
//import com.zdxt.auth.common.constant.UserConstants;
|
||||
import com.zdxt.auth.common.utils.StringUtils; |
//import com.zdxt.auth.common.utils.StringUtils;
|
||||
import com.zdxt.auth.project.system.dept.mapper.DeptMapper; |
//import com.zdxt.auth.project.system.dept.mapper.DeptMapper;
|
||||
import com.zdxt.auth.project.system.user.mapper.UserMapper; |
//import com.zdxt.auth.project.system.user.mapper.UserMapper;
|
||||
import com.zdxt.auth.project.system.user.service.IUserService; |
//import com.zdxt.auth.project.system.user.service.IUserService;
|
||||
import com.zdxt.common.Ztree; |
//import com.zdxt.common.Ztree;
|
||||
import com.zdxt.domain.auth.Dept; |
//import com.zdxt.domain.auth.Dept;
|
||||
import com.zdxt.domain.auth.User; |
//import com.zdxt.domain.auth.User;
|
||||
import com.zdxt.flow.common.IOrganizationApi; |
//import com.zdxt.flow.common.IOrganizationApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component; |
//import org.springframework.stereotype.Component;
|
||||
|
//
|
||||
import java.util.ArrayList; |
//import java.util.ArrayList;
|
||||
import java.util.HashMap; |
//import java.util.HashMap;
|
||||
import java.util.List; |
//import java.util.List;
|
||||
import java.util.Map; |
//import java.util.Map;
|
||||
|
//
|
||||
/** |
///**
|
||||
* @program: EmergencyBaseLib |
// * @program: EmergencyBaseLib
|
||||
* @description: 组织架构树 |
// * @description: 组织架构树
|
||||
* @author: chenrui |
// * @author: chenrui
|
||||
* @create: 2020-04-14 15:46 |
// * @create: 2020-04-14 15:46
|
||||
**/ |
// **/
|
||||
@Component |
//@Component
|
||||
public class OrganizationZtree implements IOrganizationApi { |
//public class OrganizationZtree implements IOrganizationApi {
|
||||
|
//
|
||||
@Autowired |
// @Autowired
|
||||
private DeptMapper deptMapper; |
// private DeptMapper deptMapper;
|
||||
@Autowired |
// @Autowired
|
||||
private UserMapper userMapper; |
// private UserMapper userMapper;
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public List<Map<String, Object>> getOrganizationData(String deptId) { |
// public List<Map<String, Object>> getOrganizationData(String deptId) {
|
||||
Dept dept = new Dept(); |
// Dept dept = new Dept();
|
||||
dept.setDeptId(deptId); |
// dept.setDeptId(deptId);
|
||||
//获取组织架构
|
// //获取组织架构
|
||||
List<Dept> deptList = deptMapper.selectDeptList(dept); |
// List<Dept> deptList = deptMapper.selectDeptList(dept);
|
||||
//组织机构
|
// //组织机构
|
||||
List<Map<String, Object>> ztreeList = initZtreeDept(deptList); |
// List<Map<String, Object>> ztreeList = initZtreeDept(deptList);
|
||||
|
//
|
||||
return ztreeList; |
// return ztreeList;
|
||||
} |
// }
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public List<Map<String, Object>> getOrganizationUserData(String deptId) { |
// public List<Map<String, Object>> getOrganizationUserData(String deptId) {
|
||||
User user = new User(); |
// User user = new User();
|
||||
user.setDeptId(deptId); |
// user.setDeptId(deptId);
|
||||
Dept dept = new Dept(); |
// Dept dept = new Dept();
|
||||
dept.setParentId(deptId); |
// dept.setParentId(deptId);
|
||||
List<User> list = userMapper.selectUserListByDeptId(user); |
// List<User> list = userMapper.selectUserListByDeptId(user);
|
||||
List<Dept> deptList = deptMapper.selectDeptList(dept); |
// List<Dept> deptList = deptMapper.selectDeptList(dept);
|
||||
|
//
|
||||
List<Map<String, Object>> ztreeList = initZtreeUserList(list,deptList); |
// List<Map<String, Object>> ztreeList = initZtreeUserList(list,deptList);
|
||||
return ztreeList; |
// return ztreeList;
|
||||
} |
// }
|
||||
|
//
|
||||
/** |
// /**
|
||||
* 对象转部门树 |
// * 对象转部门树
|
||||
* |
// *
|
||||
* @param deptList 部门列表 |
// * @param deptList 部门列表
|
||||
* @param roleDeptList 角色已存在菜单列表 |
// * @param roleDeptList 角色已存在菜单列表
|
||||
* @return 树结构列表 |
// * @return 树结构列表
|
||||
*/ |
// */
|
||||
public List<Map<String, Object>> initZtreeDept(List<Dept> deptList) |
// public List<Map<String, Object>> initZtreeDept(List<Dept> deptList)
|
||||
{ |
// {
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); |
// List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
|
//
|
||||
for (Dept dept : deptList) |
// for (Dept dept : deptList)
|
||||
{ |
// {
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) |
// if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
||||
{ |
// {
|
||||
Map<String, Object> map = new HashMap<String, Object>(); |
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("id", dept.getDeptId()); |
// map.put("id", dept.getDeptId());
|
||||
map.put("name", dept.getDeptName()); |
// map.put("name", dept.getDeptName());
|
||||
map.put("nocheck", true); |
// map.put("nocheck", true);
|
||||
map.put("isParent", true); |
// map.put("isParent", true);
|
||||
list.add(map); |
// list.add(map);
|
||||
} |
// }
|
||||
} |
// }
|
||||
return list; |
// return list;
|
||||
} |
// }
|
||||
|
//
|
||||
/** |
// /**
|
||||
* 用户列表 |
// * 用户列表
|
||||
* @param userList |
// * @param userList
|
||||
* @return |
// * @return
|
||||
*/ |
// */
|
||||
public List<Map<String, Object>> initZtreeUserList(List<User> userList,List<Dept> deptList) |
// public List<Map<String, Object>> initZtreeUserList(List<User> userList,List<Dept> deptList)
|
||||
{ |
// {
|
||||
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); |
// List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||
|
//
|
||||
for(User user : userList) { |
// for(User user : userList) {
|
||||
Map<String, Object> map = new HashMap<String, Object>(); |
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("id", user.getUserId()); |
// map.put("id", user.getUserId());
|
||||
map.put("name", user.getUserName()); |
// map.put("name", user.getUserName());
|
||||
map.put("organId", user.getDeptId()); |
// map.put("organId", user.getDeptId());
|
||||
map.put("accountName", user.getLoginName()); |
// map.put("accountName", user.getLoginName());
|
||||
map.put("isParent", false); |
// map.put("isParent", false);
|
||||
list.add(map); |
// list.add(map);
|
||||
} |
// }
|
||||
|
//
|
||||
for (Dept dept : deptList) |
// for (Dept dept : deptList)
|
||||
{ |
// {
|
||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) |
// if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
||||
{ |
// {
|
||||
Map<String, Object> map = new HashMap<String, Object>(); |
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("id", dept.getDeptId()); |
// map.put("id", dept.getDeptId());
|
||||
map.put("name", dept.getDeptName()); |
// map.put("name", dept.getDeptName());
|
||||
map.put("nocheck", true); |
// map.put("nocheck", true);
|
||||
map.put("isParent", true); |
// map.put("isParent", true);
|
||||
list.add(map); |
// list.add(map);
|
||||
} |
// }
|
||||
} |
// }
|
||||
return list; |
// return list;
|
||||
} |
// }
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public List<Map<String, Object>> getOrganizationRoleData() { |
// public List<Map<String, Object>> getOrganizationRoleData() {
|
||||
return null; |
// return null;
|
||||
} |
// }
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public List<Map<String, Object>> getUserByRoleId(Long roleId) { |
// public List<Map<String, Object>> getUserByRoleId(Long roleId) {
|
||||
return null; |
// return null;
|
||||
} |
// }
|
||||
} |
//}
|
||||
|
|||||
Loading…
Reference in new issue