refactor: 移除多个DTO中从缓存获取用户名的逻辑

为了提高代码的可维护性和减少对缓存的依赖,移除了多个DTO中从缓存获取用户名的逻辑。这些逻辑已被注释掉,未来可根据需求重新实现或优化。
This commit is contained in:
dzq 2025-05-19 15:22:21 +08:00
parent 003b5b972c
commit dc260dec0e
10 changed files with 19 additions and 18 deletions

View File

@ -18,10 +18,10 @@ public class QyAccessTokenDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
}
}

View File

@ -18,10 +18,10 @@ public class QyAuthDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
this.timeStampStr = entity.getTimeStamp();
}

View File

@ -18,10 +18,10 @@ public class QyAuthCorpInfoDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
}
}

View File

@ -16,10 +16,10 @@ public class QyDepartmentDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
}

View File

@ -18,10 +18,10 @@ public class QyMessageDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
this.sendTimeStr = DateUtil.format(entity.getSendTime(), "yyyy-MM-dd HH:mm:ss");
this.recallStateStr = convertRecallState(entity.getRecallState());

View File

@ -18,10 +18,10 @@ public class QyTemplateDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
this.gettokenTimeStr = DateUtil.format(entity.getGettokenTime(), "yyyy-MM-dd HH:mm:ss");

View File

@ -21,7 +21,7 @@ public class QyUserServiceImpl extends ServiceImpl<QyUserMapper, QyUserEntity> i
@Override
public Page<QyUserEntity> getUserList(AbstractPageQuery<QyUserEntity> query) {
return this.page(query.toPage(), query.toQueryWrapper());
return baseMapper.getUserList(query.toPage(), query.toQueryWrapper());
}
@Override

View File

@ -24,10 +24,10 @@ public class QyUserDTO {
if (entity != null) {
BeanUtil.copyProperties(entity, this);
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
if (creator != null) {
this.operator = creator.getUsername();
}
}*/
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
this.createTimeStr = DateUtil.format(entity.getCreateTime(), "yyyy-MM-dd HH:mm:ss");

View File

@ -33,7 +33,8 @@ public class SearchQyUserQuery<T> extends AbstractPageQuery<T> {
.eq(StrUtil.isNotBlank(department), "department", department)
.eq(StrUtil.isNotBlank(mainDepartment), "main_department", mainDepartment)
.eq(StrUtil.isNotBlank(enable), "enable", enable)
.between(startTime != null && endTime != null, "create_time", startTime, endTime);
.between(startTime != null && endTime != null, "create_time", startTime, endTime)
.orderByDesc("id");
this.timeRangeColumn = "create_time";

View File

@ -21,10 +21,10 @@ public class NoticeDTO {
this.status = entity.getStatus();
this.createTime = entity.getCreateTime();
SysUserEntity cacheUser = CacheCenter.userCache.getObjectById(entity.getCreatorId());
/*SysUserEntity cacheUser = CacheCenter.userCache.getObjectById(entity.getCreatorId());
if (cacheUser != null) {
this.creatorName = cacheUser.getUsername();
}
}*/
}
}