From b6fa459bc3ae287abcb3292a873718fd08297e61 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Fri, 10 Dec 2021 18:38:58 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E6=B5=81=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=87=8F=E6=97=B6=E6=89=B9?=
=?UTF-8?q?=E9=87=8F=E5=88=A0=E9=99=A4=E7=9A=84=E9=94=99=E8=AF=AF=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E6=B5=81=E5=88=97=E8=A1=A8=E5=88=86?=
=?UTF-8?q?=E9=A1=B5=E6=9F=A5=E8=AF=A2=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 3 +--
.../vmp/service/impl/StreamPushServiceImpl.java | 17 +++++++++++++++--
.../streamPush/StreamPushController.java | 2 +-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3336bb37..364e6b9e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,6 @@
3.1.0
- 5.2.0
${project.build.directory}/generated-snippets
${project.basedir}/docs/asciidoc
${project.build.directory}/asciidoc
@@ -113,7 +112,7 @@
com.github.pagehelper
pagehelper-spring-boot-starter
- 1.2.10
+ 1.4.1
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
index 63596b24..be34fae5 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
@@ -188,10 +188,23 @@ public class StreamPushServiceImpl implements IStreamPushService {
streamInfoPushItemMap.remove(streamPushItem.getApp() + streamPushItem.getStream());
}
}
- Collection offlinePushItems = pushItemMap.values();
+ List offlinePushItems = new ArrayList<>(pushItemMap.values());
if (offlinePushItems.size() > 0) {
String type = "PUSH";
- streamPushMapper.delAll(new ArrayList<>(offlinePushItems));
+ int runLimit = 300;
+ if (offlinePushItems.size() > runLimit) {
+ for (int i = 0; i < offlinePushItems.size(); i += runLimit) {
+ int toIndex = i + runLimit;
+ if (i + runLimit > offlinePushItems.size()) {
+ toIndex = offlinePushItems.size();
+ }
+ List streamPushItemsSub = offlinePushItems.subList(i, toIndex);
+ streamPushMapper.delAll(streamPushItemsSub);
+ }
+ }else {
+ streamPushMapper.delAll(offlinePushItems);
+ }
+
}
Collection offlineStreamInfoItems = streamInfoPushItemMap.values();
if (offlineStreamInfoItems.size() > 0) {
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
index 5fcb6bd5..6dfc2575 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
@@ -40,7 +40,7 @@ public class StreamPushController {
@RequestParam(required = false)String query,
@RequestParam(required = false)Boolean online ){
- PageInfo pushList = streamPushService.getPushList(page - 1, page - 1 + count);
+ PageInfo pushList = streamPushService.getPushList(page, count);
return pushList;
}