update 优化统一用户昵称

This commit is contained in:
疯狂的狮子Li
2026-03-10 15:55:08 +08:00
parent 76ed1c259d
commit 3df21f9ecb
17 changed files with 31 additions and 33 deletions

View File

@@ -80,16 +80,16 @@ public interface RemoteUserService {
/**
* 通过用户ID查询用户昵称
*
* @param userId 用户id
* @return 结果
* @param userId 用户ID
* @return 用户昵称
*/
String selectNicknameById(Long userId);
/**
* 通过用户ID查询用户账户
* 通过用户ID查询用户昵称
*
* @param userIds 用户ID 多个用逗号隔开
* @return 用户
* @return 用户
*/
String selectNicknameByIds(String userIds);
@@ -158,11 +158,11 @@ public interface RemoteUserService {
List<RemoteUserVo> selectUsersByPostIds(List<Long> postIds);
/**
* 根据用户 ID 列表查询用户称映射关系
* 根据用户 ID 列表查询用户称映射关系
*
* @param userIds 用户 ID 列表
* @return Map其中 key 为用户 IDvalue 为对应的用户
* @return Map其中 key 为用户 IDvalue 为对应的用户
*/
Map<Long, String> selectUserNamesByIds(List<Long> userIds);
Map<Long, String> selectUserNicksByIds(List<Long> userIds);
}

View File

@@ -29,7 +29,7 @@ public class SysUserOnline implements Serializable {
private String deptName;
/**
* 用户名称
* 用户账号
*/
private String userName;

View File

@@ -23,8 +23,8 @@ public class RemoteFlowCopy implements Serializable {
private Long userId;
/**
* 用户
* 用户
*/
private String userName;
private String nickName;
}

View File

@@ -52,7 +52,7 @@ public interface CacheNames {
String SYS_USER_NAME = "sys_user_name#30d";
/**
* 用户
* 用户
*/
String SYS_NICKNAME = "sys_nickname#30d";

View File

@@ -9,8 +9,6 @@ import lombok.RequiredArgsConstructor;
import org.dromara.common.core.utils.ServletUtils;
import org.dromara.common.core.utils.StringUtils;
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.SaTokenAnnotationMetadataJavadocResolver;
import org.dromara.common.doc.handler.OpenApiHandler;

View File

@@ -31,8 +31,8 @@ public class ExportDemoVo {
/**
* 用户昵称
*/
@ExcelProperty(value = "用户", index = 0)
@NotEmpty(message = "用户不能为空", groups = AddGroup.class)
@ExcelProperty(value = "用户昵称", index = 0)
@NotEmpty(message = "用户昵称不能为空", groups = AddGroup.class)
private String nickName;
/**

View File

@@ -32,13 +32,13 @@ public class SysUserExportVo implements Serializable {
/**
* 用户账号
*/
@ExcelProperty(value = "登录名称")
@ExcelProperty(value = "用户账号")
private String userName;
/**
* 用户昵称
*/
@ExcelProperty(value = "用户")
@ExcelProperty(value = "用户")
private String nickName;
/**

View File

@@ -39,13 +39,13 @@ public class SysUserImportVo implements Serializable {
/**
* 用户账号
*/
@ExcelProperty(value = "登录名称")
@ExcelProperty(value = "用户账号")
private String userName;
/**
* 用户昵称
*/
@ExcelProperty(value = "用户")
@ExcelProperty(value = "用户")
private String nickName;
/**

View File

@@ -399,12 +399,12 @@ public class RemoteUserServiceImpl implements RemoteUserService {
}
/**
* 根据用户 ID 列表查询用户称映射关系
* 根据用户 ID 列表查询用户称映射关系
*
* @param userIds 用户 ID 列表
* @return Map其中 key 为用户 IDvalue 为对应的用户
* @return Map其中 key 为用户 IDvalue 为对应的用户
*/
public Map<Long, String> selectUserNamesByIds(List<Long> userIds) {
public Map<Long, String> selectUserNicksByIds(List<Long> userIds) {
if (CollUtil.isEmpty(userIds)) {
return Collections.emptyMap();
}

View File

@@ -98,7 +98,7 @@ public interface ISysUserService {
String selectUserPostGroup(Long userId);
/**
* 校验用户名称是否唯一
* 校验用户账号是否唯一
*
* @param user 用户信息
* @return 结果

View File

@@ -109,7 +109,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
/**
* 根据用户ID查询菜单
*
* @param userId 用户名称
* @param userId 用户ID
* @return 菜单列表
*/
@Override

View File

@@ -231,7 +231,7 @@ public class SysUserServiceImpl implements ISysUserService {
}
/**
* 校验用户名称是否唯一
* 校验用户账号是否唯一
*
* @param user 用户信息
* @return 结果

View File

@@ -23,8 +23,8 @@ public class FlowCopyBo implements Serializable {
private Long userId;
/**
* 用户
* 用户
*/
private String userName;
private String nickName;
}

View File

@@ -24,10 +24,10 @@ public class FlowCopyVo implements Serializable {
private Long userId;
/**
* 用户
* 用户
*/
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "userId")
private String userName;
private String nickName;
public FlowCopyVo(Long userId) {
this.userId = userId;

View File

@@ -87,7 +87,7 @@ public class WorkflowGlobalListener implements GlobalListener {
FlowCopyBo bo = new FlowCopyBo();
Long id = Convert.toLong(x);
bo.setUserId(id);
bo.setUserName(remoteUserService.selectUserNameById(id));
bo.setNickName(remoteUserService.selectNicknameById(id));
return bo;
});
variable.put(FlowConstant.FLOW_COPY_LIST, list);
@@ -162,7 +162,7 @@ public class WorkflowGlobalListener implements GlobalListener {
flowTask.setPermissionList(List.of(userIdArray));
// 移除已处理的状态变量
variable.remove(nodeKey);
FlowEngine.insService().removeVariables(flowTask.getInstanceId(),nodeKey);
FlowEngine.insService().removeVariables(flowTask.getInstanceId(), nodeKey);
}
}

View File

@@ -252,7 +252,7 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
List<Long> longIds = StreamUtils.toList(ids, Convert::toLong);
Map<Long, String> rawMap = switch (type) {
case USER -> remoteUserService.selectUserNamesByIds(longIds);
case USER -> remoteUserService.selectUserNicksByIds(longIds);
case ROLE -> remoteRoleService.selectRoleNamesByIds(longIds);
case DEPT -> remoteDeptService.selectDeptNamesByIds(longIds);
case POST -> remotePostService.selectPostNamesByIds(longIds);

View File

@@ -344,7 +344,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
FlowParams flowParams = FlowParams.build()
.skipType(SkipType.NONE.getKey())
.hisStatus(TaskStatusEnum.COPY.getStatus())
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getUserName));
.message("【抄送给】" + StreamUtils.join(flowCopyList, FlowCopyBo::getNickName));
HisTask hisTask = hisTaskService.setSkipHisTask(task, flowNode, flowParams);
hisTask.setCreateTime(updateTime);
hisTask.setUpdateTime(updateTime);