Commit 940bb024 authored by tianbo's avatar tianbo

feat(jg): 添加出厂编号模糊查询功能

- 在EquipClaimServiceImpl中实现出厂编号的模糊查询逻辑 - 使用match_phrase进行精确匹配以提高查询准确性
parent ee2afbcf
......@@ -40,7 +40,6 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
......@@ -261,6 +260,15 @@ public class EquipClaimServiceImpl {
pBuilder.must(QueryBuilders.wildcardQuery(EQU_CODE, "*" + QueryParser.escape(test.toLowerCase()) + "*"));
boolMust.must(pBuilder);
}
// 出厂编号模糊查询
if (!ObjectUtils.isEmpty(params.getString(FACTORY_NUM))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String factoryNum = params.getString(FACTORY_NUM);
// 使用match_phrase进行精确匹配
pBuilder.must(QueryBuilders.matchPhraseQuery(FACTORY_NUM, factoryNum));
boolMust.must(pBuilder);
}
// 使用单位 名称模糊查询
if (!ObjectUtils.isEmpty(params.getString(USE_UNIT_NAME))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment