update:选人模块查询条件修改
This commit is contained in:
+14
-3
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.controller;
|
package com.jero.modules.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
@@ -12,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,14 +84,23 @@ public class SysGroupController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分组管理-删除
|
* 分组管理-删除
|
||||||
* @param id
|
* @param jsonObject
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("sys:group:edit")
|
// @RequiresPermissions("sys:group:edit")
|
||||||
@GetMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation(value = "分组管理-删除", notes = "分组管理-删除")
|
@ApiOperation(value = "分组管理-删除", notes = "分组管理-删除")
|
||||||
public Result<Object> delete(@RequestParam(name="id") String id) {
|
public Result<Object> delete(@RequestBody JSONObject jsonObject) {
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
return sysGroupService.delete(id);
|
return sysGroupService.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RequiresPermissions("sys:group:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation(value = "分组管理-列表查询", notes = "分组管理-列表查询")
|
||||||
|
public Result<Object> list() {
|
||||||
|
List<SysGroup> list = sysGroupService.list();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -137,6 +137,7 @@ public class SysUserController {
|
|||||||
|
|
||||||
// 处理手机号和邮箱,进行对应加密
|
// 处理手机号和邮箱,进行对应加密
|
||||||
Map<String, String[]> parameterMap = req.getParameterMap();
|
Map<String, String[]> parameterMap = req.getParameterMap();
|
||||||
|
String groupId = req.getParameter("groupId");
|
||||||
this.sysUserService.encryptReqMapData(parameterMap);
|
this.sysUserService.encryptReqMapData(parameterMap);
|
||||||
user.setEmail(this.sysUserService.proceedEmailEncrypt(user.getEmail()));
|
user.setEmail(this.sysUserService.proceedEmailEncrypt(user.getEmail()));
|
||||||
user.setPhone(this.sysUserService.proceedPhoneEncrypt(user.getPhone()));
|
user.setPhone(this.sysUserService.proceedPhoneEncrypt(user.getPhone()));
|
||||||
@@ -154,7 +155,7 @@ public class SysUserController {
|
|||||||
}
|
}
|
||||||
IPage<SysUser> pageList;
|
IPage<SysUser> pageList;
|
||||||
try {
|
try {
|
||||||
pageList = sysUserService.queryPage(page, subDepIds, roleId, queryWrapper);
|
pageList = sysUserService.queryPage(page, subDepIds, roleId, groupId, queryWrapper);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return Result.error(MessageUtils.getMessage(ResultCommon.ERROR));
|
return Result.error(MessageUtils.getMessage(ResultCommon.ERROR));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,6 +251,13 @@ public class SysUser implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String realnameOrUsername;
|
private String realnameOrUsername;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组的id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "分组的id")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String groupId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼接真实姓名和工号形成唯一的用户信息可用户查看
|
* 拼接真实姓名和工号形成唯一的用户信息可用户查看
|
||||||
* 不能用get开头,否则会造成初始化queryWrapper的bug
|
* 不能用get开头,否则会造成初始化queryWrapper的bug
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
|
|||||||
* 分页查询用户,可支持组织机构检索
|
* 分页查询用户,可支持组织机构检索
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<SysUser> queryPage(Page<SysUser> page, @Param("departIds") List<String> subDepIds , @Param("roleId") String roleId , @Param(Constants.WRAPPER) Wrapper<SysUser> wrapper);
|
IPage<SysUser> queryPage(Page<SysUser> page, @Param("departIds") List<String> subDepIds , @Param("roleId") String roleId ,
|
||||||
|
@Param("groupId") String groupId, @Param(Constants.WRAPPER) Wrapper<SysUser> wrapper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户账号查询用户信息
|
* 通过用户账号查询用户信息
|
||||||
|
|||||||
@@ -12,6 +12,14 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="groupId != null and groupId !=' '">
|
||||||
|
and id in (select user_id from sys_user_group where group_id = #{groupId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="roleId!=null and roleId!=''">
|
||||||
|
and id in (select user_id from sys_user_role where role_id = #{roleId}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
<if test="roleId!=null and roleId!=''">
|
<if test="roleId!=null and roleId!=''">
|
||||||
and id in (select user_id from sys_user_role where role_id = #{roleId}
|
and id in (select user_id from sys_user_role where role_id = #{roleId}
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
* @param queryWrapper
|
* @param queryWrapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<SysUser> queryPage(Page<SysUser> page, List<String> subDepIds, String roleId, QueryWrapper<SysUser> queryWrapper);
|
IPage<SysUser> queryPage(Page<SysUser> page, List<String> subDepIds, String roleId, String groupId, QueryWrapper<SysUser> queryWrapper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
|
|||||||
+2
-2
@@ -79,8 +79,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<SysUser> queryPage(Page<SysUser> page, List<String> subDepIds, String roleId, QueryWrapper<SysUser> queryWrapper){
|
public IPage<SysUser> queryPage(Page<SysUser> page, List<String> subDepIds, String roleId, String groupId, QueryWrapper<SysUser> queryWrapper){
|
||||||
IPage<SysUser> sysUserIPage = this.userMapper.queryPage(page, subDepIds, roleId, queryWrapper);
|
IPage<SysUser> sysUserIPage = this.userMapper.queryPage(page, subDepIds, roleId, groupId, queryWrapper);
|
||||||
sysUserIPage.getRecords().forEach(user -> {
|
sysUserIPage.getRecords().forEach(user -> {
|
||||||
// 对手机号、邮箱进行解密处理
|
// 对手机号、邮箱进行解密处理
|
||||||
proceedUserInfoDecrypt(user);
|
proceedUserInfoDecrypt(user);
|
||||||
|
|||||||
Reference in New Issue
Block a user