From d1a0d75733799d0a6e14aa1b6b56d2f93d6b7806 Mon Sep 17 00:00:00 2001 From: 2210088963 <2210088963@qq.com> Date: Fri, 7 Feb 2025 18:18:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA=E7=8E=B0?= =?UTF-8?q?=E5=9C=BA=E7=9A=84save=E6=96=B9=E6=B3=95=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E6=A0=8F=E7=9B=AE=E5=AD=98=E5=9C=A8=E5=8F=AA?= =?UTF-8?q?=E5=8F=96=E7=AC=AC=E4=B8=80=E4=B8=AA=202.livesceneEntity?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BCViewerCount?= =?UTF-8?q?=E3=80=81LikeDisplay=E4=B8=BAfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/modules/live/entity/LiveSceneEntity.java | 4 ++-- .../live/service/impl/LiveSceneServiceImpl.java | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java b/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java index 36af643..9492033 100644 --- a/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java +++ b/src/main/java/com/platform/modules/live/entity/LiveSceneEntity.java @@ -335,10 +335,10 @@ public class LiveSceneEntity implements Serializable { this.setCarouselImage(false); // 默认 false } if (this.getViewerCount() == null) { - this.setViewerCount(true); // 默认 true + this.setViewerCount(false); // 默认 false } if (this.getLikeDisplay() == null) { - this.setLikeDisplay(true); // 默认 true + this.setLikeDisplay(false); // 默认 false } if (this.getVrLive() == null) { this.setVrLive(false); // 默认 false diff --git a/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java b/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java index 3441ffe..8c3c3cc 100644 --- a/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java +++ b/src/main/java/com/platform/modules/live/service/impl/LiveSceneServiceImpl.java @@ -305,7 +305,10 @@ public class LiveSceneServiceImpl extends ServiceImpl !list.isEmpty()) + .map(list -> list.get(0)) + .orElse(null)); this.baseMapper.insert(entity); LiveSceneCountEntity liveSceneCountEntity = new LiveSceneCountEntity(); @@ -2838,7 +2841,7 @@ public class LiveSceneServiceImpl extends ServiceImpl wrapper = new EntityWrapper<>(); // 添加查询条件:scene_state = 2 - wrapper.eq("scene_state", SceneConstants.SCENE_PROD.intValue()); + wrapper.eq("scene_state", SceneConstants.SCENE_PROD); // 调用 selectCount 方法统计符合条件的行数 Long count = (long) selectCount(wrapper); @@ -2854,7 +2857,9 @@ public class LiveSceneServiceImpl extends ServiceImpl countEntities = liveSceneCountService.selectList(null); + EntityWrapper countWrapper = new EntityWrapper<>(); + countWrapper.eq("scene_state", SceneConstants.SCENE_PROD); + List countEntities = liveSceneCountService.selectList(countWrapper); long sumViews = countEntities.stream().mapToLong(LiveSceneCountEntity::getViewsShow).sum(); result.add(sumViews); return result;