用户角色部门管理-英文导出
This commit is contained in:
+47
-17
@@ -13,6 +13,7 @@ import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.YouBianCodeUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysDepartExportEn;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.DepartIdModel;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
@@ -26,7 +27,9 @@ import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@@ -297,25 +300,52 @@ public class SysDepartController {
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SysDepart> pageList = sysDepartService.list(queryWrapper);
|
||||
for(SysDepart depart : pageList){
|
||||
if(StringUtils.isNotBlank(depart.getParentId())){
|
||||
SysDepart parentDepart = sysDepartService.getById(depart.getParentId());
|
||||
depart.setParentName(parentDepart.getDepartName());
|
||||
}
|
||||
}
|
||||
//按字典排序
|
||||
Collections.sort(pageList, new Comparator<SysDepart>() {
|
||||
@Override
|
||||
public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
return arg0.getOrgCode().compareTo(arg1.getOrgCode());
|
||||
}
|
||||
});
|
||||
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "部门列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDepart.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
if("en".equals(sysDepart.getCut())){
|
||||
List<SysDepartExportEn> result = new ArrayList<>();
|
||||
for(SysDepart depart : pageList){
|
||||
if(StringUtils.isNotBlank(depart.getParentId())){
|
||||
SysDepart parentDepart = sysDepartService.getById(depart.getParentId());
|
||||
depart.setParentName(parentDepart.getDepartName());
|
||||
}
|
||||
SysDepartExportEn target = new SysDepartExportEn();
|
||||
BeanUtils.copyProperties(depart, target);
|
||||
result.add(target);
|
||||
}
|
||||
//按字典排序
|
||||
Collections.sort(result, new Comparator<SysDepartExportEn>() {
|
||||
@Override
|
||||
public int compare(SysDepartExportEn arg0, SysDepartExportEn arg1) {
|
||||
return arg0.getOrgCode().compareTo(arg1.getOrgCode());
|
||||
}
|
||||
});
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDepartExportEn.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("depart list data", "export information", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, result);
|
||||
}else{
|
||||
for(SysDepart depart : pageList){
|
||||
if(StringUtils.isNotBlank(depart.getParentId())){
|
||||
SysDepart parentDepart = sysDepartService.getById(depart.getParentId());
|
||||
depart.setParentName(parentDepart.getDepartName());
|
||||
}
|
||||
}
|
||||
//按字典排序
|
||||
Collections.sort(pageList, new Comparator<SysDepart>() {
|
||||
@Override
|
||||
public int compare(SysDepart arg0, SysDepart arg1) {
|
||||
return arg0.getOrgCode().compareTo(arg1.getOrgCode());
|
||||
}
|
||||
});
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDepart.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("部门列表数据", "导出信息", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
||||
+46
-54
@@ -1,62 +1,39 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.PmsUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.entity.SysRolePermission;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import com.jero.modules.system.service.ISysRolePermissionService;
|
||||
import com.jero.modules.system.service.ISysRoleService;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.*;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import com.jero.modules.system.service.ISysRolePermissionService;
|
||||
import com.jero.modules.system.service.ISysRoleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -268,10 +245,25 @@ public class SysRoleController {
|
||||
List<SysRole> pageList = sysRoleService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
|
||||
if("en".equals(sysRole.getCut())){
|
||||
List<SysRoleExportEn> result = new ArrayList<>();
|
||||
pageList.forEach(item->{
|
||||
SysRoleExportEn target = new SysRoleExportEn();
|
||||
BeanUtils.copyProperties(item, target);
|
||||
result.add(target);
|
||||
});
|
||||
mv.addObject(NormalExcelConstants.CLASS,SysRoleExportEn.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
|
||||
mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("role list data","export information", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST,result);
|
||||
}else{
|
||||
mv.addObject(NormalExcelConstants.CLASS,SysRole.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出人:"+user.getRealname(),"导出信息"));
|
||||
mv.addObject(NormalExcelConstants.PARAMS,new ExportParams("角色列表数据","导出信息", ExcelType.XSSF));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST,pageList);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
||||
+77
-9
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -16,6 +17,9 @@ import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.system.vo.SysDepartTreeModel;
|
||||
import com.jero.common.system.vo.SysDepartUserTreeModel;
|
||||
import com.jero.common.system.vo.SysUserTreeModel;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
@@ -37,7 +41,9 @@ import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -426,12 +432,39 @@ public class SysUserController {
|
||||
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "用户列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysUser.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
if("en".equals(sysUser.getCut())){
|
||||
List<SysUserExportEn> result = new ArrayList<>();
|
||||
pageList.forEach(item->{
|
||||
List<SysDepart> departList = sysDepartService.queryByDepartCode(item.getOrgCode());
|
||||
if(CollectionUtil.isNotEmpty(departList)){
|
||||
item.setOrgCodeTxt(departList.get(0).getDepartName());
|
||||
}
|
||||
SysUserExportEn target = new SysUserExportEn();
|
||||
BeanUtils.copyProperties(item, target);
|
||||
result.add(target);
|
||||
});
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysUserExportEn.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
|
||||
ExportParams exportParams = new ExportParams("user list data", "export information", ExcelType.XSSF);
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, result);
|
||||
}else{
|
||||
pageList.forEach(item->{
|
||||
List<SysDepart> departList = sysDepartService.queryByDepartCode(item.getOrgCode());
|
||||
if(CollectionUtil.isNotEmpty(departList)){
|
||||
item.setOrgCodeTxt(departList.get(0).getDepartName());
|
||||
}
|
||||
});
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysUser.class);
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// ExportParams exportParams = new ExportParams("用户列表数据", "导出人:"+user.getRealname(), "导出信息");
|
||||
ExportParams exportParams = new ExportParams("用户列表数据", "导出信息", ExcelType.XSSF);
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
|
||||
@@ -650,7 +683,7 @@ public class SysUserController {
|
||||
/**
|
||||
* 部门用户列表
|
||||
*/
|
||||
@ApiOperation(value = "用户管理-查询组织下的用户列表")
|
||||
@ApiOperation(value = "用户管理-查询组织下的用户列表分页")
|
||||
@RequestMapping(value = "/departUserList", method = RequestMethod.GET)
|
||||
@RequiresPermissions("sys:user:list")
|
||||
public Result<IPage<SysUser>> departUserList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@@ -658,8 +691,7 @@ public class SysUserController {
|
||||
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
|
||||
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
|
||||
String depId = req.getParameter("depId");
|
||||
// String username = req.getParameter("username");
|
||||
String username = null;
|
||||
String username = req.getParameter("username");
|
||||
//根据部门ID查询,当前和下级所有的部门IDS
|
||||
List<String> subDepids = new ArrayList<>();
|
||||
//部门id为空时,查询我的部门下所有用户
|
||||
@@ -1331,4 +1363,40 @@ public class SysUserController {
|
||||
sysUserService.updateById(user);
|
||||
return Result.OK("手机号设置成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据 查出所有部门及其用户,并以树结构数据格式响应给前端
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryDepartUserTreeList", method = RequestMethod.GET)
|
||||
public Result<List<SysDepartUserTreeModel>> queryDepartUserTreeList() {
|
||||
Result<List<SysDepartUserTreeModel>> result = new Result<>();
|
||||
try {
|
||||
List<SysDepartTreeModel> departTreeModelList = sysDepartService.queryTreeList();
|
||||
List<SysDepartUserTreeModel> departUserTreeModelList = new ArrayList<>();
|
||||
departTreeModelList.forEach(item->{
|
||||
//复制
|
||||
SysDepartUserTreeModel target = new SysDepartUserTreeModel();
|
||||
BeanUtils.copyProperties(item, target);
|
||||
//添加当前部门的用户列表,不包括子部门
|
||||
List<String> departIds = new ArrayList<>();
|
||||
departIds.add(item.getId());
|
||||
List<SysUser> sysUserList = sysUserService.getUserListByDepIds(departIds);
|
||||
List<SysUserTreeModel> sysUserTreeModels = new ArrayList<>();
|
||||
sysUserList.forEach(sysUser->{
|
||||
SysUserTreeModel sysUserTreeModel = new SysUserTreeModel();
|
||||
BeanUtils.copyProperties(sysUser, sysUserTreeModel);
|
||||
sysUserTreeModels.add(sysUserTreeModel);
|
||||
});
|
||||
target.setList(sysUserTreeModels);
|
||||
departUserTreeModelList.add(target);
|
||||
});
|
||||
result.setResult(departUserTreeModelList);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -88,6 +88,11 @@ public class SysDepart implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut; //中英文切换标识
|
||||
|
||||
|
||||
/**
|
||||
* 重写equals方法
|
||||
*/
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 14:11 2022/3/4
|
||||
*/
|
||||
@Data
|
||||
public class SysDepartExportEn implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 机构/部门名称
|
||||
*/
|
||||
@Excel(name = "depart name", width = 15)
|
||||
private String departName;
|
||||
|
||||
@Excel(name = "parent depart name", width = 30)
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
/**
|
||||
* 机构编码
|
||||
*/
|
||||
@Excel(name = "depart code", width = 15)
|
||||
private String orgCode;
|
||||
/**
|
||||
* 机构类别 1公司,2组织机构,2岗位
|
||||
*/
|
||||
@Excel(name = "depart type", width = 15, dicCode = "org_category")
|
||||
private String orgCategory;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "order", width = 15)
|
||||
private Integer departOrder;
|
||||
|
||||
}
|
||||
+8
-9
@@ -1,19 +1,17 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -88,5 +86,6 @@ public class SysRole implements Serializable {
|
||||
*/
|
||||
private Integer roleOrder;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut; //中英文切换标识
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 14:10 2022/3/4
|
||||
*/
|
||||
@Data
|
||||
public class SysRoleExportEn implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
@Excel(name="role name",width=15)
|
||||
private String roleName;
|
||||
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
@Excel(name="role code",width=15)
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name="description",width=60)
|
||||
private String description;
|
||||
|
||||
}
|
||||
+8
-4
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@@ -98,10 +99,6 @@ public class SysUser implements Serializable {
|
||||
*/
|
||||
private String orgCode;
|
||||
|
||||
/**部门名称*/
|
||||
@Excel(name = "部门", width = 15)
|
||||
private transient String orgCodeTxt;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@@ -172,10 +169,17 @@ public class SysUser implements Serializable {
|
||||
@Dict(dicCode = "worker_type")
|
||||
private String workerType;//员工种类(1-正式工,2-临时工)
|
||||
|
||||
/**部门名称*/
|
||||
@Excel(name = "部门", width = 15)
|
||||
private transient String orgCodeTxt;
|
||||
|
||||
/**
|
||||
* 状态(1:正常 2:冻结 )
|
||||
*/
|
||||
@Excel(name = "状态", width = 15,dicCode="user_status")
|
||||
@Dict(dicCode = "user_status")
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut; //中英文切换标识
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 14:03 2022/3/4
|
||||
*/
|
||||
@Data
|
||||
public class SysUserExportEn implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 登录账号
|
||||
*/
|
||||
@Excel(name = "user name", width = 15)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Excel(name = "real name", width = 15)
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
* 工号,唯一键
|
||||
*/
|
||||
@Excel(name = "worker number", width = 15)
|
||||
private String workNo;
|
||||
|
||||
@Excel(name = "worker type", width = 15, dicCode = "worker_type")
|
||||
private String workerType;//员工种类(1-正式工,2-临时工)
|
||||
|
||||
/**部门名称*/
|
||||
@Excel(name = "depart name", width = 15)
|
||||
private transient String orgCodeTxt;
|
||||
|
||||
/**
|
||||
* 状态(1:正常 2:冻结 )
|
||||
*/
|
||||
@Excel(name = "user status", width = 15,dicCode="user_status")
|
||||
private Integer status;
|
||||
}
|
||||
+13
-1
@@ -53,7 +53,19 @@
|
||||
)
|
||||
</if>
|
||||
<if test="username!=null and username!=''">
|
||||
and username = #{username}
|
||||
and username like concat(concat('%',#{username}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 通过多个部门IDS,查询部门下的用户信息 -->
|
||||
<select id="getUserListByDepIds" resultType="com.jero.modules.system.entity.SysUser">
|
||||
select * from sys_user where del_flag = 0
|
||||
<if test="departIds!=null and departIds.size()>0">
|
||||
and id in (select dru.user_id from sys_depart_role dr, sys_depart_role_user dru where dr.id = dru.drole_id and dr.depart_id in
|
||||
<foreach collection="departIds" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
+6
-7
@@ -1,22 +1,20 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.SysUserCacheInfo;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.system.model.SysUserSysDepartModel;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 服务类
|
||||
@@ -105,6 +103,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
*/
|
||||
public IPage<SysUser> getUserByDepIds(Page<SysUser> page, List<String> departIds, String username);
|
||||
|
||||
List<SysUser> getUserListByDepIds(List<String> departIds);
|
||||
/**
|
||||
* 部门下用户
|
||||
* @param departIds
|
||||
|
||||
Reference in New Issue
Block a user