From b6062f4fb9248af6dbe845b81cd9a319b07e662b Mon Sep 17 00:00:00 2001 From: Chopper Date: Fri, 25 Jun 2021 11:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=9F=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=BA=97=E9=93=BA=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=EF=BC=8C=E7=BB=9F=E8=AE=A1=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E5=8F=98=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/model/vo/OrderOverviewVO.java | 18 +++--- .../OrderStatisticsDataServiceImpl.java | 57 +++++++++++++------ 2 files changed, 48 insertions(+), 27 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/statistics/model/vo/OrderOverviewVO.java b/framework/src/main/java/cn/lili/modules/statistics/model/vo/OrderOverviewVO.java index 5cd79262..fbb3bd5d 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/model/vo/OrderOverviewVO.java +++ b/framework/src/main/java/cn/lili/modules/statistics/model/vo/OrderOverviewVO.java @@ -13,35 +13,35 @@ import lombok.Data; public class OrderOverviewVO { @ApiModelProperty(value = "UV人次") - private Integer uvNum; + private Integer uvNum = 0; //下单统计 @ApiModelProperty(value = "下单数量") - private Long orderNum; + private Long orderNum = 0L; @ApiModelProperty(value = "下单人数") - private Long orderMemberNum; + private Long orderMemberNum = 0L; @ApiModelProperty(value = "下单金额") - private Double orderAmount; + private Double orderAmount = 0D; //付款统计 @ApiModelProperty(value = "付款订单数量") - private Long paymentOrderNum; + private Long paymentOrderNum = 0L; @ApiModelProperty(value = "付款人数") - private Long paymentsNum; + private Long paymentsNum = 0L; @ApiModelProperty(value = "付款金额") - private Double paymentAmount; + private Double paymentAmount = 0D; //退单统计 @ApiModelProperty(value = "退单笔数") - private Long refundOrderNum; + private Long refundOrderNum = 0L; @ApiModelProperty(value = "退单金额") - private Double refundOrderPrice; + private Double refundOrderPrice = 0D; //转换率 @ApiModelProperty(value = "下单转换率") diff --git a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/OrderStatisticsDataServiceImpl.java b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/OrderStatisticsDataServiceImpl.java index 200dd483..e581d414 100644 --- a/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/OrderStatisticsDataServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/statistics/serviceimpl/OrderStatisticsDataServiceImpl.java @@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -50,18 +49,15 @@ public class OrderStatisticsDataServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper(); //queryWrapper.eq("flow_type", FlowTypeEnum.PAY.name()); - queryWrapper.eq(StringUtils.isNotEmpty(orderStatus),Order::getOrderStatus,orderStatus); + queryWrapper.eq(StringUtils.isNotEmpty(orderStatus), Order::getOrderStatus, orderStatus); queryWrapper.eq(StringUtils.equals(UserContext.getCurrentUser().getRole().name(), UserEnums.STORE.name()), Order::getStoreId, UserContext.getCurrentUser().getStoreId()); return orderService.count(queryWrapper);