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());