Browse Source

首页数据分析 将销售额 从 有效改为 全部; 进行中的项目 添加全部销售字段

zhaoxian 1 year ago
parent
commit
990c3d0836

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -765,6 +765,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
                     JSONObject obj = new JSONObject();
                     obj.put("date", date);
                     obj.put("orderAmount", 0);
+                    obj.put("validOrderAmount", 0);
                     obj.put("regimentalPromotionAmount", 0);
                     obj.put("promoterCount", 0);
                     obj.put("orderCount", 0);
@@ -839,6 +840,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
                         JSONObject obj = new JSONObject();
                         obj.put("date", date);
                         obj.put("orderAmount", 0);
+                        obj.put("validOrderAmount", 0);
                         obj.put("regimentalPromotionAmount", 0);
                         obj.put("orderCount", 0);
                         obj.put("validOrderCount", 0);

+ 8 - 11
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -1267,7 +1267,7 @@
         COUNT(DISTINCT promoter_id) as 'promoterCount',
         COUNT(oid) as 'allNumber',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
-        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END), 0) AS 'orderAmount',
+        IFNULL(SUM(order_amount), 0) AS 'orderAmount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN regimental_promotion_amount ELSE 0 END),0) AS
         'regimentalPromotionAmount',
         IFNULL(sum(base_amount), 0) as 'baseAmount'
@@ -1311,7 +1311,7 @@
         COUNT(DISTINCT promoter_id) as 'promoterCount',
         COUNT(oid) as 'allNumber',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
-        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END), 0) AS 'orderAmount',
+        IFNULL(SUM(order_amount), 0) AS 'orderAmount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN regimental_promotion_amount ELSE 0 END),0) AS
         'regimentalPromotionAmount',
         IFNULL(sum(base_amount), 0) as 'baseAmount',
@@ -1352,12 +1352,7 @@
     <select id="selectOrderRate" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         count(oid) as 'allNumber',
-        IFNULL(sum(
-        CASE
-        WHEN order_status != 80 THEN order_amount
-        ELSE 0
-        END
-        ),0) AS 'orderAmount'
+        IFNULL(sum(order_amount),0) AS 'orderAmount'
         FROM kuaishou_supply_chain
         WHERE order_create_time >= #{statDate}
         AND order_create_time &lt;= #{endDate}
@@ -1411,7 +1406,8 @@
         FROM_UNIXTIME(order_create_time / 1000, '%Y-%m-%d') as 'date',
         count(1) AS 'orderCount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderCount',
-        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END),0) AS 'orderAmount',
+        IFNULL(SUM(order_amount),0) AS 'orderAmount',
+        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END),0) AS 'validOrderAmount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN regimental_promotion_amount ELSE 0 END),0) AS
         'regimentalPromotionAmount',
         COUNT(DISTINCT promoter_id) as 'promoterCount'
@@ -1453,7 +1449,8 @@
         FROM_UNIXTIME(order_create_time / 1000, '%Y-%m-%d') as 'date',
         count(1) AS 'orderCount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderCount',
-        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END),0) AS 'orderAmount',
+        IFNULL(SUM(order_amount),0) AS 'orderAmount',
+        IFNULL(SUM(CASE WHEN order_status != 80 THEN order_amount ELSE 0 END),0) AS 'validOrderAmount',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN regimental_promotion_amount ELSE 0 END),0) AS
         'regimentalPromotionAmount'
         FROM kuaishou_supply_chain
@@ -2385,6 +2382,6 @@
         <if test="userId != null and userId != ''">
             and t1.userId = #{userId}
         </if>
-         order by t2.orderNum desc
+        order by t2.orderNum desc
     </select>
 </mapper>