Browse Source

活动统计增加人次

周箭河 4 years ago
parent
commit
87e86638a6

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/LuckStatisDto.java

@@ -1,13 +1,26 @@
 package com.ym.mec.biz.dal.dto;
 
+import io.swagger.annotations.ApiModelProperty;
+
 import java.math.BigDecimal;
 import java.util.List;
 
 public class LuckStatisDto {
     private List<OrderStatisDto> orderStatisDtoList;
+
+    @ApiModelProperty(value = "总预计人数",required = true)
     private Integer totalEstimatedNums = 0;
+
+    @ApiModelProperty(value = "总人数",required = true)
     private Integer totalNum = 0;
+
+    @ApiModelProperty(value = "总人次",required = true)
+    private Integer totalTimes = 0;
+
+    @ApiModelProperty(value = "总金额",required = true)
     private BigDecimal totalMoney = BigDecimal.ZERO;
+
+    @ApiModelProperty(value = "总转化率",required = true)
     private BigDecimal scale = BigDecimal.ZERO;
 
     public List<OrderStatisDto> getOrderStatisDtoList() {
@@ -49,4 +62,12 @@ public class LuckStatisDto {
     public void setScale(BigDecimal scale) {
         this.scale = scale;
     }
+
+    public Integer getTotalTimes() {
+        return totalTimes;
+    }
+
+    public void setTotalTimes(Integer totalTimes) {
+        this.totalTimes = totalTimes;
+    }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OrderStatisDto.java

@@ -7,6 +7,7 @@ public class OrderStatisDto {
     private String organName;
     private Integer estimatedNums = 0;
     private Integer nums = 0;
+    private Integer times;
     private BigDecimal scale = BigDecimal.ZERO;
     private BigDecimal money = BigDecimal.ZERO;
 
@@ -57,4 +58,12 @@ public class OrderStatisDto {
     public void setScale(BigDecimal scale) {
         this.scale = scale;
     }
+
+    public Integer getTimes() {
+        return times;
+    }
+
+    public void setTimes(Integer times) {
+        this.times = times;
+    }
 }

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -565,6 +565,7 @@
         <result property="organName" column="organName"/>
         <result property="estimatedNums" column="estimatedNums"/>
         <result property="nums" column="nums"/>
+        <result property="times" column="times"/>
         <result property="scale" column="scale"/>
         <result property="money" column="money"/>
     </resultMap>
@@ -729,8 +730,8 @@
     </select>
 
     <select id="doubleEleven2020Statis" resultMap="luckStatis">
-        SELECT o.id_ organId, o.name_ organName, SUM(spo.actual_amount_) money, COUNT(DISTINCT spo.user_id_) nums
-        FROM student_payment_order spo
+        SELECT o.id_ organId, o.name_ organName, SUM(spo.actual_amount_) money, COUNT(DISTINCT spo.user_id_) nums,
+        COUNT(spo.id_) times FROM student_payment_order spo
         LEFT JOIN organization o ON o.id_ = spo.organ_id_
         WHERE spo.type_ = 'DOUBLE_ELEVEN2020'
         AND spo.status_ = 'SUCCESS'

+ 3 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

@@ -55,6 +55,7 @@ public class ActivityController extends BaseController {
         BigDecimal totalMoney = BigDecimal.ZERO;
         Integer totalEstimatedNums = 0;
         Integer totalNum = 0;
+        Integer totalTimes = 0;
         for (OrderStatisDto order : orders) {
             for (OrderStatisDto organNormalStudent : organNormalStudents) {
                 if (order.getOrganId().equals(organNormalStudent.getOrganId())) {
@@ -64,6 +65,7 @@ public class ActivityController extends BaseController {
             }
             totalEstimatedNums += order.getEstimatedNums();
             totalNum += order.getNums();
+            totalTimes += order.getTimes();
             totalMoney = totalMoney.add(order.getMoney());
             if (order.getEstimatedNums() <= 0) {
                 order.setScale(new BigDecimal(order.getNums()).multiply(new BigDecimal(100)).divide(new BigDecimal(1), 2, BigDecimal.ROUND_HALF_UP));
@@ -77,6 +79,7 @@ public class ActivityController extends BaseController {
         luckStatisDto.setOrderStatisDtoList(orders);
         luckStatisDto.setTotalEstimatedNums(totalEstimatedNums);
         luckStatisDto.setTotalNum(totalNum);
+        luckStatisDto.setTotalTimes(totalTimes);
         luckStatisDto.setTotalMoney(totalMoney);
         if (luckStatisDto.getTotalEstimatedNums() <= 0) {
             totalEstimatedNums = 1;