...
|
...
|
@@ -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) {
|
...
|
...
|
|