Browse Source

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

zhangqiang 9 months ago
parent
commit
ea336a0c96

+ 3 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/blog/entity/OkkiBlog.java

@@ -65,9 +65,9 @@ public class OkkiBlog implements Serializable {
     @ApiModelProperty(value = "博客内容")
     private String content;
 	/**服务商的blog主键id*/
-	@Excel(name = "服务商的blog主键id", width = 15)
-    @ApiModelProperty(value = "服务商的blog主键id")
-    private Integer uid;
+//	@Excel(name = "服务商的blog主键id", width = 15)
+//    @ApiModelProperty(value = "服务商的blog主键id")
+//    private Integer uid;
 	/**ai检测分数*/
 	@Excel(name = "ai检测分数", width = 15)
     @ApiModelProperty(value = "ai检测分数")

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/blog/service/impl/OkkiBlogServiceImpl.java

@@ -55,7 +55,7 @@ public class OkkiBlogServiceImpl extends ServiceImpl<OkkiBlogMapper, OkkiBlog> i
             // 时间转换
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             postData.put("addtime", sdf.format(okkiBlog1.getCreateTime()));
-            postData.put("uid", okkiBlog1.getUid());
+            postData.put("uid", okkiBlog1.getId());
             if (okkiBlog.getReportScore() != null) {
                 postData.put("report_score", okkiBlog1.getReportScore());
             }

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

@@ -2,8 +2,6 @@ package org.jeecg.modules.okki.showlist.param;
 
 import lombok.Data;
 
-import java.util.Optional;
-
 @Data
 public class ProductParam {
 
@@ -17,7 +15,7 @@ public class ProductParam {
 
     private Integer sid;
 
-    public Optional<Integer> getSid() {
-        return Optional.ofNullable(sid);
-    }
+//    public Optional<Integer> getSid() {
+//        return Optional.ofNullable(sid);
+//    }
 }

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

@@ -283,7 +283,7 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 //			 将内容图片和其他图片地址通过接口上传到小满
 			if (okkiOverviews.size()>0) {
 				for (OkkiOverview okkiOverview : okkiOverviews) {
-					if (!"".equals(okkiOverview.getPic())) {
+					if (!"".equals(okkiOverview.getPic()) && okkiOverview.getPic() != null) {
 						String imgUrl = uploadService.uploadImage(imageBaseUrl + okkiOverview.getPic(), String.valueOf(okkiShowlist.getSiteId()));
 						System.out.println(imgUrl);
 						okkiOverview.setPic(imgUrl);
@@ -324,8 +324,10 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 				String[] split = pidList.split(",");
 				productListParam.setPid_list(split);
 			}
-			if (okkiProductLists.get(0) != null && okkiProductLists.get(0).getSid() > 0) {
+			if (okkiProductLists.get(0).getSid() != null) {
 				productListParam.setSid(okkiProductLists.get(0).getSid());
+			}else {
+				productListParam.setSid(0);
 			}
 			pushShowlistParam.setProduct_list(productListParam);
 			// highlight
@@ -380,8 +382,10 @@ 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());
-			if (okkiRecommendedProducts.get(0) != null && okkiRecommendedProducts.get(0).getSid() > 0) {
+			if (okkiRecommendedProducts.get(0).getSid() != null) {
 				recommendedProductParam.setSid(okkiRecommendedProducts.get(0).getSid());
+			}else {
+				recommendedProductParam.setSid(0);
 			}
 			// 将字符串转数组
 			String pidList1 = okkiRecommendedProducts.get(0).getPidList();