fix: 优化商品搜索出现分类id问题
This commit is contained in:
parent
4f4593e5f7
commit
94c87f5645
@ -116,7 +116,11 @@ public class CheckDataRender implements CartRenderStep {
|
|||||||
//商品上架状态判定 sku为空、sku非上架状态、sku审核不通过
|
//商品上架状态判定 sku为空、sku非上架状态、sku审核不通过
|
||||||
boolean checkGoodsStatus = dataSku == null || !GoodsAuthEnum.PASS.name().equals(dataSku.getAuthFlag()) || !GoodsStatusEnum.UPPER.name().equals(dataSku.getMarketEnable());
|
boolean checkGoodsStatus = dataSku == null || !GoodsAuthEnum.PASS.name().equals(dataSku.getAuthFlag()) || !GoodsStatusEnum.UPPER.name().equals(dataSku.getMarketEnable());
|
||||||
//商品有效性判定 sku不为空且sku的更新时间不为空且sku的更新时间在购物车sku的更新时间之后
|
//商品有效性判定 sku不为空且sku的更新时间不为空且sku的更新时间在购物车sku的更新时间之后
|
||||||
boolean checkGoodsValid = dataSku != null && dataSku.getUpdateTime() != null && dataSku.getUpdateTime().after(cartSkuVO.getGoodsSku().getUpdateTime());
|
boolean checkGoodsValid = dataSku != null &&
|
||||||
|
dataSku.getUpdateTime() != null &&
|
||||||
|
cartSkuVO.getGoodsSku() != null &&
|
||||||
|
cartSkuVO.getGoodsSku().getUpdateTime() != null &&
|
||||||
|
dataSku.getUpdateTime().after(cartSkuVO.getGoodsSku().getUpdateTime());
|
||||||
|
|
||||||
|
|
||||||
if (checkGoodsStatus || checkGoodsValid) {
|
if (checkGoodsStatus || checkGoodsValid) {
|
||||||
|
@ -281,10 +281,8 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
|
|||||||
List<? extends Terms.Bucket> categoryNameBuckets = categoryNameAgg.getBuckets();
|
List<? extends Terms.Bucket> categoryNameBuckets = categoryNameAgg.getBuckets();
|
||||||
|
|
||||||
|
|
||||||
String categoryNamePath = categoryPath;
|
|
||||||
if (!categoryNameBuckets.isEmpty()) {
|
if (!categoryNameBuckets.isEmpty()) {
|
||||||
categoryNamePath = categoryNameBuckets.get(0).getKey().toString();
|
String categoryNamePath = categoryNameBuckets.get(0).getKey().toString();
|
||||||
}
|
|
||||||
String[] split = ArrayUtil.distinct(categoryPath.split(","));
|
String[] split = ArrayUtil.distinct(categoryPath.split(","));
|
||||||
String[] nameSplit = categoryNamePath.split(",");
|
String[] nameSplit = categoryNamePath.split(",");
|
||||||
if (split.length == nameSplit.length) {
|
if (split.length == nameSplit.length) {
|
||||||
@ -298,6 +296,8 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return categoryOptions;
|
return categoryOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user