From 69695b118996b48e09d4ca14d5258a4575cf6b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 21 Aug 2024 06:39:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=A4=84=E7=90=86=E7=BB=9F=E8=AE=A1=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/MemberStatisticsServiceImpl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java index 6e3200b77..2257c8d39 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java @@ -69,9 +69,18 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService { bo -> AreaUtils.getParentIdByType(bo.getAreaId(), AreaTypeEnum.PROVINCE), bo -> bo, (a, b) -> new MemberAreaStatisticsRespBO() - .setOrderCreateUserCount(a.getOrderCreateUserCount() + b.getOrderCreateUserCount()) - .setOrderPayUserCount(a.getOrderPayUserCount() + b.getOrderPayUserCount()) - .setOrderPayPrice(a.getOrderPayPrice() + b.getOrderPayPrice())); + .setOrderCreateUserCount( + (a.getOrderCreateUserCount() != null ? a.getOrderCreateUserCount() : 0) + + (b.getOrderCreateUserCount() != null ? b.getOrderCreateUserCount() : 0) + ) + .setOrderPayUserCount( + (a.getOrderPayUserCount() != null ? a.getOrderPayUserCount() : 0) + + (b.getOrderPayUserCount() != null ? b.getOrderPayUserCount() : 0) + ) + .setOrderPayPrice( + (a.getOrderPayPrice() != null ? a.getOrderPayPrice() : 0.0) + + (b.getOrderPayPrice() != null ? b.getOrderPayPrice() : 0.0) + ) // 拼接数据 List areaList = AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area); areaList.add(new Area().setId(null).setName("未知"));