Commit 9d36a1d5 authored by 曹盼盼's avatar 曹盼盼

修改设备筛选

parent 445774e3
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
......@@ -24,56 +23,54 @@ public class ESEquipmentCategoryDto {
@Id
private String SEQUENCE_NBR;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String ORG_BRANCH_NAME;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String ORG_BRANCH_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String USE_UNIT_NAME;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String USE_UNIT_CREDIT_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String EQU_LIST_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String EQU_LIST;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String EQU_CATEGORY;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String USE_ORG_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String CODE96333;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String EQU_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String SUPERVISORY_CODE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String USE_PLACE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String ADDRESS;
@Field(type = FieldType.Integer)
private Integer EQU_STATE;
@Field(type = FieldType.Text,searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
@Field(type = FieldType.Text)
private String STATUS;
@Field(type = FieldType.Date, format = DateFormat.basic_date_time, index = false)
private Date REC_DATE;
}
......@@ -906,7 +906,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
superviseInfoMapper.update(superviseInfo, new QueryWrapper<SuperviseInfo>().eq("RECORD", map.get("SEQUENCE_NBR").toString()));
}
return save;
}
public Page<JSONObject> queryByKeys(JSONObject map) {
//根据当前登录人查询
......@@ -1020,9 +1019,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
query.must(QueryBuilders.matchQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE")) && !("所有设备状态").equals(map.getString("EQU_STATE").toString()) ) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getString("EQU_STATE")));
Integer equState = EquimentEnum.getCode.get(map.getString("EQU_STATE"));
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", equState));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
......@@ -1049,7 +1049,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
list.add(dto2);
}
totle = getCount("idx_biz_view_jg_all", esClient);
totle = response.getInternalResponse().hits().getTotalHits().value;
result.setRecords(list);
result.setTotal(totle);
} catch (IOException e) {
......@@ -1063,6 +1063,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
return result;
}
//es统计总记录数
public Long getCount(String indexs, RestHighLevelClient esClient) {
Long totle = 0L;
......
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