mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-23 02:48:34 +08:00
update 优化统一用户昵称
This commit is contained in:
@@ -80,16 +80,16 @@ public interface RemoteUserService {
|
|||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户昵称
|
* 通过用户ID查询用户昵称
|
||||||
*
|
*
|
||||||
* @param userId 用户id
|
* @param userId 用户ID
|
||||||
* @return 结果
|
* @return 用户昵称
|
||||||
*/
|
*/
|
||||||
String selectNicknameById(Long userId);
|
String selectNicknameById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID查询用户账户
|
* 通过用户ID查询用户昵称
|
||||||
*
|
*
|
||||||
* @param userIds 用户ID 多个用逗号隔开
|
* @param userIds 用户ID 多个用逗号隔开
|
||||||
* @return 用户名称
|
* @return 用户昵称
|
||||||
*/
|
*/
|
||||||
String selectNicknameByIds(String userIds);
|
String selectNicknameByIds(String userIds);
|
||||||
|
|
||||||
@@ -158,11 +158,11 @@ public interface RemoteUserService {
|
|||||||
List<RemoteUserVo> selectUsersByPostIds(List<Long> postIds);
|
List<RemoteUserVo> selectUsersByPostIds(List<Long> postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户 ID 列表查询用户名称映射关系
|
* 根据用户 ID 列表查询用户昵称映射关系
|
||||||
*
|
*
|
||||||
* @param userIds 用户 ID 列表
|
* @param userIds 用户 ID 列表
|
||||||
* @return Map,其中 key 为用户 ID,value 为对应的用户名称
|
* @return Map,其中 key 为用户 ID,value 为对应的用户昵称
|
||||||
*/
|
*/
|
||||||
Map<Long, String> selectUserNamesByIds(List<Long> userIds);
|
Map<Long, String> selectUserNicksByIds(List<Long> userIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class SysUserOnline implements Serializable {
|
|||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class RemoteFlowCopy implements Serializable {
|
|||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
private String userName;
|
private String nickName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public interface CacheNames {
|
|||||||
String SYS_USER_NAME = "sys_user_name#30d";
|
String SYS_USER_NAME = "sys_user_name#30d";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
String SYS_NICKNAME = "sys_nickname#30d";
|
String SYS_NICKNAME = "sys_nickname#30d";
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.dromara.common.core.utils.ServletUtils;
|
import org.dromara.common.core.utils.ServletUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
||||||
import org.dromara.common.doc.core.enhancer.SaTokenJavadocResolver;
|
|
||||||
import org.dromara.common.doc.core.enhancer.SaTokenMetadataResolver;
|
|
||||||
import org.dromara.common.doc.core.resolver.JavadocResolver;
|
import org.dromara.common.doc.core.resolver.JavadocResolver;
|
||||||
import org.dromara.common.doc.core.resolver.SaTokenAnnotationMetadataJavadocResolver;
|
import org.dromara.common.doc.core.resolver.SaTokenAnnotationMetadataJavadocResolver;
|
||||||
import org.dromara.common.doc.handler.OpenApiHandler;
|
import org.dromara.common.doc.handler.OpenApiHandler;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ public class ExportDemoVo {
|
|||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "用户名", index = 0)
|
@ExcelProperty(value = "用户昵称", index = 0)
|
||||||
@NotEmpty(message = "用户名不能为空", groups = AddGroup.class)
|
@NotEmpty(message = "用户昵称不能为空", groups = AddGroup.class)
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ public class SysUserExportVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "登录名称")
|
@ExcelProperty(value = "用户账号")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "用户名称")
|
@ExcelProperty(value = "用户昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ public class SysUserImportVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "登录名称")
|
@ExcelProperty(value = "用户账号")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户昵称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "用户名称")
|
@ExcelProperty(value = "用户昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -399,12 +399,12 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户 ID 列表查询用户名称映射关系
|
* 根据用户 ID 列表查询用户昵称映射关系
|
||||||
*
|
*
|
||||||
* @param userIds 用户 ID 列表
|
* @param userIds 用户 ID 列表
|
||||||
* @return Map,其中 key 为用户 ID,value 为对应的用户名称
|
* @return Map,其中 key 为用户 ID,value 为对应的用户昵称
|
||||||
*/
|
*/
|
||||||
public Map<Long, String> selectUserNamesByIds(List<Long> userIds) {
|
public Map<Long, String> selectUserNicksByIds(List<Long> userIds) {
|
||||||
if (CollUtil.isEmpty(userIds)) {
|
if (CollUtil.isEmpty(userIds)) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public interface ISysUserService {
|
|||||||
String selectUserPostGroup(Long userId);
|
String selectUserPostGroup(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户名称是否唯一
|
* 校验用户账号是否唯一
|
||||||
*
|
*
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
|||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @param userId 用户名称
|
* @param userId 用户ID
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验用户名称是否唯一
|
* 校验用户账号是否唯一
|
||||||
*
|
*
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class FlowCopyBo implements Serializable {
|
|||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
private String userName;
|
private String nickName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ public class FlowCopyVo implements Serializable {
|
|||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户昵称
|
||||||
*/
|
*/
|
||||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "userId")
|
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "userId")
|
||||||
private String userName;
|
private String nickName;
|
||||||
|
|
||||||
public FlowCopyVo(Long userId) {
|
public FlowCopyVo(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class WorkflowGlobalListener implements GlobalListener {
|
|||||||
FlowCopyBo bo = new FlowCopyBo();
|
FlowCopyBo bo = new FlowCopyBo();
|
||||||
Long id = Convert.toLong(x);
|
Long id = Convert.toLong(x);
|
||||||
bo.setUserId(id);
|
bo.setUserId(id);
|
||||||
bo.setUserName(remoteUserService.selectUserNameById(id));
|
bo.setNickName(remoteUserService.selectNicknameById(id));
|
||||||
return bo;
|
return bo;
|
||||||
});
|
});
|
||||||
variable.put(FlowConstant.FLOW_COPY_LIST, list);
|
variable.put(FlowConstant.FLOW_COPY_LIST, list);
|
||||||
@@ -162,7 +162,7 @@ public class WorkflowGlobalListener implements GlobalListener {
|
|||||||
flowTask.setPermissionList(List.of(userIdArray));
|
flowTask.setPermissionList(List.of(userIdArray));
|
||||||
// 移除已处理的状态变量
|
// 移除已处理的状态变量
|
||||||
variable.remove(nodeKey);
|
variable.remove(nodeKey);
|
||||||
FlowEngine.insService().removeVariables(flowTask.getInstanceId(),nodeKey);
|
FlowEngine.insService().removeVariables(flowTask.getInstanceId(), nodeKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
|||||||
|
|
||||||
List<Long> longIds = StreamUtils.toList(ids, Convert::toLong);
|
List<Long> longIds = StreamUtils.toList(ids, Convert::toLong);
|
||||||
Map<Long, String> rawMap = switch (type) {
|
Map<Long, String> rawMap = switch (type) {
|
||||||
case USER -> remoteUserService.selectUserNamesByIds(longIds);
|
case USER -> remoteUserService.selectUserNicksByIds(longIds);
|
||||||
case ROLE -> remoteRoleService.selectRoleNamesByIds(longIds);
|
case ROLE -> remoteRoleService.selectRoleNamesByIds(longIds);
|
||||||
case DEPT -> remoteDeptService.selectDeptNamesByIds(longIds);
|
case DEPT -> remoteDeptService.selectDeptNamesByIds(longIds);
|
||||||
case POST -> remotePostService.selectPostNamesByIds(longIds);
|
case POST -> remotePostService.selectPostNamesByIds(longIds);
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|||||||
FlowParams flowParams = FlowParams.build()
|
FlowParams flowParams = FlowParams.build()
|
||||||
.skipType(SkipType.NONE.getKey())
|
.skipType(SkipType.NONE.getKey())
|
||||||
.hisStatus(TaskStatusEnum.COPY.getStatus())
|
.hisStatus(TaskStatusEnum.COPY.getStatus())
|
||||||
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getUserName));
|
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getNickName));
|
||||||
HisTask hisTask = hisTaskService.setSkipHisTask(task, flowNode, flowParams);
|
HisTask hisTask = hisTaskService.setSkipHisTask(task, flowNode, flowParams);
|
||||||
hisTask.setCreateTime(updateTime);
|
hisTask.setCreateTime(updateTime);
|
||||||
hisTask.setUpdateTime(updateTime);
|
hisTask.setUpdateTime(updateTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user