优化:将列表排序由按修改时间降序调整为按创建时间降序(避免修改后数据记录移动),将列表中的审计信息由“修改人”、“修改时间”调整展示为“创建人”、“创建时间”,后续涉及完整审计信息将在详情中统一展示

This commit is contained in:
Charles7c 2023-01-30 21:28:00 +08:00
parent 3075038067
commit 2c6bef91e8
6 changed files with 30 additions and 30 deletions

View File

@ -36,20 +36,20 @@ public class BaseDetailVO extends BaseVO {
private static final long serialVersionUID = 1L;
/**
* 创建
* 修改
*/
@JsonIgnore
private Long createUser;
private Long updateUser;
/**
* 创建
* 修改
*/
@Schema(description = "创建")
private String createUserString;
@Schema(description = "修改")
private String updateUserString;
/**
* 创建时间
* 修改时间
*/
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "修改时间")
private LocalDateTime updateTime;
}

View File

@ -37,20 +37,20 @@ public class BaseVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 修改
* 创建
*/
@JsonIgnore
private Long updateUser;
private Long createUser;
/**
* 修改
* 创建
*/
@Schema(description = "修改")
private String updateUserString;
@Schema(description = "创建")
private String createUserString;
/**
* 修改时间
* 创建时间
*/
@Schema(description = "修改时间")
private LocalDateTime updateTime;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@ -154,6 +154,6 @@ public class LogServiceImpl implements LogService {
return;
}
logVO.setCreateUserString(
ExceptionUtils.exToNull(() -> userService.getById(logVO.getCreateUser())).getNickname());
ExceptionUtils.exToNull(() -> userService.getById(createUser)).getNickname());
}
}

View File

@ -64,7 +64,7 @@ public class DeptServiceImpl extends
public List<DeptVO> list(DeptQuery query) {
QueryWrapper<DeptDO> queryWrapper = QueryHelper.build(query);
queryWrapper.lambda().orderByAsc(DeptDO::getParentId).orderByAsc(DeptDO::getDeptSort)
.orderByDesc(DeptDO::getUpdateTime);
.orderByDesc(DeptDO::getCreateTime);
List<DeptDO> deptList = baseMapper.selectList(queryWrapper);
List<DeptVO> list = BeanUtil.copyToList(deptList, DeptVO.class);
list.forEach(this::fill);
@ -174,11 +174,11 @@ public class DeptServiceImpl extends
* 部门信息
*/
private void fill(DeptVO deptVO) {
Long updateUser = deptVO.getUpdateUser();
if (updateUser == null) {
Long createUser = deptVO.getCreateUser();
if (createUser == null) {
return;
}
deptVO.setUpdateUserString(
ExceptionUtils.exToNull(() -> userService.getById(deptVO.getUpdateUser())).getNickname());
deptVO.setCreateUserString(
ExceptionUtils.exToNull(() -> userService.getById(createUser)).getNickname());
}
}

View File

@ -8,8 +8,8 @@ export interface DeptRecord {
deptSort: number;
description: string;
status?: number;
updateUserString: string;
updateTime: string;
createUserString: string;
createTime: string;
children: Array<DeptRecord>,
}

View File

@ -369,12 +369,12 @@
dataIndex: 'description',
},
{
title: '修改人',
dataIndex: 'updateUserString',
title: '创建人',
dataIndex: 'createUserString',
},
{
title: '修改时间',
dataIndex: 'updateTime',
title: '创建时间',
dataIndex: 'createTime',
},
{
title: '操作',
@ -502,8 +502,8 @@
deptSort: 999,
description: '',
status: undefined,
updateUserString: '',
updateTime: '',
createUserString: '',
createTime: '',
children: [],
});
const rules = computed((): Record<string, FieldRule[]> => {