Merge remote-tracking branch 'origin/feature-ui-fix' into feature-ui-fix
This commit is contained in:
-26
@@ -1,7 +1,6 @@
|
|||||||
package com.jero.common.aspect;
|
package com.jero.common.aspect;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.alibaba.fastjson.serializer.PropertyFilter;
|
import com.alibaba.fastjson.serializer.PropertyFilter;
|
||||||
import com.jero.common.api.dto.LogDTO;
|
import com.jero.common.api.dto.LogDTO;
|
||||||
import com.jero.common.api.vo.Results;
|
import com.jero.common.api.vo.Results;
|
||||||
@@ -82,31 +81,6 @@ public class AutoLogAspect {
|
|||||||
}
|
}
|
||||||
//注解上的描述,操作日志内容
|
//注解上的描述,操作日志内容
|
||||||
dto.setLogType(syslog.logType());
|
dto.setLogType(syslog.logType());
|
||||||
//用户日志 ,根据不同的操作类型 生成不同的日志内容
|
|
||||||
if ("user".equals(content)){
|
|
||||||
if (syslog.operateType() == 2){
|
|
||||||
Object result = ((Results) obj).getResult();
|
|
||||||
String s = JSONObject.toJSONString(result);
|
|
||||||
JSONObject jsonObject = JSON.parseObject(s);
|
|
||||||
String id =(String)jsonObject.get("id");
|
|
||||||
content = "新增用户,id:"+id;
|
|
||||||
}else if (syslog.operateType() == 3){
|
|
||||||
Object result = ((Results) obj).getResult();
|
|
||||||
String s = JSONObject.toJSONString(result);
|
|
||||||
JSONObject jsonObject = JSON.parseObject(s);
|
|
||||||
String id =(String)jsonObject.get("id");
|
|
||||||
content = "修改,id:"+id;
|
|
||||||
}else if (syslog.operateType() == 4){
|
|
||||||
String message = ((Results) obj).getMessage();
|
|
||||||
String result = (String)((Results) obj).getResult();
|
|
||||||
if ("删除用户成功".equals(message)){
|
|
||||||
content = "删除用户,id:"+result;
|
|
||||||
}else {
|
|
||||||
content = "批量删除用户,ids:"+result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dto.setLogContent(content);
|
dto.setLogContent(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ public @interface AutoLog {
|
|||||||
/**
|
/**
|
||||||
* 操作日志类型
|
* 操作日志类型
|
||||||
*
|
*
|
||||||
* @return (1查询,2添加,3修改,4删除)
|
* @return (1查询,2添加,3修改,4删除,5导入,6导出)
|
||||||
*/
|
*/
|
||||||
int operateType() default 0;
|
int operateType() default 0;
|
||||||
|
|
||||||
|
|||||||
+8
-6
@@ -22,6 +22,8 @@ import com.jero.common.system.util.JwtUtil;
|
|||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.util.*;
|
import com.jero.common.util.*;
|
||||||
import com.jero.modules.base.service.BaseCommonService;
|
import com.jero.modules.base.service.BaseCommonService;
|
||||||
|
import com.jero.modules.system.dto.SysUserDTO;
|
||||||
|
import com.jero.modules.system.dto.SysUserRoleDTO;
|
||||||
import com.jero.modules.system.entity.*;
|
import com.jero.modules.system.entity.*;
|
||||||
import com.jero.modules.system.model.DepartIdModel;
|
import com.jero.modules.system.model.DepartIdModel;
|
||||||
import com.jero.modules.system.model.SysUserSysDepartModel;
|
import com.jero.modules.system.model.SysUserSysDepartModel;
|
||||||
@@ -166,7 +168,7 @@ public class SysUserController {
|
|||||||
|
|
||||||
@RequiresPermissions("user:add")
|
@RequiresPermissions("user:add")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@AutoLog(operateType = 2,value = "user")
|
@AutoLog(operateType = 2,value = "用户新增")
|
||||||
public Results<Object> add(@RequestBody JSONObject jsonObject) {
|
public Results<Object> add(@RequestBody JSONObject jsonObject) {
|
||||||
try {
|
try {
|
||||||
String selectedRoles = jsonObject.getString(SELECTED_ROLES);
|
String selectedRoles = jsonObject.getString(SELECTED_ROLES);
|
||||||
@@ -221,7 +223,7 @@ public class SysUserController {
|
|||||||
|
|
||||||
@RequiresPermissions("user:edit")
|
@RequiresPermissions("user:edit")
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@AutoLog(operateType = 3,value = "user")
|
@AutoLog(operateType = 3,value = "用户编辑")
|
||||||
public Results<SysUser> edit(@RequestBody JSONObject jsonObject) {
|
public Results<SysUser> edit(@RequestBody JSONObject jsonObject) {
|
||||||
String rsaPublicKey = jsonObject.getString(RSA_PUBLIC_KEY);
|
String rsaPublicKey = jsonObject.getString(RSA_PUBLIC_KEY);
|
||||||
String roles = jsonObject.getString(SELECTED_ROLES);
|
String roles = jsonObject.getString(SELECTED_ROLES);
|
||||||
@@ -271,7 +273,7 @@ public class SysUserController {
|
|||||||
|
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@RequiresPermissions("sys:user:sel")
|
@RequiresPermissions("sys:user:sel")
|
||||||
@AutoLog(operateType = 4,value = "user")
|
@AutoLog(operateType = 4,value = "用户删除")
|
||||||
public Results<String> delete(@RequestBody Map<String,String> map) {
|
public Results<String> delete(@RequestBody Map<String,String> map) {
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
String id = map.get("id");
|
String id = map.get("id");
|
||||||
@@ -285,7 +287,7 @@ public class SysUserController {
|
|||||||
|
|
||||||
@PostMapping("/deleteBatch")
|
@PostMapping("/deleteBatch")
|
||||||
@RequiresPermissions("sys:user:sel")
|
@RequiresPermissions("sys:user:sel")
|
||||||
@AutoLog(operateType = 4,value = "user")
|
@AutoLog(operateType = 4,value = "用户批量删除")
|
||||||
public Results<String> deleteBatch(@RequestBody Map<String, String> map) {
|
public Results<String> deleteBatch(@RequestBody Map<String, String> map) {
|
||||||
String ids = map.get("ids");
|
String ids = map.get("ids");
|
||||||
if(StringUtils.isBlank(ids)){
|
if(StringUtils.isBlank(ids)){
|
||||||
@@ -773,7 +775,7 @@ public class SysUserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/deleteUserRole")
|
@PostMapping("/deleteUserRole")
|
||||||
@RequiresPermissions("sys:user:sel")
|
@RequiresPermissions("sys:user:sel")
|
||||||
public Results<Object> deleteUserRole(@RequestBody SysUserRole sysUserRole) {
|
public Results<Object> deleteUserRole(@RequestBody SysUserRoleDTO sysUserRole) {
|
||||||
try {
|
try {
|
||||||
String userId = sysUserRole.getUserId();
|
String userId = sysUserRole.getUserId();
|
||||||
String roleId = sysUserRole.getRoleId();
|
String roleId = sysUserRole.getRoleId();
|
||||||
@@ -1235,7 +1237,7 @@ public class SysUserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/deleteRecycleBin")
|
@PostMapping("/deleteRecycleBin")
|
||||||
@RequiresPermissions("sys:user:sel")
|
@RequiresPermissions("sys:user:sel")
|
||||||
public Results<T> deleteRecycleBin(@RequestBody SysUser sysUser) {
|
public Results<T> deleteRecycleBin(@RequestBody SysUserDTO sysUser) {
|
||||||
String userIds = sysUser.getUserIds();
|
String userIds = sysUser.getUserIds();
|
||||||
if (StringUtils.isNotBlank(userIds)) {
|
if (StringUtils.isNotBlank(userIds)) {
|
||||||
sysUserService.removeLogicDeleted(Arrays.asList(userIds.split(",")));
|
sysUserService.removeLogicDeleted(Arrays.asList(userIds.split(",")));
|
||||||
|
|||||||
+163
@@ -0,0 +1,163 @@
|
|||||||
|
package com.jero.modules.system.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @Author scott
|
||||||
|
* @since 2018-12-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SysUserDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账号
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 真实姓名
|
||||||
|
*/
|
||||||
|
private String realname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* md5密码盐
|
||||||
|
*/
|
||||||
|
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||||
|
private String salt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生日
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date birthday;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(1:男 2:女)
|
||||||
|
*/
|
||||||
|
@Dict(dicCode = "sex")
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子邮件
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门code(当前选择登录部门)
|
||||||
|
*/
|
||||||
|
private String orgCode;
|
||||||
|
|
||||||
|
/**部门名称*/
|
||||||
|
private transient String orgCodeTxt;
|
||||||
|
|
||||||
|
/**角色名称*/
|
||||||
|
private transient String roleTxt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1:正常 2:冻结 )
|
||||||
|
*/
|
||||||
|
@Dict(dicCode = "user_status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态(0,正常,1已删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工号,唯一键
|
||||||
|
*/
|
||||||
|
private String workNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 座机号
|
||||||
|
*/
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
* 同步工作流引擎1同步0不同步
|
||||||
|
*/
|
||||||
|
private Integer activitiSync;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份(0 普通成员 1 上级)
|
||||||
|
*/
|
||||||
|
private Integer userIdentity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责部门
|
||||||
|
*/
|
||||||
|
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||||
|
private String departIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多租户id配置,编辑用户的时候设置
|
||||||
|
*/
|
||||||
|
private String relTenantIds;
|
||||||
|
|
||||||
|
/**设备id uniapp推送用*/
|
||||||
|
private String clientId;
|
||||||
|
|
||||||
|
private String userIds;
|
||||||
|
|
||||||
|
}
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
package com.jero.modules.system.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户角色表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @Author scott
|
||||||
|
* @since 2018-12-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SysUserRoleDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色id
|
||||||
|
*/
|
||||||
|
private String roleId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userIds;
|
||||||
|
|
||||||
|
public SysUserRoleDTO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SysUserRoleDTO(String userId, String roleId) {
|
||||||
|
this.userId = userId;
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user