From 1c2e4af4539570d07beaa42c8f8415e3c30d6eb8 Mon Sep 17 00:00:00 2001 From: nili Date: Sun, 30 Jun 2024 15:20:01 +0800 Subject: [PATCH] =?UTF-8?q?fx=E4=BB=A3=E7=90=86&=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=B8=BB=E6=94=B6=E7=9B=8A=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/game/service/matrix/AdminDeviceService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game-service/src/main/java/awesome/group/game/service/matrix/AdminDeviceService.java b/game-service/src/main/java/awesome/group/game/service/matrix/AdminDeviceService.java index 82579ab..b11ef1a 100644 --- a/game-service/src/main/java/awesome/group/game/service/matrix/AdminDeviceService.java +++ b/game-service/src/main/java/awesome/group/game/service/matrix/AdminDeviceService.java @@ -163,14 +163,14 @@ public class AdminDeviceService { } MatrixAdmin admin = adminMapper.selectById(adminId); LambdaQueryWrapper advQuery = new QueryWrapper() - .select("sum(ecpm) as ecpm").lambda(); + .select("sum(ecpm_admin) as ecpm_admin").lambda(); advQuery.in(MatrixAdvRecord::getAppId, appIds); advQuery.gt(MatrixAdvRecord::getCreatedAt, new Timestamp(DateUtil.getDayBeginTimestamp(System.currentTimeMillis()))); advQuery.eq(MatrixAdvRecord::getAdminId, adminId); advQuery.eq(MatrixAdvRecord::getAdvType, 3);//只展示激励视频 MatrixAdvRecord record = advRecordMapper.selectOne(advQuery); OverviewBo bo = new OverviewBo(); - bo.todayIncome = record == null ? 0 : (record.getEcpm() * admin.getIncomeRate()) / 100; + bo.todayIncome = record == null ? 0 : record.getEcpmAdmin(); int today = DateUtil.currentDate(); int yesterday = DateUtil.datePlus(today, -1); @@ -256,7 +256,7 @@ public class AdminDeviceService { long dateEnd = dateBegin + 86400_000 - 1; LambdaQueryWrapper query = new QueryWrapper() - .select("admin_id, app_id, platform, sum(ecpm) as ecpm") + .select("admin_id, app_id, platform, sum(ecpm) as ecpm, sum(ecpm_admin) as ecpm_admin") .lambda(); query.between(MatrixAdvRecord::getCreatedAt, new Timestamp(dateBegin), new Timestamp(dateEnd)); query.eq(MatrixAdvRecord::getAdvType, 3);//设备主只算激励视频 @@ -265,7 +265,7 @@ public class AdminDeviceService { List records = advRecordMapper.selectList(query); List aggregations = new ArrayList<>(); List adminList = adminMapper.selectList(null); - Map adminMap = adminList.stream().collect(Collectors.toMap(x -> x.getId(), x -> x)); + Map adminMap = adminList.stream().collect(Collectors.toMap(MatrixAdmin::getId, x -> x)); for (MatrixAdvRecord r : records) { MatrixAdvAggregationSub aggregation = new MatrixAdvAggregationSub(); aggregation.setAdminId(r.getAdminId()); @@ -275,7 +275,7 @@ public class AdminDeviceService { aggregation.setIncome(r.getEcpm()); aggregations.add(aggregation); aggregation.setIncomeRate(adminMap.get(r.getAdminId()).getIncomeRate()); - aggregation.setIncomeReal(aggregation.getIncomeRate() * r.getEcpm() / 100); + aggregation.setIncomeReal(r.getEcpmReal()); } if (CollectionUtils.isEmpty(aggregations)) { return;