Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop

This commit is contained in:
Chopper711 2023-08-25 11:48:10 +08:00
commit b3f6bad6f8
2 changed files with 17 additions and 13 deletions

View File

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

View File

@ -281,22 +281,22 @@ 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) { for (int i = 0; i < split.length; i++) {
for (int i = 0; i < split.length; i++) { SelectorOptions so = new SelectorOptions();
SelectorOptions so = new SelectorOptions(); so.setName(nameSplit[i]);
so.setName(nameSplit[i]); so.setValue(split[i]);
so.setValue(split[i]); if (!categoryOptions.contains(so)) {
if (!categoryOptions.contains(so)) { categoryOptions.add(so);
categoryOptions.add(so); }
} }
} }
} }
} }
return categoryOptions; return categoryOptions;
} }