|
|
@@ -13,8 +13,10 @@ import com.uas.platform.b2c.core.utils.FastjsonUtils;
|
|
|
import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
|
|
|
import com.uas.platform.b2c.prod.commodity.model.Goods;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
|
|
|
+import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentGoodsDao;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentInfoDao;
|
|
|
+import com.uas.platform.b2c.prod.product.component.modal.Component;
|
|
|
import com.uas.platform.b2c.prod.product.component.modal.ComponentGoods;
|
|
|
import com.uas.platform.b2c.prod.product.component.modal.ComponentInfo;
|
|
|
import com.uas.platform.core.exception.SystemException;
|
|
|
@@ -66,6 +68,9 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
@Autowired
|
|
|
private GoodsDao goodsDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ComponentDao componentDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private SearchHistoryDao searchHistoryDao;
|
|
|
|
|
|
@@ -215,6 +220,7 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
for (Map<String, Object> brand : brands){
|
|
|
if (keyword.equalsIgnoreCase(brand.get("nameCn").toString()) || keyword.equalsIgnoreCase(brand.get("nameEn").toString())){
|
|
|
map.put("brands",brand);
|
|
|
+ brandDao.addSearchCount(brand.get("uuid").toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -249,6 +255,10 @@ public class SearcherServiceImpl implements SearcherService {
|
|
|
}
|
|
|
}
|
|
|
map.put("components", components);// 当前页器件内容
|
|
|
+ // 假如第一个结果与器件型号一致,则该型号增加一次 搜索量
|
|
|
+ if (components.get(0).getCode().equals(keyword)) {
|
|
|
+ componentDao.addSearchCount(components.get(0).getUuid());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
map.put("total", results.get("total"));// 搜索结果总数
|