yumeng 1 год назад
Родитель
Сommit
8254dd63f0

+ 2 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -1414,10 +1414,11 @@ public class SupplyChainController extends BaseController {
                 export.add(date.getString("regimentalPromotionAmount"));
                 export.add(date.getString("totalRegimentalSettleAmount"));
                 export.add(date.getString("imageUrl"));
+                export.add(date.getString("ccrValue"));
                 exportList.add(export);
             }
         }
-        String[] headers = {"所属人", "商品ID", "商品名称", "商品单价", "佣金率", "订单数", "有效订单数", "有效订单率", "失效订单数", "发货数", "发货率", "未发货数", "付款金额", "服务费率", "预估服务费收入", "结算服务费收入", "商品封面"};
+        String[] headers = {"所属人", "商品ID", "商品名称", "商品单价", "佣金率", "订单数", "有效订单数", "有效订单率", "失效订单数", "发货数", "发货率", "未发货数", "付款金额", "服务费率", "预估服务费收入", "结算服务费收入", "商品封面", "ccr"};
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();

+ 36 - 10
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -188,7 +188,13 @@
         round(sum(case when t1.send_status = 1 and t1.order_status != 80 then 1 else 0 end) / sum(case when
         send_status = 1 then 1 else 0 end), 4) as 'deliveryRadio',
         t1.item_commission_rate as 'itemCommissionRate',
-        t3.ccr_value as 'ccrValue'
+        t3.ccr_value as 'ccrValue',
+        (case
+        when t3.ccr_value = '-'
+        then 0
+        else replace( t3.ccr_value,'%','')
+        end
+        ) as 'ccrInt'
         from kuaishou_supply_chain t1
         left join kuaishou_item_bind_user t2
         on t1.item_id = t2.item_id
@@ -217,14 +223,24 @@
 
 
     <select id="itemBindList" resultType="com.alibaba.fastjson.JSONObject">
-        select *,t3.ccr_value as 'ccrValue'
-        from (select item_id as 'itemId', item_title as 'itemTitle', user_id as 'userId', user_name as 'userName'
-        from kuaishou_item_list
+        select t1.*,t2.*
+
+        from (select t.item_id as 'itemId', t.item_title as 'itemTitle', t.user_id as 'userId', t.user_name as
+        'userName',
+        (case
+        when tt.ccr_value = '-' or tt.ccr_value is null
+        then 0
+        else  replace(tt.ccr_value, '%', '')
+        end
+        ) as 'ccrInt',
+        tt.ccr_value as 'ccrValue'
+        from kuaishou_item_list t left join kuaishou_item_ccr_info tt
+        on t.item_id = tt.item_id
         where
-        create_time &gt;= str_to_date(concat(#{bindStartDate},' 00:00:01'),'%Y-%m-%d
+        t.create_time &gt;= str_to_date(concat(#{bindStartDate},' 00:00:01'),'%Y-%m-%d
         %H:%i:%s')
         and
-        create_time &lt;= str_to_date(concat(#{bindEndDate},' 23:59:59'),'%Y-%m-%d
+        t.create_time &lt;= str_to_date(concat(#{bindEndDate},' 23:59:59'),'%Y-%m-%d
         %H:%i:%s')
         ) t1
         left join
@@ -248,10 +264,10 @@
         else 0 end),
         4) as 'deliveryRadio',
         item_commission_rate as 'itemCommissionRate'
-        from kuaishou_supply_chain t1
+        from kuaishou_supply_chain
         where order_create_time &gt;= #{start}
         group by item_id) t2 on t1.itemId = t2.itemId
-        left join kuaishou_item_ccr_info t3 on t1.itemId = t3.item_id
+
         where 1 = 1
         <if test="itemId != null and itemId != ''">
             and t1.itemId = #{itemId}
@@ -1064,11 +1080,19 @@
         ) AS 'regimentalPromotionAmount',
         sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) as
         'totalRegimentalSettleAmount',
-        t2.item_commission_rate as 'itemCommissionRate'
+        t2.item_commission_rate as 'itemCommissionRate',
+        t3.ccr_value as 'ccrValue',
+        (case
+        when t3.ccr_value = '-'
+        then 0
+        else replace(t3.ccr_value,'%','')
+        end
+        ) as 'ccrInt'
         FROM
         kuaishou_item_bind_user t1
         LEFT JOIN
         kuaishou_supply_chain t2 ON t1.item_id = t2.item_id
+        left join kuaishou_item_ccr_info t3 on t1.item_id = t3.item_id
         WHERE
         1 = 1
         <if test="start != null and start != ''">
@@ -1326,11 +1350,13 @@
         round(
         sum(case when t2.order_status != 80 then t2.total_regimental_settle_amount else 0 end) / 100,2) as
         'totalRegimentalSettleAmount',
-        concat(round(t2.item_commission_rate / 10),'%') as 'itemCommissionRate'
+        concat(round(t2.item_commission_rate / 10),'%') as 'itemCommissionRate',
+        t3.ccr_value as 'ccrValue'
         FROM
         kuaishou_item_bind_user t1
         LEFT JOIN
         kuaishou_supply_chain t2 ON t1.item_id = t2.item_id
+        left join kuaishou_item_ccr_info t3 on t1.item_id = t3.item_id
         WHERE
         1 = 1
         <if test="start != null and start != ''">