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