搜索--查询数据(下拉多选)
This commit is contained in:
+3
-1
@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -77,7 +78,8 @@ public class SysDictItemController {
|
||||
try {
|
||||
sysDictItem.setCreateTime(new Date());
|
||||
sysDictItem.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysDictItem.setItemValue(String.valueOf(RandomUtils.nextLong()));
|
||||
sysDictItem.setItemValue(UUID.randomUUID().toString().replace("-", ""));
|
||||
// sysDictItem.setItemValue(String.valueOf(RandomUtils.nextLong()));
|
||||
sysDictItem.setStatus(1);
|
||||
sysDictItemService.save(sysDictItem);
|
||||
result.success("保存成功!");
|
||||
|
||||
+21
-7
@@ -300,16 +300,30 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
String key = entry.getKey();
|
||||
String value = (String) entry.getValue();
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
for (String s : value.split(",")) {
|
||||
Map<String, Object> queryMap = new HashMap<>();
|
||||
Map<String, Object> queryMapTemp = new HashMap<>();
|
||||
queryMapTemp.put(key, s);
|
||||
queryMap.put("match_phrase", queryMapTemp);
|
||||
must.add(queryMap);
|
||||
}
|
||||
Map<String, Object> queryMap = new HashMap<>();
|
||||
Map<String, Object> queryMapTemp = new HashMap<>();
|
||||
queryMapTemp.put(key, "*"+value.replaceAll(",","*")+"*");
|
||||
// queryMapTemp.put(key, "*"+value+"*");
|
||||
queryMap.put("wildcard", queryMapTemp);
|
||||
must.add(queryMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (ObjectUtils.isNotEmpty(otherMap)) {
|
||||
// for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
|
||||
// String key = entry.getKey();
|
||||
// String value = (String) entry.getValue();
|
||||
// if (ObjectUtils.isNotEmpty(value)) {
|
||||
// for (String s : value.split(",")) {
|
||||
// Map<String, Object> queryMap = new HashMap<>();
|
||||
// Map<String, Object> queryMapTemp = new HashMap<>();
|
||||
// queryMapTemp.put(key, s);
|
||||
// queryMap.put("match_phrase", queryMapTemp);
|
||||
// must.add(queryMap);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//封装时间类型字段查询(时间范围)
|
||||
if (ObjectUtils.isNotEmpty(dateMap)) {
|
||||
for (Map.Entry<String, Object> entry : dateMap.entrySet()) {
|
||||
|
||||
Reference in New Issue
Block a user