流转工作流程

This commit is contained in:
2024-05-12 16:15:34 +08:00
parent 1a9beeed93
commit eb9818dd7f
71 changed files with 3810 additions and 302 deletions

View File

@@ -121,4 +121,7 @@ public interface UserFeignClient {
@PostMapping("/getUserListByIds")
HttpResult<List<User>> getUserListByIds(@RequestBody List<String> ids);
@PostMapping("/getUserVOByIdList")
HttpResult<List<UserVO>> getUserVOByIdList(@RequestBody List<String> ids);
}

View File

@@ -111,6 +111,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<UserVO>> getUserVOByIdList(List<String> ids) {
log.error("{}异常,降级处理,异常为:{}","根据用户id集合获取用户集合",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -22,6 +22,9 @@ public class UserVO extends UserParam implements Serializable {
@ApiModelProperty("用户Id")
private String id;
@ApiModelProperty("用户名")
private String name;
@ApiModelProperty("登录名")
private String loginName;
@@ -34,6 +37,9 @@ public class UserVO extends UserParam implements Serializable {
@ApiModelProperty("登录时间")
private String loginTime;
@ApiModelProperty("部门编号")
private String deptId;
@ApiModelProperty("部门名称")
private String deptName;

View File

@@ -442,6 +442,17 @@ public class UserController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/getUserVOByIdList")
@ApiOperation("根据用户id集合查询用户VO")
@ApiImplicitParam(name = "ids", value = "用户id集合", required = true)
public HttpResult<List<UserVO>> getUserVOByIdList(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("getUserVOByIdList");
LogUtil.njcnDebug(log, "{}用户id为{}", methodDescribe, ids);
List<UserVO> userVO = userService.getUserVOByIdList(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userVO, methodDescribe);
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/appuserByIdList")
@ApiOperation("根据用户id集合查询用户信息")

View File

@@ -56,4 +56,6 @@ public interface UserMapper extends BaseMapper<User> {
* @return 查询出的用户数据
*/
List<UserExcel> queryExportUser(@Param("ew") QueryWrapper<UserExcel> queryWrapper);
List<UserVO> getUserVOByIdList(@Param("ids") List<String> ids);
}

View File

@@ -65,5 +65,27 @@
</select>
<select id="getUserVOByIdList" resultType="UserVO">
SELECT
sys_user.id,
sys_user.name,
sys_user.Dept_Id deptId,
sys_user.login_name loginName,
sys_user.Register_Time registerTime,
sys_user.Login_Time loginTime,
sys_user.State state,
sys_dept.name deptName
FROM sys_user sys_user
LEFT JOIN
sys_dept sys_dept
ON sys_user.Dept_Id = sys_dept.Id
Where sys_user.id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>

View File

@@ -193,7 +193,11 @@ public interface IUserService extends IService<User> {
List<UserVO> listAllUserByDeptId(String deptId);
List<UserVO> getUserVOByIdList(List<String> ids);
List<String> getUserIdByRoleId(List<String> roleId);
List<User> simpleList();
}

View File

@@ -535,7 +535,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
lambdaQueryWrapper.eq(User::getDeptId, deptId);
}
lambdaQueryWrapper.eq(User::getState, DataStateEnum.ENABLE.getCode())
.select(User::getName,User::getId);
.select(User::getName, User::getId);
List<User> users = this.baseMapper.selectList(lambdaQueryWrapper);
if (CollectionUtil.isEmpty(users)) {
return new ArrayList<>();
@@ -544,14 +544,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
}
}
@Override
public List<UserVO> getUserVOByIdList(List<String> ids) {
//查询所有状态正常的用户信息目前只要id和name
if (CollectionUtil.isEmpty(ids)) {
return new ArrayList<>();
}
List<UserVO> userVOList = this.baseMapper.getUserVOByIdList(ids);
return userVOList;
}
@Override
public List<String> getUserIdByRoleId(List<String> roleId) {
LambdaQueryWrapper<UserRole> userRoleLambdaQueryWrapper = new LambdaQueryWrapper<>();
userRoleLambdaQueryWrapper.in(UserRole::getRoleId,roleId);
userRoleLambdaQueryWrapper.in(UserRole::getRoleId, roleId);
List<UserRole> userRole = userRoleService.list(userRoleLambdaQueryWrapper);
if(CollectionUtil.isEmpty(userRole)){
if (CollectionUtil.isEmpty(userRole)) {
return new ArrayList<>();
}else{
} else {
return userRole.stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());
}
}
@@ -559,7 +569,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
@Override
public List<User> simpleList() {
LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
userLambdaQueryWrapper.select(User::getId,User::getName).eq(User::getState,DataStateEnum.ENABLE.getCode());
userLambdaQueryWrapper.select(User::getId, User::getName).eq(User::getState, DataStateEnum.ENABLE.getCode());
return this.baseMapper.selectList(userLambdaQueryWrapper);
}