|
@@ -2,8 +2,9 @@ package com.ozs.service.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.pagehelper.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.ozs.common.utils.AppendUtils;
|
|
|
import com.ozs.common.utils.PageUtils;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
@@ -84,13 +85,22 @@ public class MsgWebPushServiceImpl extends ServiceImpl<MsgWebPushMapper, MsgWebP
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage messageMore(String userId, MsgAlarmVo msgAlarmVo) {
|
|
|
+ public IPage<MsgAlarm> messageMore(String userId, MsgAlarmVo msgAlarmVo) {
|
|
|
List<String> userIds = baseCameraManagementService.getUserIds(userId);
|
|
|
msgAlarmVo.setUserIds(userIds);
|
|
|
- List<MsgAlarm> webAlarm = msgWebPushMapper.messageMore(msgAlarmVo);
|
|
|
- Page<MsgAlarm> page = PageUtils.getPages(msgAlarmVo.getPageNum().intValue(), msgAlarmVo.getPageSize().intValue(), webAlarm);
|
|
|
- if (!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())) {
|
|
|
- List<MsgAlarm> dto1 = page.getRecords().stream().map(o -> {
|
|
|
+ // List<MsgAlarm> webAlarm = msgWebPushMapper.messageMore(msgAlarmVo);
|
|
|
+ Page<MsgAlarm> page = PageHelper.startPage(msgAlarmVo.getPageNum().intValue(), msgAlarmVo.getPageSize().intValue())
|
|
|
+ .doSelectPage(() -> msgWebPushMapper.messageMore(msgAlarmVo));
|
|
|
+ com.baomidou.mybatisplus.extension.plugins.pagination.Page<MsgAlarm> pageR =
|
|
|
+ new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(msgAlarmVo.getPageNum().intValue(), msgAlarmVo.getPageSize().intValue());
|
|
|
+
|
|
|
+ pageR.setSize(page.size());
|
|
|
+ pageR.setTotal(page.getTotal());
|
|
|
+
|
|
|
+
|
|
|
+ // Page<MsgAlarm> page = PageUtils.getPages(msgAlarmVo.getPageNum().intValue(), msgAlarmVo.getPageSize().intValue(), webAlarm);
|
|
|
+ if (!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getResult())) {
|
|
|
+ List<MsgAlarm> dto1 = page.getResult().stream().map(o -> {
|
|
|
String[] split = o.getImageUrl().split(";");
|
|
|
ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
|
|
|
o.setImageUrls(objects);
|
|
@@ -115,9 +125,9 @@ public class MsgWebPushServiceImpl extends ServiceImpl<MsgWebPushMapper, MsgWebP
|
|
|
// o.setAlarmCount((int) msgAlarmFrequencyService.count()+1);
|
|
|
return o;
|
|
|
}).collect(Collectors.toList());
|
|
|
- page.setRecords(dto1);
|
|
|
+ pageR.setRecords(dto1);
|
|
|
}
|
|
|
- return page;
|
|
|
+ return pageR;
|
|
|
}
|
|
|
|
|
|
@Override
|