部门管理-添加员工类型
This commit is contained in:
+7
@@ -146,6 +146,13 @@ public interface CommonConstant {
|
||||
*/
|
||||
public static final Integer USER_UNFREEZE = 1;
|
||||
public static final Integer USER_FREEZE = 2;
|
||||
|
||||
/**
|
||||
* 员工种类(1-正式工,2-临时工)
|
||||
*/
|
||||
public static final String WORKER_TYPE_1 = "1";
|
||||
public static final String WORKER_TYPE_2 = "2";
|
||||
|
||||
|
||||
/**字典翻译文本后缀*/
|
||||
public static final String DICT_TEXT_SUFFIX = "_dictText";
|
||||
|
||||
+15
-11
@@ -1,20 +1,14 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.system.vo.SysDepartTreeModel;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.system.vo.SysDepartTreeModel;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.YouBianCodeUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -24,6 +18,9 @@ import com.jero.modules.system.model.DepartIdModel;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
@@ -38,9 +35,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -299,6 +297,12 @@ 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
|
||||
|
||||
+2
-1
@@ -106,6 +106,7 @@ public class SysUserController {
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "用户管理-分页查询")
|
||||
@RequiresPermissions("sys:user:list")
|
||||
@PermissionData(pageComponent = "system/UserList")
|
||||
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
||||
@@ -649,7 +650,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,
|
||||
|
||||
+19
-16
@@ -1,11 +1,11 @@
|
||||
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.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -32,46 +32,49 @@ public class SysDepart implements Serializable {
|
||||
/**父机构ID*/
|
||||
private String parentId;
|
||||
/**机构/部门名称*/
|
||||
@Excel(name="机构/部门名称",width=15)
|
||||
@Excel(name="机构名称",width=15)
|
||||
private String departName;
|
||||
/**英文名*/
|
||||
@Excel(name="英文名",width=15)
|
||||
// @Excel(name="英文名",width=15)
|
||||
private String departNameEn;
|
||||
/**缩写*/
|
||||
private String departNameAbbr;
|
||||
/**排序*/
|
||||
@Excel(name="排序",width=15)
|
||||
private Integer departOrder;
|
||||
/**描述*/
|
||||
@Excel(name="描述",width=15)
|
||||
// @Excel(name="描述",width=15)
|
||||
private String description;
|
||||
/**机构类别 1公司,2组织机构,2岗位*/
|
||||
@Excel(name="机构类别",width=15,dicCode="org_category")
|
||||
private String orgCategory;
|
||||
/**机构类型*/
|
||||
private String orgType;
|
||||
@Excel(name = "上级部门", width = 15)
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
/**机构编码*/
|
||||
@Excel(name="机构编码",width=15)
|
||||
private String orgCode;
|
||||
/**机构类别 1公司,2组织机构,2岗位*/
|
||||
@Excel(name="机构类型",width=15,dicCode="org_category")
|
||||
private String orgCategory;
|
||||
/**排序*/
|
||||
@Excel(name="排序",width=15)
|
||||
private Integer departOrder;
|
||||
/**父级机构编码*/
|
||||
private String parentCode;
|
||||
/**手机号*/
|
||||
@Excel(name="手机号",width=15)
|
||||
// @Excel(name="手机号",width=15)
|
||||
private String mobile;
|
||||
/**传真*/
|
||||
@Excel(name="传真",width=15)
|
||||
// @Excel(name="传真",width=15)
|
||||
private String fax;
|
||||
/**地址*/
|
||||
@Excel(name="地址",width=15)
|
||||
// @Excel(name="地址",width=15)
|
||||
private String address;
|
||||
/**备注*/
|
||||
@Excel(name="备注",width=15)
|
||||
// @Excel(name="备注",width=15)
|
||||
private String memo;
|
||||
/**状态(1启用,0不启用)*/
|
||||
@Dict(dicCode = "depart_status")
|
||||
// @Dict(dicCode = "depart_status")
|
||||
private String status;
|
||||
/**删除状态(0,正常,1已删除)*/
|
||||
@Dict(dicCode = "del_flag")
|
||||
// @Dict(dicCode = "del_flag")
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
|
||||
+32
-31
@@ -1,23 +1,19 @@
|
||||
package com.jero.modules.system.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
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>
|
||||
@@ -43,13 +39,13 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 登录账号
|
||||
*/
|
||||
@Excel(name = "登录账号", width = 15)
|
||||
@Excel(name = "账号", width = 15)
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@Excel(name = "真实姓名", width = 15)
|
||||
@Excel(name = "姓名", width = 15)
|
||||
private String realname;
|
||||
|
||||
/**
|
||||
@@ -67,13 +63,13 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Excel(name = "头像", width = 15,type = 2)
|
||||
// @Excel(name = "头像", width = 15,type = 2)
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
|
||||
// @Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
@@ -81,20 +77,20 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 性别(1:男 2:女)
|
||||
*/
|
||||
@Excel(name = "性别", width = 15,dicCode="sex")
|
||||
// @Excel(name = "性别", width = 15,dicCode="sex")
|
||||
@Dict(dicCode = "sex")
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
@Excel(name = "电子邮件", width = 15)
|
||||
// @Excel(name = "电子邮件", width = 15)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@Excel(name = "电话", width = 15)
|
||||
// @Excel(name = "电话", width = 15)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
@@ -103,32 +99,26 @@ public class SysUser implements Serializable {
|
||||
private String orgCode;
|
||||
|
||||
/**部门名称*/
|
||||
@Excel(name = "部门", width = 15)
|
||||
private transient String orgCodeTxt;
|
||||
|
||||
/**
|
||||
* 状态(1:正常 2:冻结 )
|
||||
*/
|
||||
@Excel(name = "状态", width = 15,dicCode="user_status")
|
||||
@Dict(dicCode = "user_status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除状态(0,正常,1已删除)
|
||||
*/
|
||||
@Excel(name = "删除状态", width = 15,dicCode="del_flag")
|
||||
// @Excel(name = "删除状态", width = 15,dicCode="del_flag")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 工号,唯一键
|
||||
*/
|
||||
@Excel(name = "工号", width = 15)
|
||||
@Excel(name = "员工号", width = 15)
|
||||
private String workNo;
|
||||
|
||||
/**
|
||||
* 座机号
|
||||
*/
|
||||
@Excel(name = "座机号", width = 15)
|
||||
// @Excel(name = "座机号", width = 15)
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
@@ -158,13 +148,13 @@ public class SysUser implements Serializable {
|
||||
/**
|
||||
* 身份(0 普通成员 1 上级)
|
||||
*/
|
||||
@Excel(name="(1普通成员 2上级)",width = 15)
|
||||
// @Excel(name="(1普通成员 2上级)",width = 15)
|
||||
private Integer userIdentity;
|
||||
|
||||
/**
|
||||
* 负责部门
|
||||
*/
|
||||
@Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
// @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
private String departIds;
|
||||
|
||||
@@ -177,4 +167,15 @@ public class SysUser implements Serializable {
|
||||
private String clientId;
|
||||
|
||||
private String thirdId;//用户域账号
|
||||
|
||||
@Excel(name = "员工类型", width = 15, dicCode = "worker_type")
|
||||
@Dict(dicCode = "worker_type")
|
||||
private String workerType;//员工种类(1-正式工,2-临时工)
|
||||
|
||||
/**
|
||||
* 状态(1:正常 2:冻结 )
|
||||
*/
|
||||
@Excel(name = "状态", width = 15,dicCode="user_status")
|
||||
@Dict(dicCode = "user_status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,6 +55,6 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
|
||||
* @return
|
||||
*/
|
||||
@Select("UPDATE sys_depart t1 JOIN sys_depart t2 ON t1.parent_code = t2.org_code SET t1.parent_id = t2.id")
|
||||
int updateAllParentId();
|
||||
void updateAllParentId();
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -135,5 +135,5 @@ public interface ISysDepartService extends IService<SysDepart>{
|
||||
* 更新所有组织的父节点id
|
||||
* @return
|
||||
*/
|
||||
int updateAllParentId();
|
||||
void updateAllParentId();
|
||||
}
|
||||
|
||||
+5
-4
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.PasswordUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -20,11 +19,12 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PipedOutputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -245,6 +245,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
sysUser.setThirdId(employee.getWorker_user_id());
|
||||
sysUser.setActivitiSync(CommonConstant.ACT_SYNC_1);
|
||||
sysUser.setWorkNo(employee.getEmployee_id());
|
||||
sysUser.setWorkerType("Employee".equals(employee.getWorker_type())? CommonConstant.WORKER_TYPE_1 : CommonConstant.WORKER_TYPE_2);
|
||||
// sysUser.setUpdateTime(employee.getUpdate_time());
|
||||
|
||||
sysUser.setCreateTime(new Date());
|
||||
|
||||
+4
-2
@@ -533,8 +533,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SysDepartMapper departMapper;
|
||||
@Override
|
||||
public int updateAllParentId() {
|
||||
return this.updateAllParentId();
|
||||
public void updateAllParentId() {
|
||||
departMapper.updateAllParentId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user