From 4f731e99044f9c6f55b78316f263d35d7ac2deb7 Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 16 Oct 2023 13:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=EF=BC=9A=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=9C=B0=E5=8C=BA=E7=BB=9F=E8=AE=A1=EF=BC=8C?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=9C=AA=E7=9F=A5=E7=9C=81=E4=BB=BD=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/member/MemberStatisticsServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 d9789fcb4..015cba1f4 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 @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.statistics.service.member; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.util.NumberUtil; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; +import cn.iocoder.yudao.framework.ip.core.Area; import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum; import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; import cn.iocoder.yudao.module.statistics.controller.admin.common.vo.DataComparisonRespVO; @@ -60,7 +61,6 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService { @Override public List getMemberAreaStatisticsList() { // 统计用户 - // TODO @疯狂:要处理下,未知省份;就是没填写省份的情况; // TODO @疯狂:可能得把每个省的用户,都查询出来,然后去 order 那边 in;因为要按照这些人为基础来计算;;用户规模量大可能不太好,但是暂时就先这样搞吧 = = Map userCountMap = convertMap(memberStatisticsMapper.selectSummaryListByAreaId(), vo -> AreaUtils.getParentIdByType(vo.getAreaId(), AreaTypeEnum.PROVINCE), @@ -74,7 +74,9 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService { .setOrderPayUserCount(a.getOrderPayUserCount() + b.getOrderPayUserCount()) .setOrderPayPrice(a.getOrderPayPrice() + b.getOrderPayPrice())); // 拼接数据 - return MemberStatisticsConvert.INSTANCE.convertList(AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area), userCountMap, orderMap); + List areaList = AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area); + areaList.add(new Area().setId(null).setName("未知")); + return MemberStatisticsConvert.INSTANCE.convertList(areaList, userCountMap, orderMap); } // TODO @疯狂:这个方法,要不拆成:1)controller 调用 getMemberAnalyseComparisonData;2)tradeOrderStatisticsService.getPayUserCount;3)tradeOrderStatisticsService.getOrderPayPrice;4)。。。