Browse Source

添加YUXIU库代码,初版

zhaoxian 9 months ago
parent
commit
45c152c999

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

@@ -124,14 +124,14 @@ public class KuaishouItemListController extends BaseController {
 
 
     @GetMapping("/bytedanceToken")
-    @ApiOperation(value = "商品列表")
+    @ApiOperation(value = "bytedanceToken")
     public void bytedanceToken() {
         accessTokenService.refreshByteDanceAccessToken();
     }
 
 
     @GetMapping("/accessToken")
-    @ApiOperation(value = "商品列表")
+    @ApiOperation(value = "accessToken")
     public void accessToken() {
         accessTokenService.refreshAccessToken();
     }

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/AccessTokenMapper.java

@@ -21,6 +21,8 @@ public interface AccessTokenMapper {
 
     List<KuaishouAccessToken> getYufuTokenInfos();
 
+    List<KuaishouAccessToken> getYuxiuTokenInfos();
+
     List<KuaishouAccessToken> getRocketTokenInfos();
 
     List<JYAccessToken> getJYTokenInfos();

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouItemListMapper.java

@@ -81,6 +81,8 @@ public interface KuaishouItemListMapper {
 
     void insertYufuItem(KuaishouItemList kuaishouItemList);
 
+    void insertYuxiuItem(KuaishouItemList kuaishouItemList);
+
     void insertItemCheck(@Param("itemId") Long itemId, @Param("targetOwnershipId") String targetOwnershipId);
 
     String getItemOwnership(@Param("itemId") Long itemId);
@@ -94,5 +96,8 @@ public interface KuaishouItemListMapper {
     void batchRocketCategory(@Param("adds") List<KuaishouItemCategory> adds);
 
     void batchYufuCategory(@Param("adds") List<KuaishouItemCategory> adds);
+
+    void batchYuxiuCategory(@Param("adds") List<KuaishouItemCategory> adds);
+
 }
 

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -147,9 +147,14 @@ public interface KuaishouPromoterMapper {
 
     List<JYKuaishouPromoter> getYufuFailInfo();
 
+    List<JYKuaishouPromoter> getYuxiuFailInfo();
+
     void updateYufuKuaishouPromoterByPromoterId(KuaishouPromoter kuaishouPromoter);
 
+    void updateYuxiuKuaishouPromoterByPromoterId(KuaishouPromoter kuaishouPromoter);
+
     String getAuthCookie();
 
     List<Long> getAllJyPromoterList();
+
 }

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

@@ -162,12 +162,16 @@ public interface SupplyChainMapper {
 
     void replaceYufuKuaishouActivityInfo(@Param("list") List<KuaiShouActivityInfo> list);
 
+    void replaceYuxiuKuaishouActivityInfo(@Param("list") List<KuaiShouActivityInfo> list);
+
     void updateMgsKuaishouSupplyChain(@Param("list") List<Long> list);
 
     void updateRocketKuaishouSupplyChain(@Param("list") List<Long> list);
 
     void updateYufuKuaishouSupplyChain(@Param("list") List<Long> list);
 
+    void updateYuxiuKuaishouSupplyChain(@Param("list") List<Long> list);
+
     List<JSONObject> getBytedanceOrderHourDataList(@Param("date") Long date);
 
     List<JSONObject> getKuaishouOrderHourDataList(@Param("date") Long date);
@@ -182,6 +186,8 @@ public interface SupplyChainMapper {
 
     List<Long> getYufuKuaishouActivityInfoList();
 
+    List<Long> getYuxiuKuaishouActivityInfoList();
+
     void replaceKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
     void replaceMgsKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
@@ -190,6 +196,8 @@ public interface SupplyChainMapper {
 
     void replaceYufuKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
+    void replaceYuxiuKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
+
     List<JSONObject> getKsChannelGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") Integer date);
 
     List<JSONObject> getKsCourtshipGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") Integer date);
@@ -208,6 +216,8 @@ public interface SupplyChainMapper {
 
     int updateYufuOrderRegimentalSettleAmount(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
 
+    int updateYuxiuOrderRegimentalSettleAmount(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
+
     int updateRuixuanOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
 
     int updateMgsOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
@@ -216,6 +226,8 @@ public interface SupplyChainMapper {
 
     int updateYufuOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
 
+    int updateYuxiuOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
+
     void updateKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
 
     void updateMgsKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
@@ -224,6 +236,8 @@ public interface SupplyChainMapper {
 
     void updateYufuKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
 
+    void updateYuxiuKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
+
 
     List<JSONObject> shopList(Map<String, Object> requestMap);
 

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

@@ -20,6 +20,8 @@ public interface IAccessTokenService {
 
     List<KuaishouAccessToken> getYufuTokenInfos();
 
+    List<KuaishouAccessToken> getYuxiuTokenInfos();
+
     List<KuaishouAccessToken> getRocketTokenInfos();
 
 }

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/AccessTokenServiceImpl.java

@@ -150,6 +150,11 @@ public class AccessTokenServiceImpl implements IAccessTokenService {
     }
 
     @Override
+    public List<KuaishouAccessToken> getYuxiuTokenInfos() {
+        return accessTokenMapper.getYuxiuTokenInfos();
+    }
+
+    @Override
     public List<KuaishouAccessToken> getRocketTokenInfos() {
         return accessTokenMapper.getRocketTokenInfos();
     }

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemListServiceImpl.java

@@ -236,6 +236,9 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         if (targetOwnershipId.equals("yufu")) {
             kuaishouItemListMapper.insertYufuItem(kuaishouItemList);
         }
+        if (targetOwnershipId.equals("yuxiu")) {
+            kuaishouItemListMapper.insertYuxiuItem(kuaishouItemList);
+        }
         JSONObject mongoVo = new JSONObject();
         mongoVo.put("_id", kuaishouItemList.getItemId());
         mongoVo.put("ownership", targetOwnershipId);
@@ -361,6 +364,7 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         kuaishouItemListMapper.batchMgsCategory(adds);
         kuaishouItemListMapper.batchRocketCategory(adds);
         kuaishouItemListMapper.batchYufuCategory(adds);
+        kuaishouItemListMapper.batchYuxiuCategory(adds);
 
         return 0;
     }

+ 70 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -606,6 +606,57 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         }
     }
 
+    /**
+     * 同步更新数据
+     */
+    private void editYuxiuPromoter(Long id, String mediaId, String promoterId, boolean flag) {
+        try {
+            if (flag) {
+                /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
+                String key = DateUtils.getDate() + "yuxiu_" + promoterId + "_" + id;
+                String value = (String) redisUtil.get(key);
+                if (Check.isNotNull(value) && "1".equals(value)) {
+                    return;
+                }
+                redisUtil.set(key, "1", 60 * 60 * 24);
+            }
+
+            /*更新达人数据*/
+            Map<String, Object> param = new HashMap<>();
+            param.put("promoterId", promoterId);
+            param.put("mediaId", mediaId);
+            Long startTime = System.currentTimeMillis();
+            String content = HttpUtil.httpPostRequest(startIpPath + "promoterInfo/getPromoterId", param, null);
+            Thread.sleep(3000);
+
+            JSONObject result = JSONObject.parseObject(content);
+            if (Check.isNotNull(result) && Check.isNotNull(result.getString("promoterNickName"))) {
+                log.info("--------------------Yuxiu达人更新\n【入参】:{}\n【返回结果】:{}", param, result.toJSONString());
+                String province = "";
+                if (Check.isNotNull(result.getString("province"))) {
+                    province = result.getString("province").concat("-").concat(result.getString("city"));
+                }
+                KuaishouPromoter kuaishouPromoter = new KuaishouPromoter(
+                        id,
+                        result.getString("promoterNickName"),
+                        province,
+                        result.getString("promoterHeadImgUrl"),
+                        result.getString("fanNum"),
+                        result.getString("avgVideoSales"),
+                        result.getString("videoSales"),
+                        result.getString("totalSale"),
+                        promoterId
+                );
+                kuaishouPromoterMapper.updateYuxiuKuaishouPromoterByPromoterId(kuaishouPromoter);
+            } else {
+                log.error("更新达人失败,达人ID:{} 【返回结果】:{}", promoterId, result);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("更新达人信息异常", e);
+        }
+    }
+
     @Override
     public JSONObject insertKuaishouPromoter3(JYKuaishouPromoter promoter) {
         JSONObject result = new JSONObject();
@@ -760,6 +811,25 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         return "-------------yufu共计" + list.size() + "条,达人id: " + promoters.toString();
     }
 
+      //yuxiu
+    public String yuxiuInfo() {
+        List<JYKuaishouPromoter> list = kuaishouPromoterMapper.getYuxiuFailInfo();
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                try {
+                    list.forEach(kuaishouPromoter -> editYuxiuPromoter(kuaishouPromoter.getId(), kuaishouPromoter.getMediaId(), kuaishouPromoter.getPromoterId(), false));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
+        thread.start();
+        List<String> promoters = new ArrayList<>();
+        list.forEach(kuaishouPromoter -> promoters.add(kuaishouPromoter.getPromoterId()));
+        return "-------------yuxiu共计" + list.size() + "条,达人id: " + promoters.toString();
+    }
+
 
     @Override
     public int addFollowUpRecords(JSONObject result) {

+ 281 - 8
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -454,6 +454,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
         if ("miaogousi".equals(ownershipId)) {
             int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
@@ -472,6 +476,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
         if ("rocket".equals(ownershipId)) {
             int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
@@ -490,8 +498,16 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
         if ("yufu".equals(ownershipId)) {
+            int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
             int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
             if (rocket > 0) {
                 return rocket;
@@ -504,10 +520,32 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (mgs > 0) {
                 return mgs;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
+        }
+        if ("yuxiu".equals(ownershipId)) {
+            int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
             int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
             if (yufu > 0) {
                 return yufu;
             }
+            int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
+            if (rocket > 0) {
+                return rocket;
+            }
+            int ruixuan = supplyChainMapper.updateRuixuanOrder(oid, cpsOrderStatus);
+            if (ruixuan > 0) {
+                return ruixuan;
+            }
+            int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
+            if (mgs > 0) {
+                return mgs;
+            }
         }
         return 0;
     }
@@ -531,6 +569,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
 
         if ("miaogousi".equals(ownershipId)) {
@@ -550,6 +592,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
         if ("rocket".equals(ownershipId)) {
             int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
@@ -568,9 +614,39 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (yufu > 0) {
                 return yufu;
             }
+            int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
         }
 
         if ("yufu".equals(ownershipId)) {
+            int yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
+            int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (rocket > 0) {
+                return rocket;
+            }
+            int ruixuan = supplyChainMapper.updateRuiXuanOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (ruixuan > 0) {
+                return ruixuan;
+            }
+            int mgs = supplyChainMapper.updateMgsOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (mgs > 0) {
+                return mgs;
+            }
+            int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
+        }
+        if ("yuxiu".equals(ownershipId)) {
+            int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yuxiu > 0) {
+                return yuxiu;
+            }
             int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
             if (rocket > 0) {
                 return rocket;
@@ -617,24 +693,30 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         for (KuaishouAccessToken accessToken : tokens) {
             getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> mgsTokens = accessTokenService.getMgsTokenInfos();
         for (KuaishouAccessToken accessToken : mgsTokens) {
             getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
 
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
         for (KuaishouAccessToken accessToken : rocketTokens) {
             getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
 
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
         for (KuaishouAccessToken accessToken : yufuTokens) {
             getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
 
+        Thread.sleep(30000);
+        List<KuaishouAccessToken> yuxiuTokens = accessTokenService.getYuxiuTokenInfos();
+        for (KuaishouAccessToken accessToken : yuxiuTokens) {
+            getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
+        }
+
     }
 
     private void getInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
@@ -642,6 +724,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
         List<Long> yufuList = new ArrayList<>();
+        List<Long> yuxiuList = new ArrayList<>();
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
         if (Check.isNull(signSecret) || Check.isNull(appKey)) {
@@ -707,6 +790,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                             if ("yufu".equals(ownership)) {
                                 yufuList.add(info.getLong("oid"));
                             }
+                            if ("yuxiu".equals(ownership)) {
+                                yuxiuList.add(info.getLong("oid"));
+                            }
                         }
                     }
 
@@ -733,6 +819,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(yufuList)) {
             supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
         }
+        if (!Check.isNull(yuxiuList)) {
+            supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
+        }
         if (!"nomore".equals(pcursor)) {
             getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
@@ -743,6 +832,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
         List<Long> yufuList = new ArrayList<>();
+        List<Long> yuxiuList = new ArrayList<>();
 
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
@@ -808,6 +898,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                         if ("yufu".equals(ownership)) {
                             yufuList.add(info.getLong("oid"));
                         }
+                        if ("yuxiu".equals(ownership)) {
+                            yuxiuList.add(info.getLong("oid"));
+                        }
                     }
                 }
             }
@@ -828,10 +921,12 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(rocketList)) {
             supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
         }
-
         if (!Check.isNull(yufuList)) {
             supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
         }
+        if (!Check.isNull(yuxiuList)) {
+            supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
+        }
         if (!"nomore".equals(pcursor)) {
             getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
@@ -842,6 +937,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
         List<Long> yufuList = new ArrayList<>();
+        List<Long> yuxiuList = new ArrayList<>();
 
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
@@ -906,6 +1002,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                         if ("yufu".equals(ownership)) {
                             yufuList.add(info.getLong("oid"));
                         }
+                        if ("yuxiu".equals(ownership)) {
+                            yuxiuList.add(info.getLong("oid"));
+                        }
                     }
                 }
             }
@@ -928,6 +1027,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(yufuList)) {
             supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
         }
+        if (!Check.isNull(yuxiuList)) {
+            supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
+        }
         if (!"nomore".equals(pcursor)) {
             getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
@@ -939,6 +1041,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
         List<Long> yufuList = new ArrayList<>();
+        List<Long> yuxiuList = new ArrayList<>();
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
         if (Check.isNull(signSecret) || Check.isNull(appKey)) {
@@ -1002,6 +1105,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                         if ("yufu".equals(ownership)) {
                             yufuList.add(info.getLong("oid"));
                         }
+                        if ("yuxiu".equals(ownership)) {
+                            yuxiuList.add(info.getLong("oid"));
+                        }
                     }
                 }
             }
@@ -1009,7 +1115,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             log.error("===yufu查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
             log.error("yufu游标:{},执行次数:{}", pcursor, counts);
             if (counts <= 3) {
-                getRocketInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
+                getYufuInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
             }
         }
         if (!Check.isNull(ruixuanList)) {
@@ -1024,11 +1130,116 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(yufuList)) {
             supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
         }
+        if (!Check.isNull(yuxiuList)) {
+            supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
+        }
         if (!"nomore".equals(pcursor)) {
             getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
     }
 
+    private void getYuxiuInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
+        List<Long> ruixuanList = new ArrayList<>();
+        List<Long> mgsList = new ArrayList<>();
+        List<Long> rocketList = new ArrayList<>();
+        List<Long> yufuList = new ArrayList<>();
+        List<Long> yuxiuList = new ArrayList<>();
+        String appKey = accessToken.getAppKey();
+        String signSecret = accessToken.getSignSecret();
+        if (Check.isNull(signSecret) || Check.isNull(appKey)) {
+            return;
+        }
+        AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url, appKey, signSecret);
+        OpenDistributionCpsLeaderOrderCursorListRequest request = new OpenDistributionCpsLeaderOrderCursorListRequest();
+        request.setAccessToken(accessToken.getAccessToken());
+        request.setApiMethodVersion(1L);
+
+        //排序类型 [1:按指定查询类型降序] [2:按指定查询类型升序]
+        request.setSortType(1);
+        //查询类型 [1:按分销订单创建时间查询] [2:按分销订单更新时间查询][4:按订单实际创建时间查询]
+        request.setQueryType(2);
+        //分销订单状态 [0:全部订单] [30:已付款] [50:已收货] [60:已结算] [80:已失效]
+        request.setCpsOrderStatus(0);
+        request.setDistributorId(0l);
+        request.setBeginTime(beginTime);
+        request.setEndTime(endTime);
+        request.setPcursor(pcursor);
+        request.setPageize(100);
+        request.setFundType(1);
+
+        OpenDistributionCpsLeaderOrderCursorListResponse response = null;
+        try {
+            response = client.execute(request);
+        } catch (KsMerchantApiException e) {
+            e.printStackTrace();
+        }
+        JSONObject obj = JSONObject.parseObject(GsonUtils.toJSON(response));
+        String code = obj.getString("code");
+        if ("1".equals(code)) {
+            JSONObject data = obj.getJSONObject("data");
+            pcursor = data.getString("pcursor");
+            JSONArray orderView = data.getJSONArray("orderView");
+            for (int i = 0; i < orderView.size(); i++) {
+                JSONObject info = orderView.getJSONObject(i);
+                Integer sendStatus = info.getInteger("sendStatus");
+                if (Check.isNotNull(sendStatus) && sendStatus == 1) {
+                    JSONArray cpsOrderProductView = info.getJSONArray("cpsOrderProductView");
+                    JSONObject itemJson = cpsOrderProductView.getJSONObject(0);
+                    Long itemId = itemJson.getLong("itemId");
+                    Criteria criteria = new Criteria();
+                    criteria = Criteria.where("_id").is(itemId);
+                    Query query = new Query(criteria);
+                    ItemCheck itemCheck = mongoTemplate.findOne(query, ItemCheck.class);
+                    if (Check.isNull(itemCheck)) {
+                        yuxiuList.add(info.getLong("oid"));
+                    }
+                    if (!Check.isNull(itemCheck)) {
+                        String ownership = itemCheck.getOwnership();
+                        if ("ruixuan".equals(ownership)) {
+                            ruixuanList.add(info.getLong("oid"));
+                        }
+                        if ("miaogousi".equals(ownership)) {
+                            mgsList.add(info.getLong("oid"));
+                        }
+                        if ("rocket".equals(ownership)) {
+                            rocketList.add(info.getLong("oid"));
+                        }
+                        if ("yufu".equals(ownership)) {
+                            yufuList.add(info.getLong("oid"));
+                        }
+                        if ("yuxiu".equals(ownership)) {
+                            yuxiuList.add(info.getLong("oid"));
+                        }
+                    }
+                }
+            }
+        } else {
+            log.error("===yuxiu查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
+            log.error("yuxiu游标:{},执行次数:{}", pcursor, counts);
+            if (counts <= 3) {
+                getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
+            }
+        }
+        if (!Check.isNull(yuxiuList)) {
+            supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
+        }
+        if (!Check.isNull(ruixuanList)) {
+            supplyChainMapper.updateKuaishouSupplyChain(ruixuanList);
+        }
+        if (!Check.isNull(mgsList)) {
+            supplyChainMapper.updateMgsKuaishouSupplyChain(mgsList);
+        }
+        if (!Check.isNull(rocketList)) {
+            supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
+        }
+        if (!Check.isNull(yufuList)) {
+            supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
+        }
+        if (!"nomore".equals(pcursor)) {
+            getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
+        }
+    }
+
     private KuaishouSupplyChain organizeData(JSONObject jsonObject, Map<Long, Long> itemMap) {
         KuaishouSupplyChain supplyChain = new KuaishouSupplyChain();
         supplyChain.setOid(jsonObject.getLong("oid"));
@@ -1089,21 +1300,27 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         for (KuaishouAccessToken mgsToken : mgsTokens) {
             getMgsInfoKuaishouActivityInfo(mgsToken, url);
         }
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
         for (KuaishouAccessToken token : rocketTokens) {
             getRocketInfoKuaishouActivityInfo(token, url);
         }
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> tokens = accessTokenService.getTokenInfos();
         for (KuaishouAccessToken accessToken : tokens) {
             getInfoKuaishouActivityInfo(accessToken, url);
         }
-        Thread.sleep(60000);
+        Thread.sleep(30000);
         List<KuaishouAccessToken> yufutokens = accessTokenService.getYufuTokenInfos();
         for (KuaishouAccessToken accessToken : yufutokens) {
             getYufuInfoKuaishouActivityInfo(accessToken, url);
         }
+
+        Thread.sleep(30000);
+        List<KuaishouAccessToken> yuxiutokens = accessTokenService.getYuxiuTokenInfos();
+        for (KuaishouAccessToken accessToken : yuxiutokens) {
+            getYuxiuInfoKuaishouActivityInfo(accessToken, url);
+        }
     }
 
     @Override
@@ -1144,6 +1361,15 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             }
         }
 
+        Thread.sleep(30000);
+        List<Long> yuxiuActivityIds = supplyChainMapper.getYuxiuKuaishouActivityInfoList();
+        List<KuaishouAccessToken> yuxiutokens = accessTokenService.getYuxiuTokenInfos();
+        for (KuaishouAccessToken accessToken : yuxiutokens) {
+            for (Long activityId : yuxiuActivityIds) {
+                getKuaishouActivityOpenItemList(accessToken, url, activityId, 1, "yuxiu");
+            }
+        }
+
     }
 
     @Override
@@ -1320,6 +1546,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                     supplyChainMapper.replaceRocketKuaiShouActivityOpenItemList(list);
                 } else if ("yufu".equals(dbtype)) {
                     supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
+                } else if ("yuxiu".equals(dbtype)) {
+                    supplyChainMapper.replaceYuxiuKuaiShouActivityOpenItemList(list);
                 }
             }
 
@@ -1384,6 +1612,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                     for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
                         supplyChainMapper.updateYufuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
                     }
+                } else if ("yuxiu".equals(dbtype)) {
+                    for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
+                        supplyChainMapper.updateYuxiuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
+                    }
                 }
             }
         } else {
@@ -1534,5 +1766,46 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             supplyChainMapper.replaceYufuKuaishouActivityInfo(list);
         }
     }
+
+    private void getYuxiuInfoKuaishouActivityInfo(KuaishouAccessToken accessToken, String url) {
+        List<KuaiShouActivityInfo> list = new ArrayList<>();
+        String appKey = accessToken.getAppKey();
+        String signSecret = accessToken.getSignSecret();
+        if (Check.isNull(signSecret) || Check.isNull(appKey)) {
+            return;
+        }
+        AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url, appKey, signSecret);
+        OpenDistributionInvestmentActivityOpenListRequest request = new OpenDistributionInvestmentActivityOpenListRequest();
+
+        request.setAccessToken(accessToken.getAccessToken());
+        request.setApiMethodVersion(1L);
+
+        //每页活动数量
+        request.setLimit(5000);
+        OpenDistributionInvestmentActivityOpenListResponse response = null;
+        try {
+            response = client.execute(request);
+        } catch (KsMerchantApiException e) {
+            e.printStackTrace();
+        }
+        JSONObject obj = JSONObject.parseObject(GsonUtils.toJSON(response));
+        String code = obj.getString("code");
+        if ("1".equals(code)) {
+            JSONObject data = obj.getJSONObject("data");
+            JSONArray result = data.getJSONArray("result");
+            for (int i = 0; i < result.size(); i++) {
+                JSONObject info = result.getJSONObject(i);
+                KuaiShouActivityInfo activityInfo = organizeKuaishouActivityInfo(info);
+                list.add(activityInfo);
+            }
+        } else {
+            log.error("===Yuxiu团长查询招商活动列表(open.distribution.investment.activity.open.list)失败,信息:{}", obj.getString("msg"));
+            return;
+        }
+
+        if (Check.isNotNull(list) && list.size() > 0) {
+            supplyChainMapper.replaceYuxiuKuaishouActivityInfo(list);
+        }
+    }
 }
 

+ 5 - 0
ruixuan-live/src/main/resources/mapper/isc/AccessTokenMapper.xml

@@ -52,6 +52,11 @@
         from yufu.kuaishou_access_token
     </select>
 
+    <select id="getYuxiuTokenInfos" resultType="com.ruixuan.isc.entity.KuaishouAccessToken">
+        select *
+        from yuxiu.kuaishou_access_token
+    </select>
+
     <select id="getRocketTokenInfos" resultType="com.ruixuan.isc.entity.KuaishouAccessToken">
         select *
         from rocket.kuaishou_access_token

+ 119 - 1
ruixuan-live/src/main/resources/mapper/isc/JiaoYangCallbackMapper.xml

@@ -274,8 +274,11 @@
               select item_id as 'itemId', 'rocket' as 'ownershipId'
               from rocket.kuaishou_item_list
               union all
-              select item_id as 'itemId', 'rocket' as 'ownershipId'
+              select item_id as 'itemId', 'yufu' as 'ownershipId'
               from yufu.kuaishou_item_list
+              union all
+              select item_id as 'itemId', 'yuxiu' as 'ownershipId'
+              from yuxiu.kuaishou_item_list
              ) t
         group by t.itemId
     </select>
@@ -802,6 +805,103 @@
         </trim>
 
     </insert>
+
+    <insert id="insertYuxiuItem" parameterType="com.ruixuan.isc.entity.KuaishouItemList">
+        insert into yuxiu.kuaishou_item_list
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="itemId != null">item_id,</if>
+            <if test="mediaId != null">media_id,</if>
+            <if test="itemTitle != null">item_title,</if>
+            <if test="itemPrice != null">item_price,</if>
+            <if test="itemDesc != null">item_desc,</if>
+            <if test="zkFinalPrice != null">zk_final_price,</if>
+            <if test="itemImgUrl != null">item_img_url,</if>
+            <if test="itemDescUrls != null">item_desc_urls,</if>
+            <if test="shopStar != null">shop_star,</if>
+            <if test="mallLogisticsScore != null">mall_logistics_score,</if>
+            <if test="activityItemStatus != null">activity_item_status,</if>
+            <if test="shopScore != null">shop_score,</if>
+            <if test="categoryId != null">category_id,</if>
+            <if test="categoryName != null">category_name,</if>
+            <if test="itemGalleryUrls != null">item_gallery_urls,</if>
+            <if test="identity != null">identity,</if>
+            <if test="activityId != null">activity_id,</if>
+            <if test="shopTitle != null">shop_title,</if>
+            <if test="commissionRate != null">commission_rate,</if>
+            <if test="mallServiceScore != null">mall_service_score,</if>
+            <if test="mallQualityScore != null">mall_quality_score,</if>
+            <if test="skuList != null">sku_list,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="examineId != null">examine_id,</if>
+            <if test="examineName != null">examine_name,</if>
+            <if test="examineStatus != null">examine_status,</if>
+            <if test="refuseDetail != null">refuse_detail,</if>
+            <if test="postArea != null">post_area,</if>
+            <if test="noPostArea != null">no_post_area,</if>
+            <if test="regimentalPromotionRate != null">regimental_promotion_rate,</if>
+            <if test="regimentalPromotion != null">regimental_promotion,</if>
+            <if test="sampleCount != null">sample_count,</if>
+            <if test="sampleRequirement != null">sample_requirement,</if>
+            <if test="deliveryRate != null">delivery_rate,</if>
+            <if test="partnerRecommendText != null">partner_recommend_text,</if>
+            <if test="detailUrl != null">detail_url,</if>
+            <if test="samplesReceived != null">samples_received,</if>
+            <if test="samplesPeoples != null">samples_peoples,</if>
+            <if test="relateId != null">relate_id,</if>
+            <if test="ruleId != null">rule_id,</if>
+            <if test="isPresale != null">is_presale,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="itemId != null">#{itemId},</if>
+            <if test="mediaId != null">#{mediaId},</if>
+            <if test="itemTitle != null">#{itemTitle},</if>
+            <if test="itemPrice != null">#{itemPrice},</if>
+            <if test="itemDesc != null">#{itemDesc},</if>
+            <if test="zkFinalPrice != null">#{zkFinalPrice},</if>
+            <if test="itemImgUrl != null">#{itemImgUrl},</if>
+            <if test="itemDescUrls != null">#{itemDescUrls},</if>
+            <if test="shopStar != null">#{shopStar},</if>
+            <if test="mallLogisticsScore != null">#{mallLogisticsScore},</if>
+            <if test="activityItemStatus != null">#{activityItemStatus},</if>
+            <if test="shopScore != null">#{shopScore},</if>
+            <if test="categoryId != null">#{categoryId},</if>
+            <if test="categoryName != null">#{categoryName},</if>
+            <if test="itemGalleryUrls != null">#{itemGalleryUrls},</if>
+            <if test="identity != null">#{identity},</if>
+            <if test="activityId != null">#{activityId},</if>
+            <if test="shopTitle != null">#{shopTitle},</if>
+            <if test="commissionRate != null">#{commissionRate},</if>
+            <if test="mallServiceScore != null">#{mallServiceScore},</if>
+            <if test="mallQualityScore != null">#{mallQualityScore},</if>
+            <if test="skuList != null">#{skuList},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="examineId != null">#{examineId},</if>
+            <if test="examineName != null">#{examineName},</if>
+            <if test="examineStatus != null">#{examineStatus},</if>
+            <if test="refuseDetail != null">#{refuseDetail},</if>
+            <if test="postArea != null">#{postArea},</if>
+            <if test="noPostArea != null">#{noPostArea},</if>
+            <if test="regimentalPromotionRate != null">#{regimentalPromotionRate},</if>
+            <if test="regimentalPromotion != null">#{regimentalPromotion},</if>
+            <if test="sampleCount != null">#{sampleCount},</if>
+            <if test="sampleRequirement != null">#{sampleRequirement},</if>
+            <if test="deliveryRate != null">#{deliveryRate},</if>
+            <if test="partnerRecommendText != null">#{partnerRecommendText},</if>
+            <if test="detailUrl != null">#{detailUrl},</if>
+            <if test="samplesReceived != null">#{samplesReceived},</if>
+            <if test="samplesPeoples != null">#{samplesPeoples},</if>
+            <if test="relateId != null">#{relateId},</if>
+            <if test="ruleId != null">#{ruleId},</if>
+            <if test="isPresale != null">#{isPresale},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+
+    </insert>
     <insert id="insertItemCheck">
         replace
         into ruixuan.kuaishou_item_check(item_id,ownership_id) values (
@@ -862,6 +962,24 @@
         </foreach>
     </insert>
 
+    <insert id="batchYuxiuCategory">
+        replace into yuxiu.kuaishou_item_category(
+        category_id,
+        category_name,
+        parent_id,
+        category_sort
+        )
+        values
+        <foreach collection="adds" item="add" separator=",">
+            (
+            #{add.categoryId},
+            #{add.categoryName},
+            #{add.parentId},
+            #{add.categorySort}
+            )
+        </foreach>
+    </insert>
+
 
     <update id="updateKuaishouItemList" parameterType="com.ruixuan.isc.entity.KuaishouItemList">
         update kuaishou_item_list

+ 59 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -879,6 +879,33 @@
           AND media_id = 2
     </select>
 
+    <select id="getYuxiuFailInfo" resultType="com.ruixuan.isc.entity.JYKuaishouPromoter">
+        select id,
+               media_id,
+               user_id,
+               user_name,
+               promoter_id,
+               promoter_nick_name,
+               `state`,
+               province,
+               commission_requirement,
+               category_requirement,
+               promoter_url,
+               phone,
+               consignee,
+               promoter_address,
+               total_sale,
+               fans_number,
+               avg_video_sales,
+               video_sales,
+               create_time,
+               update_time
+        from yuxiu.kuaishou_promoter
+        where (promoter_nick_name = '' or promoter_nick_name is null)
+          AND state = 1
+          AND media_id = 2
+    </select>
+
 
     <update id="updateYufuKuaishouPromoterByPromoterId" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
         update yufu.kuaishou_promoter
@@ -912,6 +939,38 @@
     </update>
 
 
+    <update id="updateYuxiuKuaishouPromoterByPromoterId" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
+        update yuxiu.kuaishou_promoter
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="mediaId != null">media_id = #{mediaId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="promoterId != null">promoter_id = #{promoterId},</if>
+            <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
+            <if test="totalSale != null">total_sale = #{totalSale},</if>
+            <if test="fansNumber != null">fans_number = #{fansNumber},</if>
+            <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="consignee != null">consignee = #{consignee},</if>
+            <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="commissionRequirement != null">commission_requirement = #{commissionRequirement},</if>
+            <if test="categoryRequirement != null">category_requirement = #{categoryRequirement},</if>
+            <if test="avgVideoSales != null">avg_video_sales = #{avgVideoSales},</if>
+            <if test="videoSales != null">video_sales = #{videoSales},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="followerIncr != null">follower_incr = #{followerIncr},</if>
+            <if test="liveCount30 != null">live_count_30 = #{liveCount30},</if>
+            <if test="awemeAvgDiggCount30 != null">aweme_avg_digg_count_30 = #{awemeAvgDiggCount30},</if>
+            <if test="awemeDiggFollowerRation != null">aweme_digg_follower_ration = #{awemeDiggFollowerRation},</if>
+            <if test="liveAverageUser30 != null">live_average_user_30 = #{liveAverageUser30},</if>
+        </trim>
+        where promoter_id = #{promoterId}
+    </update>
+
+
     <delete id="deleteKuaishouPromoterByIds" parameterType="String">
         delete from kuaishou_promoter where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">

+ 98 - 0
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -3049,6 +3049,36 @@
         </foreach>
     </insert>
 
+    <insert id="replaceYuxiuKuaishouActivityInfo">
+        replace into yuxiu.kuaishou_activity_info(
+        activity_id,
+        regimental_id,
+        activity_title,
+        activity_type,
+        activity_begin_time,
+        activity_end_time,
+        activity_status,
+        apply_item_count,
+        wait_audit_item_count,
+        audit_pass_item_count
+        )
+        values
+        <foreach collection="list" item="add" separator=",">
+            (
+            #{add.activityId},
+            #{add.regimentalId},
+            #{add.activityTitle},
+            #{add.activityType},
+            #{add.activityBeginTime},
+            #{add.activityEndTime},
+            #{add.activityStatus},
+            #{add.applyItemCount},
+            #{add.waitAuditItemCount},
+            #{add.auditPassItemCount}
+            )
+        </foreach>
+    </insert>
+
     <update id="updateKuaishouSupplyChain">
         update ruixuan.kuaishou_supply_chain set send_status = 1
         where oid in
@@ -3084,6 +3114,16 @@
             #{id}
         </foreach>
     </update>
+
+    <update id="updateYuxiuKuaishouSupplyChain">
+        update yuxiu.kuaishou_supply_chain set send_status = 1
+        where oid in
+        <foreach collection="list" item="id" separator=","
+                 open="(" close=")">
+            #{id}
+        </foreach>
+    </update>
+
     <update id="updateRuiXuanOrderRegimentalSettleAmount">
         UPDATE ruixuan.kuaishou_supply_chain
         SET order_status                   = #{cpsOrderStatus},
@@ -3110,6 +3150,13 @@
             total_regimental_settle_amount = regimental_promotion_amount
         WHERE oid = #{oid}
     </update>
+
+    <update id="updateYuxiuOrderRegimentalSettleAmount">
+        UPDATE yuxiu.kuaishou_supply_chain
+        SET order_status                   = #{cpsOrderStatus},
+            total_regimental_settle_amount = regimental_promotion_amount
+        WHERE oid = #{oid}
+    </update>
     <update id="updateRuixuanOrder">
         UPDATE ruixuan.kuaishou_supply_chain
         SET order_status = #{cpsOrderStatus}
@@ -3133,6 +3180,12 @@
         WHERE oid = #{oid}
     </update>
 
+    <update id="updateYuxiuOrder">
+        UPDATE yuxiu.kuaishou_supply_chain
+        SET order_status = #{cpsOrderStatus}
+        WHERE oid = #{oid}
+    </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
@@ -3565,6 +3618,31 @@
     </insert>
 
 
+    <insert id="replaceYuxiuKuaiShouActivityOpenItemList">
+        replace into yuxiu.kuaishou_activity_open_item_list(
+        item_id,
+        item_category_name,
+        item_price,
+        pre_activity_id,
+        item_leaf_category_id,
+        item_commission_rate,
+        investment_promotion_rate
+        )
+        values
+        <foreach collection="list" item="li" separator=",">
+            (
+            #{li.itemId},
+            #{li.itemCategoryName},
+            #{li.itemPrice},
+            #{li.preActivityId},
+            #{li.itemLeafCategoryId},
+            #{li.itemCommissionRate},
+            #{li.investmentPromotionRate}
+            )
+        </foreach>
+    </insert>
+
+
     <select id="getKuaishouActivityInfoList" resultType="Long">
         SELECT DISTINCT activity_id
         FROM kuaishou_activity_info
@@ -3593,6 +3671,13 @@
            OR activity_status = 3
     </select>
 
+    <select id="getYuxiuKuaishouActivityInfoList" resultType="Long">
+        SELECT DISTINCT activity_id
+        FROM yuxiu.kuaishou_activity_info
+        WHERE activity_status = 2
+           OR activity_status = 3
+    </select>
+
     <select id="getPromoterId" resultType="com.alibaba.fastjson.JSONObject" parameterType="java.lang.Long">
         SELECT tag, proportion
         FROM promoter_tag
@@ -3789,4 +3874,17 @@
         where item_id = #{itemId}
     </update>
 
+    <update id="updateYuxiuKuaiShouActivityOpenItemList">
+        UPDATE yuxiu.kuaishou_activity_open_item_list
+        SET shop_star            = #{shopStar},
+            mall_logistics_score = #{mallLogisticsScore},
+            shop_score           = #{shopScore},
+            mall_service_score   = #{mallServiceScore},
+            mall_quality_score   = #{mallQualityScore},
+            base_order_status    = #{baseOrderStatus},
+            ccr_value            = #{ccrValue},
+            store_score          = #{storeScore}
+        where item_id = #{itemId}
+    </update>
+
 </mapper>