Commit b8c0d4f6 authored by tianbo's avatar tianbo

feat:大屏应急接口-ymt AlertCalled修改字段

parent bc53a1a4
...@@ -4,33 +4,24 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,33 +4,24 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EsElevatorDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EsElevatorDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EsSpecialEquipmentDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EsSpecialEquipmentDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EsSpecialEquipmentListDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EsSpecialEquipmentListDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.SpecialEquipmentDto; import com.yeejoin.amos.boot.module.ymt.api.dto.SpecialEquipmentDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.ymt.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.ymt.api.entity.Elevator;
import com.yeejoin.amos.boot.module.ymt.api.entity.EsElevator; import com.yeejoin.amos.boot.module.ymt.api.entity.EsElevator;
import com.yeejoin.amos.boot.module.ymt.biz.dao.ESElavtorRepository; import com.yeejoin.amos.boot.module.ymt.biz.dao.ESElavtorRepository;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.geo.GeoBoundingBox;
import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.ConstantScoreQueryBuilder; import org.elasticsearch.index.query.ConstantScoreQueryBuilder;
import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder; import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.bucket.filter.Filters;
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGrid; import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGrid;
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGridBucket; import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGridBucket;
import org.elasticsearch.search.aggregations.bucket.terms.ParsedLongTerms;
import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms;
import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -44,12 +35,7 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilde ...@@ -44,12 +35,7 @@ import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilde
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -160,12 +146,12 @@ public class ESElevatorServiceImpl { ...@@ -160,12 +146,12 @@ public class ESElevatorServiceImpl {
queryWrapper.le(AlertCalled::getCallTime, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN)); queryWrapper.le(AlertCalled::getCallTime, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
} }
alertCalleds = iAlertCalledService.list(queryWrapper); alertCalleds = iAlertCalledService.list(queryWrapper);
List<Long> stringList = new ArrayList<>(); List<String> stringList = new ArrayList<>();
for (AlertCalled al: alertCalleds for (AlertCalled al: alertCalleds
) { ) {
stringList.add(al.getEquipmentId()); stringList.add(al.getEquipmentId());
} }
List<Long> listL = stringList.stream().distinct().collect(Collectors.toList()); List<String> listL = stringList.stream().distinct().collect(Collectors.toList());
qb0.should(QueryBuilders.termsQuery("sequenceNbr", listL.toArray())); qb0.should(QueryBuilders.termsQuery("sequenceNbr", listL.toArray()));
boolMust.must(qb0); boolMust.must(qb0);
} }
......
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