添加操作日志深分页处理,更新操作日志忽略路径
This commit is contained in:
@@ -26,7 +26,10 @@ import xtools.core.StringUtils;
|
||||
import xtools.extend.dto.IpAddrDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>Title : SysOptLogServiceImpl</p>
|
||||
@@ -59,6 +62,12 @@ public class SysOptLogServiceImpl implements SysOptLogService {
|
||||
public Result<PageResp<SysOptLogResp>> page(PageReq<SysOptLogPageReq> pageReq) {
|
||||
// 分页查询
|
||||
Page<SysOptLog> page = getPageData(pageReq.getCurrentPage(), pageReq.getPageSize(), pageReq.getQuery());
|
||||
// 根据返回的ID查询完整数据
|
||||
if (!page.getRecords().isEmpty()) {
|
||||
List<Long> ids = page.getRecords().stream().map(SysOptLog::getId).toList();
|
||||
Map<Long, SysOptLog> recordMap = sysOptLogBaseService.listByIds(ids).stream().collect(Collectors.toMap(SysOptLog::getId, Function.identity()));
|
||||
page.setRecords(ids.stream().map(recordMap::get).filter(Objects::nonNull).toList());
|
||||
}
|
||||
// 分装结果
|
||||
PageResp<SysOptLogResp> pageResp = new PageResp<>(pageReq, page.getTotal(), sysOptLogConvert.entityToRespList(page.getRecords()));
|
||||
return Result.ok(pageResp);
|
||||
@@ -142,16 +151,16 @@ public class SysOptLogServiceImpl implements SysOptLogService {
|
||||
// 查询字段
|
||||
query.select(
|
||||
SysOptLog::getId
|
||||
, SysOptLog::getTraceId
|
||||
, SysOptLog::getTitle
|
||||
, SysOptLog::getAccountId
|
||||
, SysOptLog::getAccount
|
||||
, SysOptLog::getIp
|
||||
, SysOptLog::getAddr
|
||||
, SysOptLog::getAddrCode
|
||||
, SysOptLog::getUri
|
||||
, SysOptLog::getMemo
|
||||
, SysOptLog::getGmtCreate
|
||||
// , SysOptLog::getTraceId
|
||||
// , SysOptLog::getTitle
|
||||
// , SysOptLog::getAccountId
|
||||
// , SysOptLog::getAccount
|
||||
// , SysOptLog::getIp
|
||||
// , SysOptLog::getAddr
|
||||
// , SysOptLog::getAddrCode
|
||||
// , SysOptLog::getUri
|
||||
// , SysOptLog::getMemo
|
||||
// , SysOptLog::getGmtCreate
|
||||
);
|
||||
// 设置查询条件
|
||||
setQueryWrapper(query, req);
|
||||
|
||||
Reference in New Issue
Block a user