Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/yumeng/RuiXuan-Cloud

# Conflicts:
#	ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemCollectSamplesService.java
#	ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java
yumeng 1 year ago
parent
commit
1554ea0f8b

+ 15 - 1
ruixuan-common/src/main/java/com/ruixuan/common/utils/DateUtils.java

@@ -3,6 +3,7 @@ package com.ruixuan.common.utils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 import java.lang.management.ManagementFactory;
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
@@ -505,7 +506,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return d2;
     }
 
+    public static Integer getHour(String dateStr) {
+        try {
+            DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Calendar cal = Calendar.getInstance();
+            Date date = sdf.parse(dateStr);
+            cal.setTime(date);
+            return cal.get(Calendar.HOUR_OF_DAY);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
     public static void main(String[] args) {
-        System.out.println(getAllDatesOfTwoTimes("2023-02-01", "2023-02-15"));
+        System.out.println(getHour("2023-02-01 23:10:12"));
     }
 }

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/bytedance/entity/BytedanceOrderList.java

@@ -111,6 +111,11 @@ public class BytedanceOrderList implements Serializable {
      */
     @Excel(name = "付款时间")
     private Long paySuccessTime;
+    /**
+     * 付款小时时间
+     */
+    @Excel(name = "付款小时时间")
+    private Integer paySuccessTimeHour;
 
     /**
      * 结算时间

+ 82 - 82
ruixuan-live/src/main/java/com/ruixuan/bytedance/service/impl/BytedanceServiceImpl.java

@@ -178,7 +178,7 @@ public class BytedanceServiceImpl implements IBytedanceService {
 
         AllianceColonelActivityProductResponse response = request.execute(accessToken);
         JSONObject jsonObject = JSONObject.parseObject(response.toString());
-        log.info("返回数据:{}",jsonObject);
+        log.info("返回数据:{}", jsonObject);
         Integer code = jsonObject.getInteger("code");
         String msg = jsonObject.getString("msg");
         if (code == 10000) {
@@ -186,85 +186,83 @@ public class BytedanceServiceImpl implements IBytedanceService {
             returnJson.put("message", "请求成功");
             returnJson.put("judgeStatus", "1");
             JSONObject dataJson = jsonObject.getJSONObject("data");
-          JSONArray  dataArr = dataJson.getJSONArray("data");
-          if(!Check.isNull(dataArr)){
-              JSONObject data = dataArr.getJSONObject(0);
-              if (!Check.isNull(data)) {
-                  JSONObject itemJson = new JSONObject();
-                  String product_id = data.getString("product_id");//商品ID
-                  String title = data.getString("title");//商品名称
-                  Long price = data.getLong("price");//商品售价
-                  Double cos_ratio = data.getDouble("cos_ratio");//	佣金比例
-                  Long cos_fee = data.getLong("cos_fee");//	佣金金额,单位分
-                  Long first_cid = data.getLong("first_cid");//	商品一级类目
-                  Long second_cid = data.getLong("second_cid");//	商品二级类目
-                  Long third_cid = data.getLong("third_cid");//	商品商品三级类目
-                  Long sales = data.getLong("sales");//	销量
-                  String cover = data.getString("cover");//	商品主图
-                  String detail_url = data.getString("detail_url");//	商品团长活动链接
-                  Long shop_id = data.getLong("shop_id");//	店铺ID
-                  String shop_name = data.getString("shop_name");//	店铺名称
-                  Integer status = data.getInteger("status");//	审核状态
-                  String reason = data.getString("reason");//	reason
-                  Long category_id = data.getLong("category_id");//	行业类目ID
-                  String category_name = data.getString("category_name");//	行业类目名称
-                  String product_stock = data.getString("product_stock");//	商品库存
-                  String shop_score = data.getString("shop_score");//	店铺分
-                  Double service_ratio = data.getDouble("service_ratio");//	店铺分
-
-                  itemJson.put("itemId", product_id);
-                  itemJson.put("itemTitle", title);
-                  itemJson.put("itemPrice", price);
-                  itemJson.put("itemDesc", title);
-                  itemJson.put("zkFinalPrice", price);
-                  itemJson.put("itemImgUrl", cover);
-                  itemJson.put("shopStar", "-");
-                  itemJson.put("mallLogisticsScore", shop_name);
-                  if (status == 0) {
-                      itemJson.put("activityItemStatus", 1);
-                  } else if (status == 1) {
-                      itemJson.put("activityItemStatus", 2);
-                  } else if (status == 2) {
-                      itemJson.put("activityItemStatus", 3);
-                  } else {
-                      itemJson.put("activityItemStatus", 5);
-                  }
-                  itemJson.put("categoryId", category_id);
-                  itemJson.put("categoryName", category_name);
-                  itemJson.put("itemGalleryUrls", null); // 轮播图
-                  itemJson.put("itemDescUrls", null); // 详情图
-                  itemJson.put("activityId", activityId);
-                  itemJson.put("shopTitle", shop_name);
-                  if(!Check.isNull(cos_ratio)){
-                      itemJson.put("commissionRate", cos_ratio * 10);
-                  }else {
-                      itemJson.put("commissionRate", 0);
-                  }
-
-                  itemJson.put("mallServiceScore", shop_score);
-                  itemJson.put("mallQualityScore", ""); // 店铺质量分
-                  itemJson.put("skuList", ""); // sku信息
-                  itemJson.put("postArea", ""); // 发货地址
-                  itemJson.put("detailUrl", detail_url);
-                  if(!Check.isNull(service_ratio)){
-                      itemJson.put("regimentalPromotionRate", service_ratio *  10);
-                  }else {
-                      itemJson.put("regimentalPromotionRate",0);
-                  }
-
-                  returnJson.put("itemJson", itemJson);
-
-              }else{
-                  returnJson.put("code", -1);
-                  returnJson.put("message", "返回数据为空");
-              }
-          } else{
-              returnJson.put("code", -1);
-              returnJson.put("message", "返回数据为空");
-
-          }
+            JSONArray dataArr = dataJson.getJSONArray("data");
+            if (!Check.isNull(dataArr)) {
+                JSONObject data = dataArr.getJSONObject(0);
+                if (!Check.isNull(data)) {
+                    JSONObject itemJson = new JSONObject();
+                    String product_id = data.getString("product_id");//商品ID
+                    String title = data.getString("title");//商品名称
+                    Long price = data.getLong("price");//商品售价
+                    Double cos_ratio = data.getDouble("cos_ratio");//	佣金比例
+                    Long cos_fee = data.getLong("cos_fee");//	佣金金额,单位分
+                    Long first_cid = data.getLong("first_cid");//	商品一级类目
+                    Long second_cid = data.getLong("second_cid");//	商品二级类目
+                    Long third_cid = data.getLong("third_cid");//	商品商品三级类目
+                    Long sales = data.getLong("sales");//	销量
+                    String cover = data.getString("cover");//	商品主图
+                    String detail_url = data.getString("detail_url");//	商品团长活动链接
+                    Long shop_id = data.getLong("shop_id");//	店铺ID
+                    String shop_name = data.getString("shop_name");//	店铺名称
+                    Integer status = data.getInteger("status");//	审核状态
+                    String reason = data.getString("reason");//	reason
+                    Long category_id = data.getLong("category_id");//	行业类目ID
+                    String category_name = data.getString("category_name");//	行业类目名称
+                    String product_stock = data.getString("product_stock");//	商品库存
+                    String shop_score = data.getString("shop_score");//	店铺分
+                    Double service_ratio = data.getDouble("service_ratio");//	店铺分
+
+                    itemJson.put("itemId", product_id);
+                    itemJson.put("itemTitle", title);
+                    itemJson.put("itemPrice", price);
+                    itemJson.put("itemDesc", title);
+                    itemJson.put("zkFinalPrice", price);
+                    itemJson.put("itemImgUrl", cover);
+                    itemJson.put("shopStar", "-");
+                    itemJson.put("mallLogisticsScore", shop_name);
+                    if (status == 0) {
+                        itemJson.put("activityItemStatus", 1);
+                    } else if (status == 1) {
+                        itemJson.put("activityItemStatus", 2);
+                    } else if (status == 2) {
+                        itemJson.put("activityItemStatus", 3);
+                    } else {
+                        itemJson.put("activityItemStatus", 5);
+                    }
+                    itemJson.put("categoryId", category_id);
+                    itemJson.put("categoryName", category_name);
+                    itemJson.put("itemGalleryUrls", null); // 轮播图
+                    itemJson.put("itemDescUrls", null); // 详情图
+                    itemJson.put("activityId", activityId);
+                    itemJson.put("shopTitle", shop_name);
+                    if (!Check.isNull(cos_ratio)) {
+                        itemJson.put("commissionRate", cos_ratio * 10);
+                    } else {
+                        itemJson.put("commissionRate", 0);
+                    }
 
+                    itemJson.put("mallServiceScore", shop_score);
+                    itemJson.put("mallQualityScore", ""); // 店铺质量分
+                    itemJson.put("skuList", ""); // sku信息
+                    itemJson.put("postArea", ""); // 发货地址
+                    itemJson.put("detailUrl", detail_url);
+                    if (!Check.isNull(service_ratio)) {
+                        itemJson.put("regimentalPromotionRate", service_ratio * 10);
+                    } else {
+                        itemJson.put("regimentalPromotionRate", 0);
+                    }
 
+                    returnJson.put("itemJson", itemJson);
+
+                } else {
+                    returnJson.put("code", -1);
+                    returnJson.put("message", "返回数据为空");
+                }
+            } else {
+                returnJson.put("code", -1);
+                returnJson.put("message", "返回数据为空");
+
+            }
 
 
         } else {
@@ -301,15 +299,15 @@ public class BytedanceServiceImpl implements IBytedanceService {
             JSONObject dataJson = jsonObject.getJSONObject("data");
             if (!Check.isNull(dataJson)) {
                 JSONArray records = dataJson.getJSONArray("records");
-                if(Check.isNull(records)){
+                if (Check.isNull(records)) {
                     returnJson.put("code", -1);
                     returnJson.put("message", "媒体返回商品信息为空");
                 }
-                JSONObject record  = records.getJSONObject(0);
-                if(Check.isNull(record)){
+                JSONObject record = records.getJSONObject(0);
+                if (Check.isNull(record)) {
                     returnJson.put("code", -1);
                     returnJson.put("message", "媒体返回商品信息为空");
-                }else {
+                } else {
                     String update_time = record.getString("update_time"); // 更新时间
                     String product_id = record.getString("product_id"); // 商品id
                     String product_name = record.getString("product_name"); // 商品id
@@ -397,7 +395,9 @@ public class BytedanceServiceImpl implements IBytedanceService {
                     }
                     if (Check.isNotNull(order.getPaySuccessTime())) {
                         orderList.setPaySuccessTime(DateUtils.strDateTimsToInt(order.getPaySuccessTime()));
+                        orderList.setPaySuccessTimeHour(DateUtils.getHour(order.getPaySuccessTime()));
                     }
+
                     if (Check.isNotNull(order.getRefundTime())) {
                         orderList.setRefundTime(DateUtils.strDateTimsToInt(order.getRefundTime()));
                     }

+ 15 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -772,6 +772,21 @@ public class KuaishouItemCollectSamplesController extends BaseController {
         return returnJson;
     }
 
+    @GetMapping("/getOrderHourData")
+    @ApiOperation(value = "工作台——订单小时数据")
+    public JSONObject getOrderHourData(@ApiParam("媒体,1-抖音;2-快手") @RequestParam(value = "mediaId", required = false) String mediaId
+    ) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            return kuaishouItemCollectSamplesService.getOrderHourData(mediaId);
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", 500);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
 
     @GetMapping("/getDataAnalysis")
     @ApiOperation(value = "工作台——数据分析")

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java

@@ -160,4 +160,8 @@ public interface SupplyChainMapper {
     void replaceMgsKuaishouActivityInfo(@Param("list") List<KuaiShouActivityInfo> list);
 
     void updateMgsKuaishouSupplyChain(@Param("list") List<Long> list);
+
+    List<JSONObject> getBytedanceOrderHourDataList(@Param("date") Long date);
+
+    List<JSONObject> getKuaishouOrderHourDataList(@Param("date") String date);
 }

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

@@ -115,5 +115,7 @@ public interface IKuaishouItemCollectSamplesService {
     String getStatusStringByCourierNumbe(String nu);
 
     List<JSONObject> getBigDataAnalysis(String mediaId);
+
+    JSONObject getOrderHourData( String mediaId);
 }
 

+ 3 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java

@@ -184,4 +184,7 @@ public interface ISupplyChainService {
      */
     void addListKuaishouActivityInfo() throws InterruptedException;
 
+    List<JSONObject> getBytedanceOrderHourDataList(Long today);
+
+    List<JSONObject> getKuaishouOrderHourDataList(String today);
 }

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

@@ -469,6 +469,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         }
         data.put("allNumber", order.getLong("allNumber"));//订单总数
         data.put("promoterCount", order.getLong("promoterCount"));//达人总数
+        data.put("itemCount", order.getLong("itemCount"));//商品数
         data.put("validOrderNUm", order.getLong("validOrderNUm"));//有效订单数
         data.put("inValidOrderNUm", order.getLong("allNumber") - order.getLong("validOrderNUm"));//失效订单数
         data.put("orderAmount", order.getLong("orderAmount"));//订单金额
@@ -592,6 +593,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
             data.put("sendRate", order.getString("sendRate"));//订单发货率
             data.put("allNumber", order.getLong("allNumber"));//订单总数
             data.put("promoterCount", order.getLong("promoterCount"));//达人总数
+            data.put("itemCount", order.getLong("itemCount"));//达人总数
             data.put("validOrderNUm", order.getLong("validOrderNUm"));//有效订单数
             data.put("inValidOrderNUm", order.getLong("allNumber") - order.getLong("validOrderNUm"));//失效订单数
             data.put("orderAmount", order.getLong("orderAmount"));//订单金额
@@ -751,6 +753,31 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
 
     }
 
+    @Override
+    public JSONObject getOrderHourData(String mediaId) {
+        JSONObject returnJson = new JSONObject();
+        returnJson.put("code", 0);
+        returnJson.put("message", "成功");
+        //当天 20220501
+        String today = DateUtils.getNowDateStr();
+        //昨天 20220501
+        String yesterday = DateUtils.getSubtractTime(new Date(), 1);
+        JSONObject obj = new JSONObject();
+        if ("1".equals(mediaId)) {
+            List<JSONObject> list = supplyChainService.getBytedanceOrderHourDataList(DateUtils.strDateToInt(today));
+            List<JSONObject> ylist = supplyChainService.getBytedanceOrderHourDataList(DateUtils.strDateToInt(yesterday));
+            obj.put("todayList", list);
+            obj.put("yesterdayList", ylist);
+        } else {
+            List<JSONObject> list = supplyChainService.getKuaishouOrderHourDataList(today);
+            List<JSONObject> ylist = supplyChainService.getKuaishouOrderHourDataList(yesterday);
+            obj.put("todayList", list);
+            obj.put("yesterdayList", ylist);
+        }
+        returnJson.put("data", obj);
+        return returnJson;
+    }
+
     // 渠道—数据分析
     private JSONObject getDataAnalysisByChannel(List<Long> userList, String startDate, String endDate, String mediaId) {
         JSONObject data = new JSONObject();

+ 10 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -625,6 +625,16 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
 
     }
 
+    @Override
+    public List<JSONObject> getBytedanceOrderHourDataList(Long date) {
+        return supplyChainMapper.getBytedanceOrderHourDataList(date);
+    }
+
+    @Override
+    public List<JSONObject> getKuaishouOrderHourDataList(String date) {
+        return supplyChainMapper.getKuaishouOrderHourDataList(date);
+    }
+
     private void getInfoKuaishouActivityInfo(KuaishouAccessToken accessToken, String url) {
         List<KuaiShouActivityInfo> list = new ArrayList<>();
         String appKey = accessToken.getAppKey();

+ 2 - 0
ruixuan-live/src/main/resources/mapper/bytedance/BytedanceMapper.xml

@@ -142,6 +142,7 @@
         app,
         update_time,
         pay_success_time,
+        pay_success_time_hour,
         settle_time,
         pay_goods_amount,
         settled_goods_amount,
@@ -193,6 +194,7 @@
             #{cell.app},
             #{cell.updateTime},
             #{cell.paySuccessTime},
+            #{cell.paySuccessTimeHour},
             #{cell.settleTime},
             #{cell.payGoodsAmount},
             #{cell.settledGoodsAmount},

+ 46 - 14
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -68,8 +68,9 @@
             and promoter_nick_name like concat(concat('%',#{promoterNickName}),'%')
         </if>
         group by promoter_id) t left join (
-            select  promoter_id as 'promoterId',group_concat(user_name)  as 'userName' from  kuaishou_promoter where  media_id = 2
-                                               group by promoter_id
+        select promoter_id as 'promoterId',group_concat(user_name) as 'userName' from kuaishou_promoter where media_id =
+        2
+        group by promoter_id
         ) t2 on t.promoterId = t2.promoterId
         order by t.orderNum desc
     </select>
@@ -595,15 +596,17 @@
         round((t1.orderNum - t2.orderNum) / t2.orderNum,4) as 'radio'
         from (
         select
-        promoter_id as 'promoterId',
-        promoter_nick_name as 'promoterNickName',
+        t.promoter_id as 'promoterId',
+        t.promoter_nick_name as 'promoterNickName',
+               tt.promoter_url as 'promoterUrl',
         count(oid) as 'orderNum',
         sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
         round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio'
-        from kuaishou_supply_chain
+        from kuaishou_supply_chain t
+        left join kuaishou_promoter tt on t.promoter_id = tt.promoter_id
         where 1= 1
         <if test='promoterIds != null and promoterIds.size() > 0'>
-            AND promoter_id IN
+            AND t.promoter_id IN
             <foreach collection="promoterIds" item="item" separator=","
                      open="(" close=")">
                 #{item}
@@ -615,7 +618,7 @@
         <if test="nowEndHourTemp != null and nowEndHourTemp != ''">
             and order_create_time &lt;= #{nowEndHourTemp}
         </if>
-        group by promoter_id
+        group by t.promoter_id
         ) t1
         left join (select
         promoter_id as 'promoterId',
@@ -695,12 +698,14 @@
     <select id="getPromoterRatioList" resultType="com.alibaba.fastjson.JSONObject">
         select * from (
         select
-        promoter_id as 'promoterId',
-        promoter_nick_name as 'promoterNickName',
+        t1.promoter_id as 'promoterId',
+        t1.promoter_nick_name as 'promoterNickName',
         count(oid) as 'orderNum',
+        tt.promoter_url as 'promoterUrl',
         sum(case when order_status != 80 then 1 else 0 end) as 'validOrderNUm',
         round(sum(case when order_status != 80 then 1 else 0 end) / count(oid),4) as 'validRadio'
-        from kuaishou_supply_chain
+        from kuaishou_supply_chain t1
+        left join kuaishou_promoter tt on t1.promoter_id = tt.promoter_id
         where 1= 1
         <if test="start != null and start != ''">
             and order_create_time &gt;= #{start}
@@ -708,7 +713,7 @@
         <if test="end != null and end != ''">
             and order_create_time &lt;= #{end}
         </if>
-        group by promoter_id) t
+        group by t1.promoter_id) t
         order by t.orderNum desc
     </select>
 
@@ -896,7 +901,10 @@
     </select>
     <select id="getSupplyChainUserList" resultType="com.alibaba.fastjson.JSONObject">
         select *
-        from (select t3.user_id as 'userId', t3.nick_name as 'nickMame', t1.role_name as 'roleName', t3.status,
+        from (select t3.user_id as 'userId',
+                     t3.nick_name as 'nickMame',
+                     t1.role_name as 'roleName',
+                     t3.status,
                      t3.create_time
               from sys_role t1
                        left join sys_user_role t2 on t1.role_id = t2.role_id
@@ -907,7 +915,7 @@
                                     'bd',
                                     'bdManager'
                   )
-              and t3.status = 0
+                and t3.status = 0
               group by t3.user_id) t
         where t.userId is not null
         order by t.create_time desc
@@ -1348,6 +1356,7 @@
     <select id="selectOrderInfo" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         COUNT(DISTINCT promoter_id) as 'promoterCount',
+        COUNT(DISTINCT item_id) as 'itemCount',
         COUNT(oid) as 'allNumber',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
         IFNULL(SUM(order_amount), 0) AS 'orderAmount',
@@ -1369,6 +1378,7 @@
     <select id="selectOrderInfoBytedance" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         COUNT(DISTINCT author_short_id) as 'promoterCount',
+        COUNT(DISTINCT product_id) as 'itemCount',
         COUNT(order_id) as 'allNumber',
         IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
         IFNULL(SUM(total_pay_amount), 0) AS 'orderAmount',
@@ -1402,6 +1412,7 @@
         FROM (
         SELECT
         COUNT(DISTINCT promoter_id) as 'promoterCount',
+        COUNT(DISTINCT item_id) as 'itemCount',
         COUNT(oid) as 'allNumber',
         IFNULL(SUM(CASE WHEN order_status != 80 THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
         IFNULL(SUM(order_amount), 0) AS 'orderAmount',
@@ -1425,6 +1436,7 @@
     <select id="selectOrderInfoByItemIdsBytedance" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         COUNT(DISTINCT author_short_id) as 'promoterCount',
+        COUNT(DISTINCT product_id) as 'itemCount',
         COUNT(order_id) as 'allNumber',
         IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN 1 ELSE 0 END), 0) AS 'validOrderNUm',
         IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN total_pay_amount ELSE 0 END)/100, 0) AS 'orderAmount',
@@ -2033,7 +2045,7 @@
         sum(total_regimental_settle_amount) as 'totalRegimentalSettleAmount',
         IFNULL(SUM(CASE WHEN sample_voucher_status = 2 THEN total_regimental_settle_amount ELSE 0 END), 0) AS
         'voucherTotalRegimentalSettleAmount'
-        from  promoter_item_order_count
+        from promoter_item_order_count
         where 1 = 1
         <if test="start != null and start != ''">
             and stat_date &gt;= #{start}
@@ -2639,5 +2651,25 @@
         </foreach>
     </update>
 
+    <select id="getBytedanceOrderHourDataList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT pay_success_time_hour as 'hour',
+               IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN 1 ELSE 0 END), 0) AS 'validOrderNum',
+               IFNULL(SUM(CASE WHEN flow_point != 'REFUND' THEN total_pay_amount ELSE 0 END), 0) AS 'baseAmount'
+        FROM bytedance_order_list
+        WHERE pay_success_time = #{date}
+        GROUP BY pay_success_time_hour
+        ORDER BY pay_success_time_hour
+    </select>
+
+    <select id="getKuaishouOrderHourDataList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+            stat_hour as 'hour',
+            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 'baseAmount'
+        FROM kuaishou_supply_chain
+        where stat_date = #{date}
+        GROUP BY stat_hour
+        ORDER BY stat_hour
+    </select>
 
 </mapper>