diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/logMsg/LogMsgServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/logMsg/LogMsgServiceImpl.java index b6cbd637..3e156ed3 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/logMsg/LogMsgServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/logMsg/LogMsgServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.system.oshi.CpuInfo; import cn.iocoder.yudao.framework.common.page.PageDTO; import cn.iocoder.yudao.framework.common.page.PageUtil; import cn.iocoder.yudao.framework.common.page.PageVO; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.farm.controller.admin.logMsg.dto.LogMsgDTO; import cn.iocoder.yudao.module.system.dal.dataobject.CpUser.CpUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; @@ -105,7 +106,9 @@ public class LogMsgServiceImpl implements LogMsgService { public R> logMsgList(PageDTO pageDTO){ PageUtil.startPage(pageDTO); - List list = logMsgMapper.selectList(); + LambdaQueryWrapperX queryWrapperX = new LambdaQueryWrapperX<>(); + queryWrapperX.orderByDesc(LogMsgDO::getId); + List list = logMsgMapper.selectList(queryWrapperX); List dtoList = BeanUtil.copyToList(list, LogMsgDTO.class); @@ -122,7 +125,6 @@ public class LogMsgServiceImpl implements LogMsgService { }); }); - dtoList.forEach(msg ->{ if (map.containsKey(msg.getUserId())){ CpUserDO user = map.get(msg.getUserId()); diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java index d16d8d77..743a5d48 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java @@ -155,7 +155,6 @@ public class ProjectServiceImpl implements ProjectService { } queryWrapperX.eqIfPresent(ProjectDO::getDraft, pageDTO.getDraft()); - if (pageDTO.getDraft()){ //查看自己的草稿 queryWrapperX.eqIfPresent(ProjectDO::getCreator, getLoginUserId()); @@ -166,9 +165,10 @@ public class ProjectServiceImpl implements ProjectService { CpUserDO user = cpUserMapper.selectOne(Wrappers.lambdaQuery().eq(CpUserDO::getUserId, adminUser.getUsername())); if (ObjectUtil.isNotEmpty(user)){ //查看我参与或创建的项目 - queryWrapperX.last(" and (JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +")") ; + queryWrapperX.last(" and (JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +") ORDER BY id") ; } - + }else{ + queryWrapperX.orderByDesc(ProjectDO::getId); } List list = projectMapper.selectList(queryWrapperX); @@ -220,7 +220,6 @@ public class ProjectServiceImpl implements ProjectService { } } } - PageVO returnList = PageUtil.convertPageInfo(projectListDTOList); return R.success(returnList); }