Selaa lähdekoodia

Merge remote-tracking branch 'origin/test' into test

zhaoxian 2 vuotta sitten
vanhempi
commit
db8dda0bac

+ 11 - 19
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -10,12 +10,10 @@ import com.kuaidi100.sdk.request.SubscribeParam;
 import com.kuaidi100.sdk.request.SubscribeParameters;
 import com.kuaidi100.sdk.request.SubscribeReq;
 import com.kuaidi100.sdk.response.SubscribeResp;
-import com.ruixuan.common.annotation.Log;
 import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.domain.entity.SysUser;
 import com.ruixuan.common.core.page.TableDataInfo;
-import com.ruixuan.common.enums.BusinessType;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.data.utils.ExportExcelUtils;
 import com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress;
@@ -33,10 +31,8 @@ import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -44,10 +40,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.xml.transform.Result;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
@@ -216,7 +210,6 @@ public class KuaishouItemCollectSamplesController extends BaseController {
             if (Check.isNull(id)) {
                 throw new Exception("id不能为空");
             }
-
             KuaishouItemCollectSampleLog sampleLog = new KuaishouItemCollectSampleLog();
             sampleLog.setUserId(kuaishouItemCollectSamples.getUserId());
             sampleLog.setUserName(kuaishouItemCollectSamples.getUserName());
@@ -228,6 +221,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
                     String collectSampleDesc = kuaishouItemCollectSamples.getCollectSampleDesc();
                     if (Check.isNull(collectSampleDesc)) {
                         kuaishouItemCollectSamples.setCollectSampleDesc("领样审核拒绝");
+                        kuaishouItemCollectSamplesService.cleanLogs(kuaishouItemCollectSamples.getId(), collectSampleStatus);
                     }
                 }
                 if (collectSampleStatus == 3) {
@@ -238,7 +232,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
                     if (Check.isNull(collectSampleDesc)) {
                         kuaishouItemCollectSamples.setCollectSampleDesc("招商审核作业拒绝,请重新提交");
                     }
-                    kuaishouItemCollectSamplesService.cleanLogs(kuaishouItemCollectSamples.getId(), 6);
+                    kuaishouItemCollectSamplesService.cleanLogs(kuaishouItemCollectSamples.getId(), collectSampleStatus);
                 }
                 if (collectSampleStatus == 7) { // 作业完成
                     kuaishouItemCollectSamples.setCollectSampleDesc("作业已完成");
@@ -298,7 +292,6 @@ public class KuaishouItemCollectSamplesController extends BaseController {
         return returnJson;
     }
 
-
     @GetMapping("/courierNumberInfo")
     public JSONObject courierNumberInfo(String courierNumber) {
         JSONObject returnJson = new JSONObject();
@@ -306,7 +299,8 @@ public class KuaishouItemCollectSamplesController extends BaseController {
             if (Check.isNull(courierNumber)) {
                 throw new Exception("快递单号不能为空");
             }
-            returnJson = kuaishouItemCollectSamplesService.courierNumberInfo(courierNumber);
+            JSONObject data = kuaishouItemCollectSamplesService.courierNumberInfo(courierNumber);
+            returnJson.put("data", data);
             returnJson.put("code", 0);
             returnJson.put("message", "查询成功");
         } catch (Exception e) {
@@ -417,14 +411,11 @@ public class KuaishouItemCollectSamplesController extends BaseController {
     }
 
 
-    /**
-     * 删除【请填写功能名称】
-     */
-    @PreAuthorize("@ss.hasPermi('system:samples:remove')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(kuaishouItemCollectSamplesService.deleteKuaishouItemCollectSamplesByIds(ids));
+
+
+    @DeleteMapping("/remove")
+    public AjaxResult remove( Long id) {
+        return toAjax(kuaishouItemCollectSamplesService.deleteKuaishouItemCollectSamplesById(id));
     }
 
     /**
@@ -451,6 +442,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
                 export.add(date.getString("itemTitle"));
                 export.add(date.getString("promoterId"));
                 export.add(date.getString("promoterNickName"));
+                export.add(date.getString("status"));
                 JSONObject copyJson = kuaishouItemCollectSamplesService.getCopyInfo(date.getLong("promoterId"));
                 export.add(copyJson.getString("fansNumber"));
                 export.add(copyJson.getString("totalSale"));
@@ -462,7 +454,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
                 exportList.add(export);
             }
         }
-        String[] headers = {"id", "商品ID", "商品名称", "达人ID", "达人昵称", "粉丝数", "销售额", "领样数量", "领样规则", "收件人", "收件人手机号码", "收件人地址"};
+        String[] headers = {"id", "商品ID", "商品名称", "达人ID", "达人昵称", "领样状态", "粉丝数", "销售额", "领样数量", "领样规则", "收件人", "收件人手机号码", "收件人地址"};
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();

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

@@ -52,6 +52,27 @@ public class KuaishouItemListController extends BaseController {
     }
 
 
+    @GetMapping("/getActivityIds")
+    @ApiOperation(value = "活动列表")
+    public JSONObject getActivityIds(Long userId) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(userId)) {
+                throw new Exception("请传入用户ID");
+            }
+            List<Long> activityIds = kuaishouItemListService.getActivityIds(userId);
+            returnJson.put("code", 0);
+            returnJson.put("message", "success");
+            returnJson.put("data", activityIds);
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
     @GetMapping("/getItemPreview")
     @ApiOperation(value = "商品详情预览")
     public JSONObject getItemPreview(
@@ -59,9 +80,7 @@ public class KuaishouItemListController extends BaseController {
             @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) Long itemId) {
         JSONObject returnJson = new JSONObject();
         try {
-            if (Check.isNull(activityId)) {
-                throw new Exception("请传入活动ID");
-            }
+
             if (Check.isNull(itemId)) {
                 throw new Exception("请传入商品ID");
             }
@@ -86,8 +105,7 @@ public class KuaishouItemListController extends BaseController {
             @ApiParam("审核状态") @RequestParam(value = "examineStatus", required = false) Long examineStatus,
             @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) Long itemId,
             @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
-            @ApiParam("品类ID") @RequestParam(value = "categoryId", required = false) Long categoryId
-    ) {
+            @ApiParam("品类ID") @RequestParam(value = "categoryId", required = false) Long categoryId) {
         TableDataInfo dataInfo = new TableDataInfo();
         try {
             Map<String, Object> requestMap = new HashMap<>();

+ 22 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemCollectSamples.java

@@ -162,6 +162,10 @@ public class KuaishouItemCollectSamples extends BaseEntity {
     private Long userId;
     @Transient
     private String userName;
+    @Transient
+    private Long validAmount;
+    @Transient
+    private Long validOrderNum;
 
 
     public static long getSerialVersionUID() {
@@ -392,6 +396,22 @@ public class KuaishouItemCollectSamples extends BaseEntity {
         this.userName = userName;
     }
 
+    public Long getValidAmount() {
+        return validAmount;
+    }
+
+    public void setValidAmount(Long validAmount) {
+        this.validAmount = validAmount;
+    }
+
+    public Long getValidOrderNum() {
+        return validOrderNum;
+    }
+
+    public void setValidOrderNum(Long validOrderNum) {
+        this.validOrderNum = validOrderNum;
+    }
+
     @Override
     public String toString() {
         return "KuaishouItemCollectSamples{" +
@@ -423,6 +443,8 @@ public class KuaishouItemCollectSamples extends BaseEntity {
                 ", companyCode='" + companyCode + '\'' +
                 ", userId=" + userId +
                 ", userName='" + userName + '\'' +
+                ", validAmount=" + validAmount +
+                ", validOrderNum=" + validOrderNum +
                 '}';
     }
 }

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

@@ -104,5 +104,7 @@ public interface KuaishouItemCollectSamplesMapper {
     Integer getSampleCountByUserId(@Param("userId") Long userId, @Param("status") Integer status);
 
     JSONObject queryTheNumberOfCompletedJobs(@Param("promoterIds") List<Long> promoterIds, @Param("statDate") String statDate);
+
+    List<JSONObject> selectPromoterInfo(@Param("map") Map<Long, Long> map);
 }
 

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

@@ -17,7 +17,7 @@ import java.util.Map;
  */
 public interface KuaishouItemListMapper {
 
-    List<KuaishouItemList> getItemList( Map<String, Object> requestMap);
+    List<KuaishouItemList> getItemList(Map<String, Object> requestMap);
 
     KuaishouItemList getItemInfoByItemId(Long itemId);
 
@@ -27,16 +27,18 @@ public interface KuaishouItemListMapper {
 
     int deleteKuaishouItemListByItemIds(Long[] itemIds);
 
-    void batchCategory( @Param("adds") List<KuaishouItemCategory> adds);
+    void batchCategory(@Param("adds") List<KuaishouItemCategory> adds);
 
     KuaishouItemCategory getCategoryInfo(@Param("categoryId") Long categoryId);
 
-    void insertItemBindUser(@Param("itemId") Long itemId,@Param("userId") Long userId,@Param("userName") String userName);
+    void insertItemBindUser(@Param("itemId") Long itemId, @Param("userId") Long userId, @Param("userName") String userName);
 
     Long getIdByName(@Param("categoryName") String categoryName);
 
     List<JSONObject> getCategoryIds();
 
-    void updateCount(@Param("itemId") Long itemId,@Param("sampleCount") Integer sampleCount, @Param("userCount") Integer userCount);
+    void updateCount(@Param("itemId") Long itemId, @Param("sampleCount") Integer sampleCount, @Param("userCount") Integer userCount);
+
+    List<Long> getActivityIds(@Param("userId") Long userId);
 }
 

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

@@ -35,5 +35,7 @@ public interface IKuaishouItemListService {
     List<JSONObject> getCategoryIds();
 
     void updateCount(Long itemId, Integer sampleCount, Integer userCount);
+
+    List<Long> getActivityIds(Long userId);
 }
 

+ 24 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -72,7 +72,30 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
      */
     @Override
     public List<KuaishouItemCollectSamples> selectKuaishouItemCollectSamplesList(Map<String, Object> requestMap) {
-        return kuaishouItemCollectSamplesMapper.selectKuaishouItemCollectSamplesList(requestMap);
+        List<KuaishouItemCollectSamples> kuaishouItemCollectSamples = kuaishouItemCollectSamplesMapper.selectKuaishouItemCollectSamplesList(requestMap);
+        Map<Long, JSONObject> dataMap = new HashMap<>();
+        if (!Check.isNull(kuaishouItemCollectSamples)) {
+            Map<Long, Long> map = new HashMap<>();
+            for (KuaishouItemCollectSamples samples : kuaishouItemCollectSamples) {
+                map.put(samples.getPromoterId(), samples.getPromoterId());
+            }
+            List<JSONObject> promoterList = kuaishouItemCollectSamplesMapper.selectPromoterInfo(map);
+            for (int i = 0; i < promoterList.size(); i++) {
+                JSONObject jsonObject = promoterList.get(i);
+                dataMap.put(jsonObject.getLong("promoterId"), jsonObject);
+            }
+        }
+        if (!Check.isNull(kuaishouItemCollectSamples)) {
+            for (KuaishouItemCollectSamples samples : kuaishouItemCollectSamples) {
+                Long promoterId = samples.getPromoterId();
+                JSONObject jsonObject = dataMap.get(promoterId);
+                if(!Check.isNull(jsonObject)){
+                    samples.setValidAmount(jsonObject.getLong("validAmount"));
+                    samples.setValidOrderNum(jsonObject.getLong("validOrderNum"));
+                }
+            }
+        }
+        return kuaishouItemCollectSamples;
     }
 
     /**

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

@@ -5,7 +5,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.kuaishou.merchant.open.api.KsMerchantApiException;
@@ -51,6 +50,8 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
 
     @Override
     public JSONObject getItemDetail(Long activityId, Long itemId, String accessToken) throws Exception {
+        // 调用爬虫信息
+        JSONObject invaliItemDetail = getInvaliItemDetail(activityId, itemId);
         JSONObject returnJson = new JSONObject();
         AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(KuaiShouConstants.KFX_URL, KuaiShouConstants.APP_KEY, KuaiShouConstants.SIGN_SECRET);
         OpenDistributionInvestmentActivityItemDetailRequest request = new OpenDistributionInvestmentActivityItemDetailRequest();
@@ -62,7 +63,6 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         request.setItemId(item);
         OpenDistributionInvestmentActivityItemDetailResponse response = client.execute(request);
         JSONObject json = JSONObject.parseObject(GsonUtils.toJSON(response));
-
         if (Check.isNull(json)) {
             throw new Exception("获取商品信息出错,请重新提交");
         }
@@ -83,12 +83,21 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
                 itemJson.put("categoryId", categoryInfo.getString("categoryId"));
             }
             itemJson.put("detailUrl", "https://app.kwaixiaodian.com/merchant/shop/detail?id=" + itemId);
+            if (!Check.isNull(invaliItemDetail)) {
+                JSONObject invaliJSon = invaliItemDetail.getJSONObject("itemJson");
+                if (!Check.isNull(invaliJSon)) {
+                    itemJson.put("postArea", invaliJSon.getString("postArea"));
+                    itemJson.put("deliveryRate", invaliJSon.getString("deliveryRate"));
+                    itemJson.put("regimentalPromotionRate", invaliJSon.getLong("regimentalPromotionRate"));
+                    itemJson.put("commissionRate", invaliJSon.getLong("commissionRate"));
+                }
+            }
             returnJson.put("judgeStatus", 1);
             returnJson.put("itemJson", itemJson);
             returnJson.put("code", 0);
             returnJson.put("message", "查询成功");
-        } else if (code != 1  ) { // 商品下线
-            returnJson = getInvaliItemDetail(activityId, itemId, accessToken);
+        } else if (code != 1) { // 商品下线
+            return invaliItemDetail;
         } else {
             returnJson.put("code", -1);
             returnJson.put("message", "数据查询失败");
@@ -98,7 +107,7 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
     }
 
 
-    private JSONObject getInvaliItemDetail(Long activityId, Long itemId, String accessToken) throws Exception {
+    private JSONObject getInvaliItemDetail(Long activityId, Long itemId) throws Exception {
         JSONObject returnJson = new JSONObject();
         String cookie = supplyChainMapper.getCookie();
         Map<String, Object> params = new HashMap<>();
@@ -106,7 +115,6 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         params.put("offset", 0);
         params.put("activityId", activityId);
         params.put("itemId", itemId);
-
         Map<String, String> headers = new HashMap<>();
         headers.put("Cookie", cookie);
         String resultStr = KsHttpUtils.KuaiShouttpGetRequest("https://cps.kwaixiaodian.com/distribute/pc/investment/activity/item/list", params, headers);
@@ -120,7 +128,6 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         Integer code = result.getInteger("result");
         if (code != 1) {
             log.info("快分销招商商品数据返回异常:", resultStr);
-            //   sendMessageService.sendMessage("113dee46c7df464da78c07a985e92cd1", "快手供应链cookie失效,请及时更新。媒体返回信息:" + resultStr);
             returnJson.put("code", -1);
             returnJson.put("message", "增加快手商品信息抓取失败,请联系技术人员");
             return returnJson;
@@ -145,22 +152,62 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
                 }
             }
         }
-
-
+        itemJson.put("commissionRate", itemJson.getLong("itemCommissionRate"));
+        itemJson.put("regimentalPromotionRate", itemJson.getLong("investmentPromotionRate"));
+        JSONObject otherInfo = getOtherInfo(itemId, cookie);
+        if (!Check.isNull(otherInfo)) {
+            itemJson.put("postArea", otherInfo.getString("postArea"));
+            itemJson.put("deliveryRate", otherInfo.getString("deliveryRate"));
+            itemJson.put("itemDescUrls", otherInfo.getJSONArray("itemDescUrls"));
+            itemJson.put("itemGalleryUrls", otherInfo.getJSONArray("itemGalleryUrls"));
+        }
         returnJson.put("judgeStatus", 2);
         returnJson.put("itemJson", itemJson);
         returnJson.put("code", 0);
         returnJson.put("message", "查询成功");
-
         return returnJson;
     }
 
 
-    public static void main(String[] args) {
-        String a = "家居生活>厨具/杯具>刀剪菜板>菜刀";
-        String[] split = a.split(">");
-        String b = split[0];
-        System.err.println(b);
+    private JSONObject getOtherInfo(Long itemId, String cookie) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        Map<String, Object> params = new HashMap<>();
+        params.put("itemId", itemId);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Cookie", cookie);
+        String resultStr = KsHttpUtils.KuaiShouttpGetRequest("https://app.kwaixiaodian.com/rest/app/grocery/product/self/detail", params, headers);
+        JSONObject result = JSONObject.parseObject(resultStr);
+        if (!Check.isNull(result)) {
+            JSONObject productDetail = result.getJSONObject("productDetail");
+            if (!Check.isNull(productDetail)) {
+                JSONObject expressTemplate = productDetail.getJSONObject("expressTemplate");
+                if (!Check.isNull(expressTemplate)) {
+                    String sendProvinceName = expressTemplate.getString("sendProvinceName");
+                    String sendCityName = expressTemplate.getString("sendCityName");
+                    if (Check.isNull(sendCityName)) {
+                        returnJson.put("postArea", sendProvinceName);
+                    } else {
+                        returnJson.put("postArea", sendProvinceName + "-" + sendCityName);
+                    }
+                }
+                JSONObject expressInfo = productDetail.getJSONObject("expressInfo");
+                if (!Check.isNull(expressInfo)) {
+                    String deliveryDesc = expressInfo.getString("deliveryDesc");
+                    returnJson.put("deliveryRate", deliveryDesc);
+                }
+                // itemDescUrls 商品详情图
+                JSONArray itemDescUrls = productDetail.getJSONArray("detailImageUrls");
+                if (!Check.isNull(itemDescUrls)) {
+                    returnJson.put("itemDescUrls", itemDescUrls);
+                }
+                // 轮播图
+                JSONArray itemGalleryUrls = productDetail.getJSONArray("imageUrls");
+                if (!Check.isNull(itemGalleryUrls)) {
+                    returnJson.put("itemGalleryUrls", itemGalleryUrls);
+                }
+            }
+        }
+        return returnJson;
     }
 
     private JSONObject getCategoryInfo(Long categoryId) {
@@ -309,6 +356,11 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
         kuaishouItemListMapper.updateCount(itemId, sampleCount, userCount);
     }
 
+    @Override
+    public List<Long> getActivityIds(Long userId) {
+        return kuaishouItemListMapper.getActivityIds(userId);
+    }
+
 
 }
 

+ 22 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemCollectSamplesMapper.xml

@@ -192,6 +192,18 @@
         item_title as 'itemTitle',
         promoter_id as 'promoterId',
         promoter_nick_name as 'promoterNickName',
+        (
+        case
+        when collect_sample_status = 1 then '待审核'
+        when collect_sample_status = 2 then '审核拒绝'
+        when collect_sample_status = 3 then '待录入单号'
+        when collect_sample_status = 4 then '已发货'
+        when collect_sample_status = 5 then '快递已签收,待上传作业'
+        when collect_sample_status = 6 then '作业已上传,待招商审核作业'
+        when collect_sample_status = 7 then '审核通过'
+        else ''
+        end
+        ) as 'status',
         sample_count as 'sampleCount',
         sample_requirement as 'sampleRequirement',
         consignee as 'consignee',
@@ -461,7 +473,7 @@
         delete
         from kuaishou_item_collect_sample_log
         where sample_id = #{sampleId}
-          and collect_sample_status = #{status}
+          and collect_sample_status &gt; #{status}
     </delete>
 
 
@@ -499,6 +511,15 @@
         ) t2 on 1 = 1
 
     </select>
+    <select id="selectPromoterInfo" resultType="com.alibaba.fastjson.JSONObject">
+        select promoter_id as 'promoterId',
+        valid_order_num as 'validOrderNum',
+        valid_amount as 'validAmount'
+        from promoter_oerder_amount where promoter_id in
+        <foreach collection="map.values" item="v" separator="," open="(" close=")">
+            ${v}
+        </foreach>
+    </select>
 
 
 </mapper>

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

@@ -98,6 +98,9 @@
          category_name as 'categoryName'
          from kuaishou_item_category  where  category_sort = 1 order by category_id
     </select>
+    <select id="getActivityIds" resultType="java.lang.Long" parameterType="java.lang.Long">
+        select activity_id  from kuaishou_item_list where user_id = #{userId} group by activity_id order by activity_id desc
+    </select>
 
 
     <insert id="insertItem" parameterType="com.ruixuan.isc.entity.KuaishouItemList">