Authored by wangnan9279

新版发售日历 fix

... ... @@ -64,8 +64,8 @@ public class UfoProductMqListener extends AbstractMqListener {
}
private void updateCsSearchSalesCalendarIndex(Product product) {
Map<String, Object> indexData = new HashMap<String, Object>();
indexData.put(CsSearchSalesCalendarIndexEsField.id, product.getId());
Map<String, Object> indexData = new HashMap<>();
indexData.put(CsSearchSalesCalendarIndexEsField.id, ID_PREFIX+product.getId());
indexData.put(CsSearchSalesCalendarIndexEsField.skn, product.getId());
indexData.put(CsSearchSalesCalendarIndexEsField.salesTime, product.getSaleTime());
String saleDate = DateUtil.TimeStamp2DateWithFormat(Long.valueOf(product.getSaleTime()), "yyyy-MM");
... ... @@ -73,6 +73,7 @@ public class UfoProductMqListener extends AbstractMqListener {
indexData.put(CsSearchSalesCalendarIndexEsField.ufoDelStatus, product.getDelStatus());
indexData.put(CsSearchSalesCalendarIndexEsField.ufoShelveStatus, product.getShelveStatus());
indexData.put(CsSearchSalesCalendarIndexEsField.ufoIsSynCalender, product.getIsSynCalender());
indexData.put(CsSearchSalesCalendarIndexEsField.productType, 2);
this.updateIndexWithDataMap(indexData, ISearchConstants.INDEX_NAME_CS_SEARCH_SALES_CALENDAR, ID_PREFIX + product.getId());
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.search.consumer.index.increment.yhb_operations;
import com.alibaba.fastjson.JSONObject;
import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.CsSearchSalesCalendarIndexEsField;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.common.IYohoIndexService;
... ... @@ -49,12 +50,18 @@ public class CsSearchSalesCalendarMqListener extends AbstractMqListener {
}
this.saveOrUpdate(csSearchSalesCalendar);
Map<String, Object> indexData = new HashMap<String, Object>();
indexData.put("skn", csSearchSalesCalendar.getSkn());
indexData.put("imageUrl", csSearchSalesCalendar.getImageUrl());
indexData.put("salesTime", csSearchSalesCalendar.getSalesDate());
indexData.put(CsSearchSalesCalendarIndexEsField.id, ID_PREFIX + csSearchSalesCalendar.getId());
indexData.put(CsSearchSalesCalendarIndexEsField.skn, csSearchSalesCalendar.getSkn());
indexData.put(CsSearchSalesCalendarIndexEsField.imageUrl, csSearchSalesCalendar.getImageUrl());
indexData.put(CsSearchSalesCalendarIndexEsField.salesPrice, csSearchSalesCalendar.getSalesPrice());
indexData.put(CsSearchSalesCalendarIndexEsField.salesTime, csSearchSalesCalendar.getSalesDate());
String saleDate = DateUtil.TimeStamp2DateWithFormat(Long.valueOf(csSearchSalesCalendar.getSalesDate()), "yyyy-MM");
indexData.put("salesDate", saleDate);
this.updateIndexWithDataMap(indexData,this.getIndexName(),ID_PREFIX+csSearchSalesCalendar.getId());
indexData.put(CsSearchSalesCalendarIndexEsField.salesDate, saleDate);
indexData.put(CsSearchSalesCalendarIndexEsField.ufoDelStatus, 0);
indexData.put(CsSearchSalesCalendarIndexEsField.ufoShelveStatus, 1);
indexData.put(CsSearchSalesCalendarIndexEsField.ufoIsSynCalender, 1);
indexData.put(CsSearchSalesCalendarIndexEsField.productType, 1);
this.updateIndexWithDataMap(indexData, this.getIndexName(), ID_PREFIX + csSearchSalesCalendar.getId());
}
private void saveOrUpdate(CsSearchSalesCalendar csSearchSalesCalendar) {
... ...