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

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

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());
}
}