From 4fafd438edeb9c5a24536ee9c821e71de0e5c776 Mon Sep 17 00:00:00 2001 From: xyiege Date: Fri, 16 Sep 2022 17:41:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/chjyj/szwh/utils/ApiGoodsUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/chjyj/szwh/utils/ApiGoodsUtils.java b/src/main/java/cn/chjyj/szwh/utils/ApiGoodsUtils.java index 48b381d..c5679fc 100644 --- a/src/main/java/cn/chjyj/szwh/utils/ApiGoodsUtils.java +++ b/src/main/java/cn/chjyj/szwh/utils/ApiGoodsUtils.java @@ -3,6 +3,7 @@ package cn.chjyj.szwh.utils; import cn.chjyj.szwh.bean.GoodsDetail; import cn.chjyj.szwh.bean.GoodsSource; import com.alibaba.fastjson2.JSONObject; +import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -121,7 +122,9 @@ public class ApiGoodsUtils { } // 商品描述 goodsDetail.setContract(json.getString("description")); - goodsDetail.setOtheridentifiers(json.getString("otherIdentifiers")); + //其他属性 + String otherIdentifiers = StringUtils.isEmpty(json.getString("otherIdentifiers"))?"[]":json.getString("otherIdentifiers"); + goodsDetail.setOtheridentifiers(otherIdentifiers); // goodsDetail.setDataJson(nodejson.toJSONString()); goodsDetail.setSourceJson(json.toJSONString());