forked from github/dataease
fix: 消息列表分页错误
This commit is contained in:
parent
1e4b40dd23
commit
82361e0f90
@ -42,8 +42,9 @@ public class MsgController {
|
|||||||
List<SysMsgType> sysMsgTypes = sysMsgService.queryMsgTypes();
|
List<SysMsgType> sysMsgTypes = sysMsgService.queryMsgTypes();
|
||||||
typeIds = sysMsgTypes.stream().filter(sysMsgType -> msgRequest.getType() == sysMsgType.getPid()).map(SysMsgType::getMsgTypeId).collect(Collectors.toList());
|
typeIds = sysMsgTypes.stream().filter(sysMsgType -> msgRequest.getType() == sysMsgType.getPid()).map(SysMsgType::getMsgTypeId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
Long overTime = sysMsgService.overTime();
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
Pager<List<MsgGridDto>> listPager = PageUtils.setPageInfo(page, sysMsgService.queryGrid(userId, msgRequest, typeIds));
|
Pager<List<MsgGridDto>> listPager = PageUtils.setPageInfo(page, sysMsgService.queryGrid(userId, msgRequest, typeIds, overTime));
|
||||||
return listPager;
|
return listPager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class SysMsgService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SystemParameterService systemParameterService;
|
private SystemParameterService systemParameterService;
|
||||||
|
|
||||||
public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
|
/* public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
|
||||||
String orderClause = " create_time desc";
|
String orderClause = " create_time desc";
|
||||||
SysMsgExample example = new SysMsgExample();
|
SysMsgExample example = new SysMsgExample();
|
||||||
SysMsgExample.Criteria criteria = example.createCriteria();
|
SysMsgExample.Criteria criteria = example.createCriteria();
|
||||||
@ -81,8 +81,8 @@ public class SysMsgService {
|
|||||||
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
|
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
|
||||||
return sysMsgs;
|
return sysMsgs;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds) {
|
public List<MsgGridDto> queryGrid(Long userId, MsgRequest msgRequest, List<Long> typeIds, Long startTime) {
|
||||||
String orderClause = " create_time desc";
|
String orderClause = " create_time desc";
|
||||||
SysMsgExample example = new SysMsgExample();
|
SysMsgExample example = new SysMsgExample();
|
||||||
SysMsgExample.Criteria criteria = example.createCriteria();
|
SysMsgExample.Criteria criteria = example.createCriteria();
|
||||||
@ -110,7 +110,8 @@ public class SysMsgService {
|
|||||||
criteria.andStatusEqualTo(msgRequest.getStatus());
|
criteria.andStatusEqualTo(msgRequest.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
criteria.andCreateTimeGreaterThanOrEqualTo(overTime());
|
criteria.andCreateTimeGreaterThanOrEqualTo(startTime);
|
||||||
|
/* criteria.andCreateTimeGreaterThanOrEqualTo(overTime()); */
|
||||||
|
|
||||||
example.setOrderByClause(orderClause);
|
example.setOrderByClause(orderClause);
|
||||||
List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example);
|
List<MsgGridDto> msgGridDtos = extSysMsgMapper.queryGrid(example);
|
||||||
@ -349,11 +350,6 @@ public class SysMsgService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public static void main(String[] args) {
|
|
||||||
|
|
||||||
Long overTime = overTime();
|
|
||||||
System.out.println(overTime);
|
|
||||||
|
|
||||||
} */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user