Browse Source

日志信息和项目 倒序

zyh
小久哥 3 years ago
parent
commit
97901204b7
  1. 6
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/logMsg/LogMsgServiceImpl.java
  2. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java

6
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<PageVO<LogMsgDTO>> logMsgList(PageDTO pageDTO){
PageUtil.startPage(pageDTO);
List<LogMsgDO> list = logMsgMapper.selectList();
LambdaQueryWrapperX<LogMsgDO> queryWrapperX = new LambdaQueryWrapperX<>();
queryWrapperX.orderByDesc(LogMsgDO::getId);
List<LogMsgDO> list = logMsgMapper.selectList(queryWrapperX);
List<LogMsgDTO> 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());

7
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.<CpUserDO>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<ProjectDO> list = projectMapper.selectList(queryWrapperX);
@ -220,7 +220,6 @@ public class ProjectServiceImpl implements ProjectService {
}
}
}
PageVO<ProjectListDTO> returnList = PageUtil.convertPageInfo(projectListDTOList);
return R.success(returnList);
}

Loading…
Cancel
Save