Browse Source

修改ShowList同步报错问题,修改上传图片siteId错误问题

zhangqiang 9 months ago
parent
commit
1210c0380a

+ 6 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/showlist/param/ProductParam.java

@@ -2,6 +2,8 @@ package org.jeecg.modules.okki.showlist.param;
 
 import lombok.Data;
 
+import java.util.Optional;
+
 @Data
 public class ProductParam {
 
@@ -14,4 +16,8 @@ public class ProductParam {
     private String[] pid_list;
 
     private Integer sid;
+
+    public Optional<Integer> getSid() {
+        return Optional.ofNullable(sid);
+    }
 }

+ 6 - 2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/showlist/service/impl/OkkiShowlistServiceImpl.java

@@ -324,7 +324,9 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 				String[] split = pidList.split(",");
 				productListParam.setPid_list(split);
 			}
-			productListParam.setSid(okkiProductLists.get(0).getSid());
+			if (okkiProductLists.get(0) != null && okkiProductLists.get(0).getSid() > 0) {
+				productListParam.setSid(okkiProductLists.get(0).getSid());
+			}
 			pushShowlistParam.setProduct_list(productListParam);
 			// highlight
 			HighlightParam highlightParam = new HighlightParam();
@@ -378,7 +380,9 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 			recommendedProductParam.setProduct_list_type(okkiRecommendedProducts.get(0).getProductListType());
 			recommendedProductParam.setTitle(okkiRecommendedProducts.get(0).getTitle());
 			recommendedProductParam.setSubtitles(okkiRecommendedProducts.get(0).getSubtitles());
-			recommendedProductParam.setSid(okkiRecommendedProducts.get(0).getSid());
+			if (okkiRecommendedProducts.get(0) != null && okkiRecommendedProducts.get(0).getSid() > 0) {
+				recommendedProductParam.setSid(okkiRecommendedProducts.get(0).getSid());
+			}
 			// 将字符串转数组
 			String pidList1 = okkiRecommendedProducts.get(0).getPidList();
 			if (!"".equals(pidList1) && pidList1 != null) {