Authored by Gino Zhang

修改类名

package com.yoho.search.comsumer.index;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import com.alibaba.fastjson.JSONObject;
import com.yoho.error.event.SearchEvent;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.base.utils.PerformanceMonitor;
import com.yoho.search.core.es.IElasticsearchClient;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.index.fullbuild.IIndexBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -17,14 +18,12 @@ import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.yoho.error.event.SearchEvent;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.base.utils.PerformanceMonitor;
import com.yoho.search.core.es.IElasticsearchClient;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.index.fullbuild.IIndexBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
@Component
public class YohoIndexDataLoader implements ApplicationEventPublisherAware, ApplicationContextAware {
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.service.logic.ProductPoolLogicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import com.yoho.search.dal.ProductPoolDetailMapper;
import com.yoho.search.dal.model.ProductPool;
... ... @@ -37,7 +37,7 @@ public class ProductPoolIndexBuilder extends IIndexBuilder {
//List<ProductPool> pageLists = productPoolMapper.getPageLists(offset, limit);
List<ProductPool> pageLists = productPoolBuildService.getProductPools(offset, limit);
for (ProductPool productPool : pageLists) {
SpecialDealForIndex.specialDealProductPool(productPool);
SpecialDealLogicService.specialDealProductPool(productPool);
}
return pageLists;
}
... ...
package com.yoho.search.index.fullbuild;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import com.yoho.search.dal.StorageMapper;
import com.yoho.search.dal.model.StorageSku;
import com.yoho.search.service.base.Product15DaySalesNumService;
... ... @@ -43,7 +43,7 @@ public class StorageSkuIndexBuilder extends IIndexBuilder {
pageLists = storageSkuService.selectList(offset, limit);
}
for (StorageSku storageSku : pageLists) {
SpecialDealForIndex.specialDealStorageSku(storageSku);
SpecialDealLogicService.specialDealStorageSku(storageSku);
}
return pageLists;
}
... ...
... ... @@ -10,7 +10,7 @@ import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.comsumer.common.CostStatistics;
import com.yoho.search.comsumer.common.PerformanceMonitor;
import com.yoho.search.comsumer.index.IYohoIndexService;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.Product;
import com.yoho.search.dal.model.ProductI;
... ... @@ -117,7 +117,7 @@ public class ProductMqListener extends AbstractMqListener implements ChannelAwar
}
//特殊处理的逻辑
SpecialDealForIndex.specialDealProductI(productI);
SpecialDealLogicService.specialDealProductI(productI);
//处理isNew(规则:首次上架7天内展示且折扣率小于88折)
productI.setIsnew("N");
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.comsumer.common.CostStatistics;
import com.yoho.search.comsumer.index.IYohoIndexService;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.ProductPool;
... ... @@ -219,7 +219,7 @@ public class ProductPoolIndexToolsService implements ApplicationEventPublisherAw
List<ESBluk> results = new ArrayList<ESBluk>();
for (ProductPool productPool : productPoolList) {
// 特殊处理ProductPool的某些字段
SpecialDealForIndex.specialDealProductPool(productPool);
SpecialDealLogicService.specialDealProductPool(productPool);
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(productPool)), productPool.getId().toString(), indexName, indexName, false));
}
indexService.bulk(results);
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.comsumer.common.CostStatistics;
import com.yoho.search.comsumer.index.IYohoIndexService;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.StorageSku;
... ... @@ -244,7 +244,7 @@ public class StorageSkuIndexToolsService implements ApplicationEventPublisherAwa
List<ESBluk> results = new ArrayList<ESBluk>();
for (StorageSku storageSku : storageSkuList) {
// 特殊处理storageSku的某些字段
SpecialDealForIndex.specialDealStorageSku(storageSku);
SpecialDealLogicService.specialDealStorageSku(storageSku);
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(storageSku)), storageSku.getProductSku().toString(), indexName, indexName, false));
}
indexService.bulk(results);
... ...
... ... @@ -6,7 +6,7 @@ import com.yoho.search.dal.ProductIMapper;
import com.yoho.search.dal.ProductIndexMapper;
import com.yoho.search.dal.model.ProductI;
import com.yoho.search.dal.model.ProductIndex;
import com.yoho.search.comsumer.utils.SpecialDealForIndex;
import com.yoho.search.service.logic.SpecialDealLogicService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -184,7 +184,7 @@ public class ProductIndexService {
map.put("productKeyword", productIndex.getProductKeyword());
SpecialDealForIndex.specialDealProductIndex(productIndex);
SpecialDealLogicService.specialDealProductIndex(productIndex);
String ageLevel = productIndex.getAgeLevel();
map.put("ageLevel", ageLevel);
... ...
package com.yoho.search.comsumer.utils;
package com.yoho.search.service.logic;
import com.yoho.search.dal.model.ProductI;
import com.yoho.search.dal.model.ProductIndex;
... ... @@ -6,7 +6,7 @@ import com.yoho.search.dal.model.ProductPool;
import com.yoho.search.dal.model.StorageSku;
import org.apache.commons.lang3.StringUtils;
public class SpecialDealForIndex {
public class SpecialDealLogicService {
private static String specialDealAgeLevel(String ageLevel){
if(StringUtils.isBlank(ageLevel)){
... ...