Browse Source

首页调整

yumeng 1 year ago
parent
commit
0542afc52a

+ 4 - 2
ruixuan-live/src/main/java/com/ruixuan/bytedance/controller/BytedancePromoterOrderListController.java

@@ -398,10 +398,11 @@ public class BytedancePromoterOrderListController extends BaseController {
                 export.add(date.getString("orderAmount"));
                 export.add(date.getString("orderAmount"));
                 export.add(date.getString("regimentalPromotionAmount"));
                 export.add(date.getString("regimentalPromotionAmount"));
                 export.add(date.getString("totalRegimentalSettleAmount"));
                 export.add(date.getString("totalRegimentalSettleAmount"));
+                export.add(date.getString("secondEstimatedCommission"));
                 exportList.add(export);
                 exportList.add(export);
             }
             }
         }
         }
-        String[] headers = {"渠道ID", "渠道姓名", "(总)达人数", "(总)领样达人数", "(总)领样率", "(总)未领样数", "发样数", "发样达人数", "发样商品数", "订单数", "有效订单数", "有效订单率", "订单金额", "预估服务费", "结算服务费"};
+        String[] headers = {"渠道ID", "渠道姓名", "(总)达人数", "(总)领样达人数", "(总)领样率", "(总)未领样数", "发样数", "发样达人数", "发样商品数", "订单数", "有效订单数", "有效订单率", "订单金额", "预估服务费", "结算服务费", "服务费支出"};
         OutputStream os = response.getOutputStream();
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();
         XSSFWorkbook workbook = new XSSFWorkbook();
@@ -899,10 +900,11 @@ public class BytedancePromoterOrderListController extends BaseController {
                 export.add(date.getString("payAmount"));
                 export.add(date.getString("payAmount"));
                 export.add(date.getString("regimentalPromotionAmount"));
                 export.add(date.getString("regimentalPromotionAmount"));
                 export.add(date.getString("totalRegimentalSettleAmount"));
                 export.add(date.getString("totalRegimentalSettleAmount"));
+                export.add(date.getString("secondEstimatedCommission"));
                 exportList.add(export);
                 exportList.add(export);
             }
             }
         }
         }
-        String[] headers = {"招商", "商品数", "发样数", "订单数", "有效订单数", "有效率", "实付金额", "预估服务费收入", "结算服务费收入"};
+        String[] headers = {"招商", "商品数", "发样数", "订单数", "有效订单数", "有效率", "实付金额", "预估服务费收入", "结算服务费收入", "服务费支出"};
         OutputStream os = response.getOutputStream();
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();
         XSSFWorkbook workbook = new XSSFWorkbook();

+ 56 - 16
ruixuan-live/src/main/resources/mapper/bytedance/BytedancePromoterOrderListMapper.xml

@@ -456,8 +456,17 @@
         'validRadio',
         'validRadio',
         sum(case when t2.flow_point = 'REFUND' then 1 else 0 end) AS 'invalidOrderNUm',
         sum(case when t2.flow_point = 'REFUND' then 1 else 0 end) AS 'invalidOrderNUm',
         sum(case when t2.flow_point != 'REFUND' then t2.total_pay_amount else 0 end)/100 AS 'payAmount',
         sum(case when t2.flow_point != 'REFUND' then t2.total_pay_amount else 0 end)/100 AS 'payAmount',
-        sum(case when t2.flow_point != 'REFUND' then t2.colonel_estimated_commission
-        else 0 end) *0.9 /100 AS 'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.colonel_estimated_commission
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type = 2
+        then t2.second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.second_estimated_commission
+        ELSE 0 END) / 100 AS 'secondEstimatedCommission',
         sum(case when t2.flow_point != 'REFUND' then t2.colonel_real_commission else 0 end)/100 as
         sum(case when t2.flow_point != 'REFUND' then t2.colonel_real_commission else 0 end)/100 as
         'totalRegimentalSettleAmount'
         'totalRegimentalSettleAmount'
         FROM bytedance_promoter_order_list t2
         FROM bytedance_promoter_order_list t2
@@ -495,23 +504,36 @@
         'validRadio',
         'validRadio',
         sum(case when t2.flow_point = 'REFUND' then 1 else 0 end) AS 'invalidOrderNUm',
         sum(case when t2.flow_point = 'REFUND' then 1 else 0 end) AS 'invalidOrderNUm',
         sum(case when t2.flow_point != 'REFUND' then t2.total_pay_amount else 0 end)/100 AS 'payAmount',
         sum(case when t2.flow_point != 'REFUND' then t2.total_pay_amount else 0 end)/100 AS 'payAmount',
-        sum(case when t2.flow_point != 'REFUND' then t2.colonel_estimated_commission
-        else 0 end) * 0.9 /100 AS 'regimentalPromotionAmount',
-        sum(case when t2.flow_point != 'REFUND' then t2.colonel_real_commission else 0 end)/100 as
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.colonel_estimated_commission
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type = 2
+        then t2.second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.second_estimated_commission
+        ELSE 0 END) / 100 AS 'secondEstimatedCommission',
+        sum(case when t2.flow_point != 'REFUND' then t2.colonel_real_commission else 0 end) / 100 as
         'totalRegimentalSettleAmount'
         'totalRegimentalSettleAmount'
-        FROM kuaishou_item_list t1
+        FROM (select * from kuaishou_item_list where create_time >= CONCAT(date_format(#{start},'%Y-%m-%d'),' 00:00:00')
+        and create_time <= CONCAT(date_format(#{start},'%Y-%m-%d'),' 23:59:59')
+        and media_id = 1
+        ) t1
         LEFT JOIN (SELECT product_id,
         LEFT JOIN (SELECT product_id,
         order_id,
         order_id,
         flow_point,
         flow_point,
         total_pay_amount,
         total_pay_amount,
         colonel_estimated_commission,
         colonel_estimated_commission,
-        colonel_real_commission
+        colonel_real_commission,
+        colonel_type,
+        second_estimated_commission
         FROM bytedance_promoter_order_list
         FROM bytedance_promoter_order_list
         WHERE pay_success_time >= #{start}
         WHERE pay_success_time >= #{start}
         ) t2
         ) t2
         on t1.item_id = t2.product_id
         on t1.item_id = t2.product_id
-        WHERE t1.create_time >= CONCAT(#{start},' 00:00:00')
-        and t1.create_time <= CONCAT(#{end},' 23:59:59')
+
         <if test="userId != null and userId != ''">
         <if test="userId != null and userId != ''">
             and t1.userId = #{userId}
             and t1.userId = #{userId}
         </if>
         </if>
@@ -519,9 +541,9 @@
         SELECT t1.user_id,count(distinct courier_number) AS 'sendSampleCount' FROM kuaishou_item_list t1 LEFT JOIN
         SELECT t1.user_id,count(distinct courier_number) AS 'sendSampleCount' FROM kuaishou_item_list t1 LEFT JOIN
         kuaishou_item_collect_samples t2
         kuaishou_item_collect_samples t2
         on t1.item_id = t2.item_id
         on t1.item_id = t2.item_id
-        WHERE t1.create_time >= CONCAT(#{start},' 00:00:00')
-        and t1.create_time &lt;= CONCAT(#{end},' 23:59:59')
-        and t2.courier_number_time >= CONCAT(#{start},' 00:00:00')
+        WHERE t1.create_time >=CONCAT(date_format(#{start},'%Y-%m-%d'),' 00:00:00')
+        and t1.create_time &lt;= CONCAT(date_format(#{start},'%Y-%m-%d'),' 23:59:59')
+        and t2.courier_number_time >= CONCAT(date_format(#{start},'%Y-%m-%d'),' 00:00:00')
         GROUP BY t1.user_id
         GROUP BY t1.user_id
         ) t2 on t.userId = t2.user_id ORDER BY t.orderNum desc
         ) t2 on t.userId = t2.user_id ORDER BY t.orderNum desc
     </select>
     </select>
@@ -802,8 +824,17 @@
         concat(round(sum(case when t2.flow_point != 'REFUND' then 1 else 0 end) / count(t2.order_id) * 100, 2), '%') as
         concat(round(sum(case when t2.flow_point != 'REFUND' then 1 else 0 end) / count(t2.order_id) * 100, 2), '%') as
         'validOrderRate',
         'validOrderRate',
         round(sum(t2.total_pay_amount) / 100, 2) as 'orderAmount',
         round(sum(t2.total_pay_amount) / 100, 2) as 'orderAmount',
-        round( sum( CASE WHEN t2.flow_point != 'REFUND' THEN t2.colonel_estimated_commission ELSE 0 END ) * 0.9 / 100, 2
-        ) as 'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.colonel_estimated_commission
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type = 2
+        then t2.second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.second_estimated_commission
+        ELSE 0 END) / 100 AS 'secondEstimatedCommission',
         round(sum(t2.colonel_real_commission) / 100, 2) as 'totalRegimentalSettleAmount'
         round(sum(t2.colonel_real_commission) / 100, 2) as 'totalRegimentalSettleAmount'
         from promoter_bind_channel_date t1
         from promoter_bind_channel_date t1
         left join bytedance_promoter_order_list t2
         left join bytedance_promoter_order_list t2
@@ -867,8 +898,17 @@
         concat(round(sum(case when t2.flow_point != 'REFUND' then 1 else 0 end) / count(t2.order_id) * 100, 2), '%') as
         concat(round(sum(case when t2.flow_point != 'REFUND' then 1 else 0 end) / count(t2.order_id) * 100, 2), '%') as
         'validOrderRate',
         'validOrderRate',
         round(sum(t2.total_pay_amount) / 100, 2) as 'orderAmount',
         round(sum(t2.total_pay_amount) / 100, 2) as 'orderAmount',
-        round( sum( CASE WHEN t2.flow_point != 'REFUND' THEN t2.colonel_estimated_commission ELSE 0 END ) * 0.9 / 100, 2
-        ) as 'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.colonel_estimated_commission
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type = 2
+        then t2.second_estimated_commission
+        ELSE 0 END) * 0.9 / 100 AS
+        'regimentalPromotionAmount',
+        sum(CASE
+        WHEN t2.flow_point != 'REFUND' and t2.colonel_type != 2
+        THEN t2.second_estimated_commission
+        ELSE 0 END) / 100 AS 'secondEstimatedCommission',
         round(sum(t2.colonel_real_commission) / 100, 2) as 'totalRegimentalSettleAmount'
         round(sum(t2.colonel_real_commission) / 100, 2) as 'totalRegimentalSettleAmount'
         from kuaishou_promoter t1
         from kuaishou_promoter t1
         left join(select *
         left join(select *