Browse Source

添加YUFU库代码,初版

zhaoxian 10 months ago
parent
commit
d18810d457

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

@@ -17,5 +17,7 @@ public interface AccessTokenMapper {
 
     List<KuaishouAccessToken> getMgsTokenInfos();
 
+    List<KuaishouAccessToken> getYufuTokenInfos();
+
     List<KuaishouAccessToken> getRocketTokenInfos();
 }

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

@@ -79,6 +79,8 @@ public interface KuaishouItemListMapper {
 
     void insertRocketItem(KuaishouItemList kuaishouItemList);
 
+    void insertYufuItem(KuaishouItemList kuaishouItemList);
+
     void insertItemCheck(@Param("itemId") Long itemId, @Param("targetOwnershipId") String targetOwnershipId);
 
     String getItemOwnership(@Param("itemId") Long itemId);
@@ -90,5 +92,7 @@ public interface KuaishouItemListMapper {
     void batchMgsCategory(@Param("adds") List<KuaishouItemCategory> adds);
 
     void batchRocketCategory(@Param("adds") List<KuaishouItemCategory> adds);
+
+    void batchYufuCategory(@Param("adds") List<KuaishouItemCategory> adds);
 }
 

+ 6 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -27,8 +27,8 @@ public interface KuaishouPromoterMapper {
                                                              @Param("mediaId") String mediaId,
                                                              @Param("parameter") String parameter, @Param("orderBy") String orderBy,
                                                              @Param("bdUserId") Long bdUserId,
-                                                             @Param("searchPhone") Integer  searchPhone
-                                                             );
+                                                             @Param("searchPhone") Integer searchPhone
+    );
 
     public List<JYKuaishouPromoter> selectKuaishouPromoterList3(@Param("userList") List<Long> userList, @Param("promoterId") String promoterId,
                                                                 @Param("promoterNickName") String promoterNickName,
@@ -145,4 +145,8 @@ public interface KuaishouPromoterMapper {
 
     void updateRocketKuaishouPromoterByPromoterId(KuaishouPromoter kuaishouPromoter);
 
+    List<JYKuaishouPromoter> getYufuFailInfo();
+
+    void updateYufuKuaishouPromoterByPromoterId(KuaishouPromoter kuaishouPromoter);
+
 }

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

@@ -162,10 +162,14 @@ public interface SupplyChainMapper {
 
     void replaceRocketKuaishouActivityInfo(@Param("list") List<KuaiShouActivityInfo> list);
 
+    void replaceYufuKuaishouActivityInfo(@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);
+
     List<JSONObject> getBytedanceOrderHourDataList(@Param("date") Long date);
 
     List<JSONObject> getKuaishouOrderHourDataList(@Param("date") String date);
@@ -178,12 +182,16 @@ public interface SupplyChainMapper {
 
     List<Long> getRocketKuaishouActivityInfoList();
 
+    List<Long> getYufuKuaishouActivityInfoList();
+
     void replaceKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
     void replaceMgsKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
     void replaceRocketKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
+    void replaceYufuKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
+
     List<JSONObject> getKsChannelGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") String date);
 
     List<JSONObject> getKsCourtshipGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") String date);
@@ -200,17 +208,23 @@ public interface SupplyChainMapper {
 
     int updateRocketOrderRegimentalSettleAmount(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
 
+    int updateYufuOrderRegimentalSettleAmount(@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);
 
     int updateRocketOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
 
+    int updateYufuOrder(@Param("oid") Long oid, @Param("cpsOrderStatus") Integer cpsOrderStatus);
+
     void updateKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
 
     void updateMgsKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
 
     void updateRocketKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
 
+    void updateYufuKuaiShouActivityOpenItemList(KuaiShouActivityOpenItemList list);
+
 
 }

+ 3 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/IAccessTokenService.java

@@ -10,11 +10,13 @@ public interface IAccessTokenService {
 
     void refreshAccessToken();
 
-     void refreshByteDanceAccessToken();
+    void refreshByteDanceAccessToken();
 
     List<KuaishouAccessToken> getTokenInfos();
 
     List<KuaishouAccessToken> getMgsTokenInfos();
 
+    List<KuaishouAccessToken> getYufuTokenInfos();
+
     List<KuaishouAccessToken> getRocketTokenInfos();
 }

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

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

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

@@ -15,7 +15,6 @@ import com.kuaishou.merchant.open.api.response.distribution.OpenDistributionInve
 import com.kuaishou.merchant.open.api.response.distribution.OpenDistributionInvestmentActivityOpenItemListResponse;
 import com.kuaishou.merchant.open.api.response.distribution.OpenDistributionPublicCategoryListResponse;
 import com.ruixuan.common.utils.Check;
-import com.ruixuan.common.utils.KsHttpUtils;
 import com.ruixuan.isc.constants.KuaiShouConstants;
 import com.ruixuan.isc.entity.JYOrderItemList;
 import com.ruixuan.isc.entity.KuaishouAccessToken;
@@ -35,9 +34,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import static com.kuaishou.merchant.open.api.common.Constants.Sign.ACCESS_TOKEN;
-import static com.ruixuan.isc.constants.KuaiShouConstants.APP_KEY;
-
 
 /**
  * 【请填写功能名称】Service业务层处理
@@ -237,6 +233,9 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         if (targetOwnershipId.equals("rocket")) {
             kuaishouItemListMapper.insertRocketItem(kuaishouItemList);
         }
+        if (targetOwnershipId.equals("yufu")) {
+            kuaishouItemListMapper.insertYufuItem(kuaishouItemList);
+        }
         JSONObject mongoVo = new JSONObject();
         mongoVo.put("_id", kuaishouItemList.getItemId());
         mongoVo.put("ownership", targetOwnershipId);
@@ -361,6 +360,7 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         kuaishouItemListMapper.batchCategory(adds);
         kuaishouItemListMapper.batchMgsCategory(adds);
         kuaishouItemListMapper.batchRocketCategory(adds);
+        kuaishouItemListMapper.batchYufuCategory(adds);
 
         return 0;
     }

+ 75 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -554,6 +554,58 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         }
     }
 
+
+    /**
+     * 同步更新数据
+     */
+    private void editYufuPromoter(Long id, String mediaId, String promoterId, boolean flag) {
+        try {
+            if (flag) {
+                /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
+                String key = DateUtils.getDate() + "yufu_" + 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("--------------------Yufu达人更新\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.updateYufuKuaishouPromoterByPromoterId(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();
@@ -608,6 +660,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         promoters.add(supplementInfo3());
         promoters.add(miaogousiInfo());
         promoters.add(rocketInfo());
+        promoters.add(yufuInfo());
         return Result.success("共计" + list.size() + "条,数据补充中...", promoters);
     }
 
@@ -627,7 +680,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         thread.start();
         List<String> promoters = new ArrayList<>();
         list.forEach(kuaishouPromoter -> promoters.add(kuaishouPromoter.getPromoterId()));
-        return "-------------骄阳共计" + list.size() + "条,达人IDS: " + promoters.toString();
+        return "\n-------------骄阳共计" + list.size() + "条,达人id: " + promoters.toString();
     }
 
     //miaogousi
@@ -646,7 +699,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         thread.start();
         List<String> promoters = new ArrayList<>();
         list.forEach(kuaishouPromoter -> promoters.add(kuaishouPromoter.getPromoterId()));
-        return "-------------miaogousi共计" + list.size() + "条,达人IDS: " + promoters.toString();
+        return "\n-------------miaogousi共计" + list.size() + "条,达人id: " + promoters.toString();
     }
 
     //rocket
@@ -665,7 +718,26 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         thread.start();
         List<String> promoters = new ArrayList<>();
         list.forEach(kuaishouPromoter -> promoters.add(kuaishouPromoter.getPromoterId()));
-        return "-------------rocket共计" + list.size() + "条,达人IDS: " + promoters.toString();
+        return "\n-------------rocket共计" + list.size() + "条,达人id: " + promoters.toString();
+    }
+
+    //yufu
+    public String yufuInfo() {
+        List<JYKuaishouPromoter> list = kuaishouPromoterMapper.getYufuFailInfo();
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                try {
+                    list.forEach(kuaishouPromoter -> editYufuPromoter(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 "\n-------------yufu共计" + list.size() + "条,达人id: " + promoters.toString();
     }
 
 

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

@@ -450,6 +450,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (rocket > 0) {
                 return rocket;
             }
+            int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
         if ("miaogousi".equals(ownershipId)) {
             int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
@@ -464,6 +468,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (rocket > 0) {
                 return rocket;
             }
+            int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
         if ("rocket".equals(ownershipId)) {
             int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
@@ -478,6 +486,28 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (mgs > 0) {
                 return mgs;
             }
+            int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
+        }
+        if ("yufu".equals(ownershipId)) {
+            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;
+            }
+            int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
         return 0;
     }
@@ -497,6 +527,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (rocket > 0) {
                 return rocket;
             }
+            int yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
 
         if ("miaogousi".equals(ownershipId)) {
@@ -512,6 +546,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (rocket > 0) {
                 return rocket;
             }
+            int yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
         if ("rocket".equals(ownershipId)) {
             int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
@@ -526,6 +564,29 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             if (mgs > 0) {
                 return mgs;
             }
+            int yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
+        }
+
+        if ("yufu".equals(ownershipId)) {
+            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 yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
+            if (yufu > 0) {
+                return yufu;
+            }
         }
         return 0;
     }
@@ -568,12 +629,19 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
 
+        Thread.sleep(600000);
+        List<KuaishouAccessToken> youziTokens = accessTokenService.getYufuTokenInfos();
+        for (KuaishouAccessToken accessToken : rocketTokens) {
+            getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
+        }
+
     }
 
     private void getInfo(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<>();
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
         if (Check.isNull(signSecret) || Check.isNull(appKey)) {
@@ -635,7 +703,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                             }
                             if ("rocket".equals(ownership)) {
                                 rocketList.add(info.getLong("oid"));
-
+                            }
+                            if ("yufu".equals(ownership)) {
+                                yufuList.add(info.getLong("oid"));
                             }
                         }
                     }
@@ -660,7 +730,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(rocketList)) {
             supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
         }
-
+        if (!Check.isNull(yufuList)) {
+            supplyChainMapper.updateYufuKuaishouSupplyChain(rocketList);
+        }
         if (!"nomore".equals(pcursor)) {
             getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
@@ -670,6 +742,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> ruixuanList = new ArrayList<>();
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
+        List<Long> yufuList = new ArrayList<>();
 
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
@@ -731,7 +804,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                         }
                         if ("rocket".equals(ownership)) {
                             rocketList.add(info.getLong("oid"));
-
+                        }
+                        if ("yufu".equals(ownership)) {
+                            yufuList.add(info.getLong("oid"));
                         }
                     }
                 }
@@ -754,6 +829,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
         }
 
+        if (!Check.isNull(yufuList)) {
+            supplyChainMapper.updateYufuKuaishouSupplyChain(rocketList);
+        }
         if (!"nomore".equals(pcursor)) {
             getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
@@ -763,6 +841,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         List<Long> ruixuanList = new ArrayList<>();
         List<Long> mgsList = new ArrayList<>();
         List<Long> rocketList = new ArrayList<>();
+        List<Long> yufuList = new ArrayList<>();
+
         String appKey = accessToken.getAppKey();
         String signSecret = accessToken.getSignSecret();
         if (Check.isNull(signSecret) || Check.isNull(appKey)) {
@@ -823,6 +903,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                         if ("rocket".equals(ownership)) {
                             rocketList.add(info.getLong("oid"));
                         }
+                        if ("yufu".equals(ownership)) {
+                            yufuList.add(info.getLong("oid"));
+                        }
                     }
                 }
             }
@@ -842,12 +925,110 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         if (!Check.isNull(rocketList)) {
             supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
         }
+        if (!Check.isNull(yufuList)) {
+            supplyChainMapper.updateYufuKuaishouSupplyChain(rocketList);
+        }
         if (!"nomore".equals(pcursor)) {
             getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
         }
     }
 
 
+    private void getYufuInfo(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<>();
+        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)) {
+                        yufuList.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"));
+                        }
+                    }
+                }
+            }
+        } else {
+            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);
+            }
+        }
+        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(rocketList);
+        }
+        if (!"nomore".equals(pcursor)) {
+            getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
+        }
+    }
+
     private KuaishouSupplyChain organizeData(JSONObject jsonObject, Map<Long, Long> itemMap) {
         KuaishouSupplyChain supplyChain = new KuaishouSupplyChain();
         supplyChain.setOid(jsonObject.getLong("oid"));
@@ -918,6 +1099,11 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
         for (KuaishouAccessToken accessToken : tokens) {
             getInfoKuaishouActivityInfo(accessToken, url);
         }
+        Thread.sleep(600000);
+        List<KuaishouAccessToken> yufutokens = accessTokenService.getYufuTokenInfos();
+        for (KuaishouAccessToken accessToken : yufutokens) {
+            getYufuInfoKuaishouActivityInfo(accessToken, url);
+        }
     }
 
     @Override
@@ -949,6 +1135,15 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             }
         }
 
+        Thread.sleep(30000);
+        List<Long> yufuActivityIds = supplyChainMapper.getYufuKuaishouActivityInfoList();
+        List<KuaishouAccessToken> yufutokens = accessTokenService.getYufuTokenInfos();
+        for (KuaishouAccessToken accessToken : yufutokens) {
+            for (Long activityId : yufuActivityIds) {
+                getKuaishouActivityOpenItemList(accessToken, url, activityId, 1, "yufu");
+            }
+        }
+
     }
 
     @Override
@@ -1083,6 +1278,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                     supplyChainMapper.replaceMgsKuaiShouActivityOpenItemList(list);
                 } else if ("rocket".equals(dbtype)) {
                     supplyChainMapper.replaceRocketKuaiShouActivityOpenItemList(list);
+                } else if ("yufu".equals(dbtype)) {
+                    supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
                 }
             }
 
@@ -1132,9 +1329,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             }
             if (Check.isNotNull(list) && list.size() > 0) {
                 if ("ruixuan".equals(dbtype)) {
-                for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
-                    supplyChainMapper.updateKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
-                }
+                    for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
+                        supplyChainMapper.updateKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
+                    }
                 } else if ("miaogousi".equals(dbtype)) {
                     for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
                         supplyChainMapper.updateMgsKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
@@ -1143,9 +1340,11 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
                     for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
                         supplyChainMapper.updateRocketKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
                     }
+                } else if ("yufu".equals(dbtype)) {
+                    for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
+                        supplyChainMapper.updateYufuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
+                    }
                 }
-
-
             }
         } else {
             log.error("===招商活动商品详情接口(open.distribution.investment.activity.item.detail)失败,信息:{}", obj.getString("error_msg"));
@@ -1254,5 +1453,46 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
             supplyChainMapper.replaceRocketKuaishouActivityInfo(list);
         }
     }
+
+    private void getYufuInfoKuaishouActivityInfo(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("===Yufu团长查询招商活动列表(open.distribution.investment.activity.open.list)失败,信息:{}", obj.getString("msg"));
+            return;
+        }
+
+        if (Check.isNotNull(list) && list.size() > 0) {
+            supplyChainMapper.replaceYufuKuaishouActivityInfo(list);
+        }
+    }
 }
 

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

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

+ 125 - 3
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemListMapper.xml

@@ -272,7 +272,11 @@
               from miaogousi.kuaishou_item_list
               union all
               select item_id as 'itemId', 'rocket' as 'ownershipId'
-              from rocket.kuaishou_item_list) t
+              from rocket.kuaishou_item_list
+              union all
+              select item_id as 'itemId', 'rocket' as 'ownershipId'
+              from yufu.kuaishou_item_list
+             ) t
         group by t.itemId
     </select>
     <select id="checkItemData" resultType="java.lang.Integer">
@@ -380,13 +384,17 @@
 
     <insert id="insertItemBindUser">
         replace
-        into ${targetOwnershipId}.kuaishou_item_bind_user(
+        into
+        ${targetOwnershipId}
+        .
+        kuaishou_item_bind_user
+        (
         item_id,
         user_id,
         user_name
         )
         values
-            (
+        (
         #{itemId},
         #{userId},
         #{userName}
@@ -697,6 +705,103 @@
         </trim>
 
     </insert>
+
+    <insert id="insertYufuItem" parameterType="com.ruixuan.isc.entity.KuaishouItemList">
+        insert into yufu.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 (
@@ -739,6 +844,23 @@
             )
         </foreach>
     </insert>
+    <insert id="batchYufuCategory">
+        replace into yufu.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">

+ 74 - 13
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -844,6 +844,66 @@
     </update>
 
 
+    <select id="getYufuFailInfo" 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 yufu.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
+        <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=")">
@@ -961,17 +1021,14 @@
     </select>
     <select id="selectKuaishouRulePromoterById" resultType="com.alibaba.fastjson.JSONObject"
             parameterType="java.lang.Long">
-select promoter_id                as 'promoterId',
-       promoter_nick_name         as 'promoterName',
-       t2.user_id                 as 'userId',
-       group_concat(t1.user_name) as 'userName'
-from kuaishou_promoter t1
-         left join sys_user_role t2 on t1.user_id = t2.user_id
-where promoter_id = #{promoterId}
-  and    media_id = 2
-  and t2.role_id not in (210114, 210115)
-  and t2.user_id not in (270128)
-group by promoter_id
+        select promoter_id as 'promoterId', promoter_nick_name as 'promoterName', t2.user_id as 'userId', group_concat(t1.user_name) as 'userName'
+        from kuaishou_promoter t1
+                 left join sys_user_role t2 on t1.user_id = t2.user_id
+        where promoter_id = #{promoterId}
+          and media_id = 2
+          and t2.role_id not in (210114, 210115)
+          and t2.user_id not in (270128)
+        group by promoter_id
 
     </select>
     <select id="jyExpertMentorList" resultType="com.alibaba.fastjson.JSONObject">
@@ -1012,8 +1069,12 @@ group by promoter_id
         #{promoterId},
         #{ruleId},
         #{ruleName},
-        now(),
-        now()
+        now
+        (
+        ),
+        now
+        (
+        )
         )
 
     </insert>

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

@@ -2821,6 +2821,36 @@
         </foreach>
     </insert>
 
+    <insert id="replaceYufuKuaishouActivityInfo">
+        replace into yufu.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
@@ -2847,6 +2877,15 @@
             #{id}
         </foreach>
     </update>
+
+    <update id="updateYufuKuaishouSupplyChain">
+        update yufu.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},
@@ -2866,6 +2905,13 @@
             total_regimental_settle_amount = regimental_promotion_amount
         where oid = #{oid}
     </update>
+
+    <update id="updateYufuOrderRegimentalSettleAmount">
+        update yufu.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}
@@ -2883,6 +2929,12 @@
         where oid = #{oid}
     </update>
 
+    <update id="updateYufuOrder">
+        update yufu.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
@@ -3103,6 +3155,31 @@
     </insert>
 
 
+    <insert id="replaceYufuKuaiShouActivityOpenItemList">
+        replace into yufu.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
@@ -3123,6 +3200,14 @@
         WHERE activity_status = 2
            OR activity_status = 3
     </select>
+
+    <select id="getYufuKuaishouActivityInfoList" resultType="Long">
+        SELECT DISTINCT activity_id
+        FROM yufu.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
@@ -3163,4 +3248,15 @@
         where item_id = #{itemId}
     </update>
 
+    <update id="updateYufuKuaiShouActivityOpenItemList">
+        update yufu.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}
+        where item_id = #{itemId}
+    </update>
+
 </mapper>