|
@@ -30,6 +30,7 @@ import com.xjrsoft.module.organization.service.*;
|
|
|
import com.xjrsoft.module.organization.utils.OrganizationUtil;
|
|
import com.xjrsoft.module.organization.utils.OrganizationUtil;
|
|
|
import com.xjrsoft.module.organization.vo.*;
|
|
import com.xjrsoft.module.organization.vo.*;
|
|
|
import com.xjrsoft.module.oss.factory.OssFactory;
|
|
import com.xjrsoft.module.oss.factory.OssFactory;
|
|
|
|
|
+import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -79,6 +80,7 @@ public class UserController {
|
|
|
|
|
|
|
|
private final IUserStudentService userStudentService;
|
|
private final IUserStudentService userStudentService;
|
|
|
private final IBaseClassService baseClassService;
|
|
private final IBaseClassService baseClassService;
|
|
|
|
|
+ private final IWorkflowExecuteService workflowExecuteService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
@@ -99,22 +101,22 @@ public class UserController {
|
|
|
@ApiOperation(value = "用户列表(分页)")
|
|
@ApiOperation(value = "用户列表(分页)")
|
|
|
public R page(UserPageDto dto) {
|
|
public R page(UserPageDto dto) {
|
|
|
List<Long> deptIds = new ArrayList<>();
|
|
List<Long> deptIds = new ArrayList<>();
|
|
|
- if (ObjectUtil.isNotNull(dto.getDepartmentId())){
|
|
|
|
|
- List<Department> list = redisUtil.get(GlobalConstant.DEP_CACHE_KEY,new TypeReference<List<Department>>() {
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(dto.getDepartmentId())) {
|
|
|
|
|
+ List<Department> list = redisUtil.get(GlobalConstant.DEP_CACHE_KEY, new TypeReference<List<Department>>() {
|
|
|
});
|
|
});
|
|
|
//当前部门的层级
|
|
//当前部门的层级
|
|
|
String hierarchy = list.stream().filter(x -> x.getId().equals(dto.getDepartmentId())).findFirst().orElse(new Department()).getHierarchy();
|
|
String hierarchy = list.stream().filter(x -> x.getId().equals(dto.getDepartmentId())).findFirst().orElse(new Department()).getHierarchy();
|
|
|
- if (StrUtil.isNotBlank(hierarchy)){
|
|
|
|
|
|
|
+ if (StrUtil.isNotBlank(hierarchy)) {
|
|
|
//层级里面包含当前部门层级的就是它的子集,如1-1,下面包含了1-1、1-1-2这种
|
|
//层级里面包含当前部门层级的就是它的子集,如1-1,下面包含了1-1、1-1-2这种
|
|
|
- deptIds = list.stream().filter(x -> StrUtil.isNotBlank(x.getHierarchy())&&x.getHierarchy().contains(hierarchy)).map(Department::getId).collect(Collectors.toList());
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ deptIds = list.stream().filter(x -> StrUtil.isNotBlank(x.getHierarchy()) && x.getHierarchy().contains(hierarchy)).map(Department::getId).collect(Collectors.toList());
|
|
|
|
|
+ } else {
|
|
|
//如果不存在层级就查询自己的数据
|
|
//如果不存在层级就查询自己的数据
|
|
|
deptIds.add(dto.getDepartmentId());
|
|
deptIds.add(dto.getDepartmentId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//因为多表关联 会有多个表都使用了id字段, 所以必须专门指定主表的Id
|
|
//因为多表关联 会有多个表都使用了id字段, 所以必须专门指定主表的Id
|
|
|
- if (ObjectUtil.isNotNull(dto.getDepartmentId())){//不为空联合查询
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(dto.getDepartmentId())) {//不为空联合查询
|
|
|
IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class,
|
|
IPage<UserPageVo> page = userService.selectJoinListPage(ConventPage.getPage(dto), UserPageVo.class,
|
|
|
MPJWrappers.<User>lambdaJoin()
|
|
MPJWrappers.<User>lambdaJoin()
|
|
|
.disableSubLogicDel()
|
|
.disableSubLogicDel()
|
|
@@ -137,7 +139,7 @@ public class UserController {
|
|
|
PageOutput<UserPageVo> pageOutput = ConventPage.getPageOutput(page);
|
|
PageOutput<UserPageVo> pageOutput = ConventPage.getPageOutput(page);
|
|
|
|
|
|
|
|
return R.ok(pageOutput);
|
|
return R.ok(pageOutput);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
// LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
|
|
// LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
// queryWrapper.like(StrUtil.isNotBlank(dto.getKeyword()), User::getName, dto.getKeyword())
|
|
// queryWrapper.like(StrUtil.isNotBlank(dto.getKeyword()), User::getName, dto.getKeyword())
|
|
|
// .or(StrUtil.isNotBlank(dto.getKeyword()), x -> x.like(StrUtil.isNotBlank(dto.getKeyword()), User::getCode, dto.getKeyword()))
|
|
// .or(StrUtil.isNotBlank(dto.getKeyword()), x -> x.like(StrUtil.isNotBlank(dto.getKeyword()), User::getCode, dto.getKeyword()))
|
|
@@ -202,7 +204,6 @@ public class UserController {
|
|
|
return R.ok(userService.update(dto));
|
|
return R.ok(userService.update(dto));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@GetMapping(value = "/current/info")
|
|
@GetMapping(value = "/current/info")
|
|
|
@ApiOperation(value = "当前登录用户信息")
|
|
@ApiOperation(value = "当前登录用户信息")
|
|
|
public R info() {
|
|
public R info() {
|
|
@@ -265,6 +266,14 @@ public class UserController {
|
|
|
return R.ok(vo);
|
|
return R.ok(vo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/pending/count")
|
|
|
|
|
+ @ApiOperation(value = "当前待办数量统计")
|
|
|
|
|
+ public RT<PendingCountDto> pendingCount() {
|
|
|
|
|
+ PendingCountDto pendingCountDto = new PendingCountDto();
|
|
|
|
|
+ pendingCountDto.setWfPendingCount(workflowExecuteService.pendingCount());
|
|
|
|
|
+
|
|
|
|
|
+ return RT.ok(pendingCountDto);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@PutMapping("/update/info")
|
|
@PutMapping("/update/info")
|
|
|
@ApiOperation(value = "登陆人修改自己得用户信息")
|
|
@ApiOperation(value = "登陆人修改自己得用户信息")
|
|
@@ -279,7 +288,6 @@ public class UserController {
|
|
|
return R.ok(userService.updateById(updateUserInfo));
|
|
return R.ok(userService.updateById(updateUserInfo));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@PutMapping("/update/password")
|
|
@PutMapping("/update/password")
|
|
|
@ApiOperation(value = "当前登录用户修改本人密码")
|
|
@ApiOperation(value = "当前登录用户修改本人密码")
|
|
|
public RT<Boolean> updatePassword(@RequestBody @Valid UpdatePasswordDto dto) {
|
|
public RT<Boolean> updatePassword(@RequestBody @Valid UpdatePasswordDto dto) {
|
|
@@ -381,15 +389,15 @@ public class UserController {
|
|
|
|
|
|
|
|
@PostMapping("/bind-unionid")
|
|
@PostMapping("/bind-unionid")
|
|
|
@ApiOperation(value = "绑定微信 UnionId")
|
|
@ApiOperation(value = "绑定微信 UnionId")
|
|
|
- public R bindUnionId(@RequestBody BindOpenidDto dto) {
|
|
|
|
|
- User user = userService.getOne(Wrappers.<User>query().lambda().select(User::getId, User::getOpenId,User::getUnionId).eq(User::getId, dto.getId()), false);
|
|
|
|
|
|
|
+ public R bindUnionId(@RequestBody BindOpenidDto dto) {
|
|
|
|
|
+ User user = userService.getOne(Wrappers.<User>query().lambda().select(User::getId, User::getOpenId, User::getUnionId).eq(User::getId, dto.getId()), false);
|
|
|
if (user != null) {
|
|
if (user != null) {
|
|
|
if (StrUtil.isNotBlank(user.getUnionId())) {
|
|
if (StrUtil.isNotBlank(user.getUnionId())) {
|
|
|
return R.error("该用户已经绑定微信!");
|
|
return R.error("该用户已经绑定微信!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
long count = userService.count(Wrappers.<User>query().lambda().eq(User::getUnionId, dto.getOpenid()));
|
|
long count = userService.count(Wrappers.<User>query().lambda().eq(User::getUnionId, dto.getOpenid()));
|
|
|
- if(count > 0){
|
|
|
|
|
|
|
+ if (count > 0) {
|
|
|
return R.error("该用户已经绑定微信!");
|
|
return R.error("该用户已经绑定微信!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -398,9 +406,9 @@ public class UserController {
|
|
|
// updateUser.setOpenId(dto.getOpenid());
|
|
// updateUser.setOpenId(dto.getOpenid());
|
|
|
updateUser.setUnionId(dto.getOpenid());
|
|
updateUser.setUnionId(dto.getOpenid());
|
|
|
return R.ok(userService.updateById(updateUser));
|
|
return R.ok(userService.updateById(updateUser));
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
|
|
long count = userService.count(Wrappers.<User>query().lambda().eq(User::getOpenId, dto.getOpenid()));
|
|
|
- if(count > 0){
|
|
|
|
|
|
|
+ if (count > 0) {
|
|
|
return R.error("该用户已经绑定微信!");
|
|
return R.error("该用户已经绑定微信!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -409,13 +417,13 @@ public class UserController {
|
|
|
|
|
|
|
|
@PostMapping("/bind-openid")
|
|
@PostMapping("/bind-openid")
|
|
|
@ApiOperation(value = "绑定微信 Openid")
|
|
@ApiOperation(value = "绑定微信 Openid")
|
|
|
- public R bindOpenid(@RequestBody BindOpenidDto dto) {
|
|
|
|
|
|
|
+ public R bindOpenid(@RequestBody BindOpenidDto dto) {
|
|
|
return R.ok(userService.bindOpenid(dto));
|
|
return R.ok(userService.bindOpenid(dto));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/unbind-openid")
|
|
@GetMapping("/unbind-openid")
|
|
|
@ApiOperation(value = "取消绑定微信 UnionId")
|
|
@ApiOperation(value = "取消绑定微信 UnionId")
|
|
|
- public R unbindOpenid(@RequestParam Long id) {
|
|
|
|
|
|
|
+ public R unbindOpenid(@RequestParam Long id) {
|
|
|
return R.ok(userService.unbindOpenid(id));
|
|
return R.ok(userService.unbindOpenid(id));
|
|
|
}
|
|
}
|
|
|
|
|
|