浏览代码

Merge remote-tracking branch 'origin/master'

zhaoxian 2 年之前
父节点
当前提交
48913e6258

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

@@ -1,5 +1,6 @@
 package com.ruixuan.bytedance.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.doudian.open.api.alliance_colonelActivityProduct.AllianceColonelActivityProductRequest;
 import com.doudian.open.api.alliance_colonelActivityProduct.AllianceColonelActivityProductResponse;
@@ -285,8 +286,16 @@ public class BytedanceServiceImpl implements IBytedanceService {
             returnJson.put("judgeStatus", "1");
             JSONObject dataJson = jsonObject.getJSONObject("data");
             if (!Check.isNull(dataJson)) {
-                JSONObject record = dataJson.getJSONArray("records").getJSONObject(0);
-                if (!Check.isNull(record)) {
+                JSONArray records = dataJson.getJSONArray("records");
+                if(Check.isNull(records)){
+                    returnJson.put("code", -1);
+                    returnJson.put("message", "媒体返回商品信息为空");
+                }
+                JSONObject record  = records.getJSONObject(0);
+                if(Check.isNull(record)){
+                    returnJson.put("code", -1);
+                    returnJson.put("message", "媒体返回商品信息为空");
+                }else {
                     String update_time = record.getString("update_time"); // 更新时间
                     Long product_id = record.getLong("product_id"); // 商品id
                     String product_name = record.getString("product_name"); // 商品id

+ 3 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemList.java

@@ -12,7 +12,7 @@ public class KuaishouItemList extends BaseEntity {
      * 商品ID
      */
     private Long itemId;
-    private Long  mediaId;
+    private Integer  mediaId;
 
     /**
      * 商品标题
@@ -247,11 +247,11 @@ public class KuaishouItemList extends BaseEntity {
         this.itemId = itemId;
     }
 
-    public Long getMediaId() {
+    public Integer getMediaId() {
         return mediaId;
     }
 
-    public void setMediaId(Long mediaId) {
+    public void setMediaId(Integer mediaId) {
         this.mediaId = mediaId;
     }
 

文件差异内容过多而无法显示
+ 4 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemListMapper.xml