Authored by hugufei

添加注释

... ... @@ -116,28 +116,24 @@ public class ProductIndexBaseService {
return results;
}
@SuppressWarnings("unchecked")
public Map<String, Object> getProductMapFromEsSource(Map<String, Object> map) {
Map<String, Object> productMap = new HashMap<String, Object>();
if (map.containsKey("_highlight") && map.get("_highlight") != null) {
Map<String, Object> highlightMap = (Map<String, Object>) map.get("_highlight");
if (highlightMap.containsKey(ProductIndexEsField.productName_productName_ansj)) {
productMap.put("product_name_highlight", MapUtils.getString(highlightMap, ProductIndexEsField.productName_productName_ansj, ""));
}
}
productMap.put("product_id", MapUtils.getIntValue(map, ProductIndexEsField.productId, 0));
productMap.put("product_name", MapUtils.getString(map, ProductIndexEsField.productName, ""));
productMap.put("product_skn", MapUtils.getIntValue(map, ProductIndexEsField.productSkn, 0));
//品牌
productMap.put("brand_id", MapUtils.getIntValue(map, ProductIndexEsField.brandId, 0));
productMap.put("brand_name", MapUtils.getString(map, ProductIndexEsField.brandName, ""));
productMap.put("brand_domain", MapUtils.getString(map, ProductIndexEsField.brandDomain, ""));
productMap.put("country_id", MapUtils.getIntValue(map, ProductIndexEsField.countryId, 0));
productMap.put("country_id", MapUtils.getIntValue(map, ProductIndexEsField.countryId, 0));//线下店专用
//店铺
productMap.put("shop_id", MapUtils.getIntValue(map, ProductIndexEsField.shopId, 0));
productMap.put("shop_name", MapUtils.getString(map, ProductIndexEsField.shopName, ""));
productMap.put("shop_domain", MapUtils.getString(map, ProductIndexEsField.shopDomain, ""));
//价格相关
productMap.put("sales_price", MapUtils.getDoubleValue(map, ProductIndexEsField.salesPrice, 0));
productMap.put("market_price", MapUtils.getDoubleValue(map, ProductIndexEsField.marketPrice, 0));
productMap.put("vip_price", MapUtils.getDoubleValue(map, ProductIndexEsField.vipPrice, 0));
... ... @@ -151,18 +147,22 @@ public class ProductIndexBaseService {
productMap.put("student_price", "Y".equalsIgnoreCase(isStudentPrice) ? MapUtils.getDoubleValue(map, ProductIndexEsField.studentPrice) : null);
productMap.put("is_student_rebate", MapUtils.getString(map, ProductIndexEsField.isstudentrebate, "N"));
//图片相关
productMap.put("default_images", MapUtils.getString(map, ProductIndexEsField.defaultImages, ""));
productMap.put("skn_default_img", MapUtils.getString(map, ProductIndexEsField.sknDefaultImg, ""));
//时间相关
productMap.put("edit_time", MapUtils.getIntValue(map, ProductIndexEsField.editTime));
productMap.put("shelve_time", MapUtils.getIntValue(map, ProductIndexEsField.shelveTime));
productMap.put("first_shelve_time", MapUtils.getIntValue(map, ProductIndexEsField.firstShelveTime));
//品类相关
productMap.put("max_sort_id", MapUtils.getIntValue(map, ProductIndexEsField.maxSortId));
productMap.put("middle_sort_id", MapUtils.getIntValue(map, ProductIndexEsField.middleSortId));
productMap.put("small_sort_id", MapUtils.getIntValue(map, ProductIndexEsField.smallSortId));
productMap.put("small_sort_name", MapUtils.getString(map, ProductIndexEsField.smallSort, ""));
//库存销量相关
productMap.put("stock_number", MapUtils.getIntValue(map, ProductIndexEsField.storageNum, 0));
productMap.put("storage_num", MapUtils.getIntValue(map, ProductIndexEsField.storageNum, 0));
productMap.put("sales_num", MapUtils.getIntValue(map, ProductIndexEsField.salesNum, 0));
... ... @@ -185,7 +185,6 @@ public class ProductIndexBaseService {
productMap.put("is_discount", MapUtils.getString(map, ProductIndexEsField.isDiscount, "N"));
productMap.put("is_soon_sold_out", MapUtils.getString(map, ProductIndexEsField.isSoonSoldOut, "N"));
productMap.put("is_promotion", MapUtils.getIntValue(map, ProductIndexEsField.ispromotion, 0));
productMap.put("is_latest_reduce_price", MapUtils.getString(map, ProductIndexEsField.isLatestReducePrice, "N"));
productMap.put("is_breaking", "N");
if (MapUtils.getDoubleValue(map, ProductIndexEsField.basePinRatio, 0) >= 3.5 && MapUtils.getDoubleValue(map, ProductIndexEsField.breakSizePercent, 0) >= 50) {
productMap.put("is_breaking", "Y");
... ... @@ -213,15 +212,19 @@ public class ProductIndexBaseService {
// 标签
productMap.put("customize_tag", MapUtils.getObject(map, ProductIndexEsField.customizeTags, new JSONArray()));
productMap.put("promotion_tag", this.getPomotionTags(map));// 促销标签
// 定金 定金倍数
productMap.put("deposit", MapUtils.getDoubleValue(map, ProductIndexEsField.deposit, 0));
productMap.put("deposit_multiples", MapUtils.getIntValue(map, ProductIndexEsField.depositMultiples));
// 商品标签-首页天窗专用
productMap.put("is_promotion_active", "N");// 当前是否有促销正在进行
boolean promotionActive = getPromotionActive(map);
if (promotionActive) {
productMap.put("is_promotion_active", "Y");
}
productMap.put("is_latest_reduce_price", MapUtils.getString(map, ProductIndexEsField.isLatestReducePrice, "N"));//是否最新降价
// 定金 定金倍数
productMap.put("deposit", MapUtils.getDoubleValue(map, ProductIndexEsField.deposit, 0));
productMap.put("deposit_multiples", MapUtils.getIntValue(map, ProductIndexEsField.depositMultiples));
return productMap;
}
... ...