...
|
...
|
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.search.base.utils.ProductIndexEsField;
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -98,7 +99,7 @@ public class WebProductIndexBaseService { |
|
|
|
|
|
productMap.put("gender", MapUtils.getString(map, ProductIndexEsField.gender, ""));
|
|
|
productMap.put("status", MapUtils.getIntValue(map, ProductIndexEsField.status, 0));
|
|
|
productMap.put("goods_list", MapUtils.getObject(map, ProductIndexEsField.goodsList, new JSONArray()));
|
|
|
productMap.put("goods_list", this.getPcGoodsList(map));
|
|
|
|
|
|
productMap.put("is_new", MapUtils.getString(map, ProductIndexEsField.isnew, "N"));
|
|
|
productMap.put("is_advance", MapUtils.getString(map, ProductIndexEsField.isAdvance, "N"));
|
...
|
...
|
@@ -106,7 +107,7 @@ public class WebProductIndexBaseService { |
|
|
productMap.put("is_limited", MapUtils.getString(map, ProductIndexEsField.islimited, "N"));
|
|
|
productMap.put("is_discount", MapUtils.getString(map, ProductIndexEsField.isDiscount, "N"));
|
|
|
productMap.put("is_soon_sold_out", MapUtils.getString(map, ProductIndexEsField.isSoonSoldOut, "N"));
|
|
|
|
|
|
|
|
|
// 套餐
|
|
|
productMap.put("bundle_type", MapUtils.getIntValue(map, ProductIndexEsField.bundleType, 0));
|
|
|
|
...
|
...
|
@@ -125,6 +126,34 @@ public class WebProductIndexBaseService { |
|
|
return productMap;
|
|
|
}
|
|
|
|
|
|
private JSONArray getPcGoodsList(Map<String, Object> productMap) {
|
|
|
Object goodList = productMap.get(ProductIndexEsField.goodsList);
|
|
|
if (goodList == null) {
|
|
|
return new JSONArray();
|
|
|
}
|
|
|
if (!(goodList instanceof List)) {
|
|
|
return new JSONArray();
|
|
|
}
|
|
|
List<?> list = (List<?>) (goodList);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (Object object : list) {
|
|
|
if (!(object instanceof Map)) {
|
|
|
continue;
|
|
|
}
|
|
|
Map<?,?> good = (Map<?,?>)object;
|
|
|
JSONObject returnObject = new JSONObject();
|
|
|
returnObject.put("product_skc", MapUtils.getIntValue(good, "product_skc", 0));
|
|
|
returnObject.put("images_url", MapUtils.getString(good, "images_url", ""));
|
|
|
returnObject.put("color_name", MapUtils.getString(good, "color_name", ""));
|
|
|
returnObject.put("cover_1", MapUtils.getString(good, "cover_1", ""));
|
|
|
returnObject.put("cover_2", MapUtils.getString(good, "cover_2", ""));
|
|
|
returnObject.put("is_default", MapUtils.getString(good, "is_default", ""));
|
|
|
returnObject.put("status", MapUtils.getIntValue(good, "status", 0));
|
|
|
jsonArray.add(returnObject);
|
|
|
}
|
|
|
return jsonArray;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取商品列表[并返回变价计划]
|
|
|
*
|
...
|
...
|
|