Skip to content

Commit

Permalink
对索引生成判定进行处理
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed Jul 9, 2021
1 parent a599fb9 commit 17b977e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cn.lili.common.utils.IpHelper;
import cn.lili.common.utils.SpelUtil;
import cn.lili.common.utils.ThreadPoolUtil;
import cn.lili.modules.base.entity.systemlog.SystemLogVO;
import cn.lili.modules.permission.entity.vo.SystemLogVO;
import cn.lili.modules.connect.util.IpUtils;
import cn.lili.modules.permission.service.SystemLogService;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.lili.modules.base.entity.systemlog;
package cn.lili.modules.permission.entity.vo;

import cn.lili.common.utils.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.SearchVO;
import cn.lili.modules.base.entity.systemlog.SystemLogVO;
import cn.lili.modules.permission.entity.vo.SystemLogVO;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import cn.lili.common.utils.StringUtils;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.SearchVO;
import cn.lili.modules.base.entity.systemlog.SystemLogVO;
import cn.lili.modules.permission.entity.vo.SystemLogVO;
import cn.lili.modules.permission.service.SystemLogService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class EsGoodsIndex implements Serializable {
/**
* 分类path
*/
@Field(type = FieldType.Keyword, fielddata = true)
@Field(type = FieldType.Keyword)
@ApiModelProperty("分类path")
private String categoryPath;

Expand Down Expand Up @@ -290,18 +290,21 @@ public EsGoodsIndex(GoodsSku sku, List<GoodsParamsDTO> goodsParamDTOS) {
List<EsGoodsAttribute> attributes = new ArrayList<>();
//循环参数分组
goodsParamDTOS.forEach(goodsParamGroup -> {
//循环分组的内容
goodsParamGroup.getGoodsParamsItemDTOList().forEach(goodsParam -> {
//如果字段需要索引,则增加索引字段
if (goodsParam.getIsIndex() != null && goodsParam.getIsIndex() == 1) {
EsGoodsAttribute attribute = new EsGoodsAttribute();
attribute.setType(1);
attribute.setName(goodsParam.getParamName());
attribute.setValue(goodsParam.getParamValue());
attributes.add(attribute);
//如果参数有配置,则增加索引
if (goodsParamGroup.getGoodsParamsItemDTOList() != null && !goodsParamGroup.getGoodsParamsItemDTOList().isEmpty()) {
//循环分组的内容
goodsParamGroup.getGoodsParamsItemDTOList().forEach(goodsParam -> {
//如果字段需要索引,则增加索引字段
if (goodsParam.getIsIndex() != null && goodsParam.getIsIndex() == 1) {
EsGoodsAttribute attribute = new EsGoodsAttribute();
attribute.setType(1);
attribute.setName(goodsParam.getParamName());
attribute.setValue(goodsParam.getParamValue());
attributes.add(attribute);
}
}
}
);
);
}

});
this.attrList = attributes;
Expand Down

0 comments on commit 17b977e

Please sign in to comment.