feat(erp): 实现请购单双层审批流程
- 在提交审批接口中新增指定一审审批人的参数 - 实现一审和二审的两级审批逻辑,一审为管理层审批,二审固定为陈清鑫 - 添加审批人身份验证,确保只有指定审批人才能进行审批操作 - 在前端界面中增加提交审批选择审批人弹窗 - 更新请购单状态显示,新增一审通过待二审状态(状态值6) - 添加审批进度展示,显示一审人和二审人的审批情况 - 实现基于角色的审批权限控制,管理层可进行一审,特定人员可进行二审 - 新增查询审批人列表的API接口,支持按角色筛选审批人 - 优化审批按钮显示逻辑,根据不同状态和用户身份显示相应操作按钮
This commit is contained in:
@@ -44,6 +44,14 @@ public interface ISysUserService {
|
||||
SysUser selectUserByUserName(String userName);
|
||||
Map<String, String> selectNickNameMapByUserNames(List<String> userNames);
|
||||
|
||||
/**
|
||||
* 根据角色标识查询用户列表(用于选择审批人等场景)
|
||||
*
|
||||
* @param roleKey 角色标识
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<SysUser> selectUserByRoleKey(String roleKey);
|
||||
|
||||
/**
|
||||
* 通过手机号查询用户
|
||||
*
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
@@ -168,6 +169,21 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
return nickMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> selectUserByRoleKey(String roleKey) {
|
||||
// 查询角色
|
||||
SysRole role = roleMapper.selectOne(Wrappers.<SysRole>lambdaQuery()
|
||||
.eq(SysRole::getRoleKey, roleKey));
|
||||
if (role == null) return Collections.emptyList();
|
||||
// 查询拥有该角色的用户ID列表
|
||||
List<Long> userIds = userRoleMapper.selectUserIdsByRoleId(role.getRoleId());
|
||||
if (CollUtil.isEmpty(userIds)) return Collections.emptyList();
|
||||
// 查询用户详情
|
||||
return baseMapper.selectUserList(Wrappers.<SysUser>query()
|
||||
.in("u.user_id", userIds)
|
||||
.eq("u.del_flag", UserConstants.USER_NORMAL));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过手机号查询用户
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user