Commit a48804c4 authored by tianyiming's avatar tianyiming

bug修改

parent 82a43ad5
......@@ -502,7 +502,6 @@ public class JGDPStatisticsServiceImpl {
request.indices(StatisticalAnalysisEnum.equip.getKey());
BigDecimal pipeLong;
BoolQueryBuilder pipeLengthQuery = new BoolQueryBuilder();
pipeLengthQuery.must(QueryBuilders.prefixQuery("ORG_BRANCH_CODE", orgCode));
pipeLengthQuery.must(QueryBuilders.existsQuery("pipeLength"));
if (isOrgBranchCodeExactMatch) {
// 按照管辖机构区域信息精确查询
......
......@@ -603,18 +603,15 @@ public class JYJCDPStatisticsServiceImpl {
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
boolMust.must(QueryBuilders.prefixQuery("ORG_BRANCH_CODE", orgCode));
//已赋码
boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null"));
//状态为已认领
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
// 且下次检验日期大于等于当天
long currentDayTime = DateUtil.parse(DateUtil.today(), "yyy-MM-dd").getTime();
// 且查询 下次检验日期 <= 当前天+30天 极为临期
long currentDayAfter30DayTime = DateUtil.offsetDay(DateUtil.parse(DateUtil.today(), "yyy-MM-dd"), 30).getTime();
boolMust.must(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(currentDayTime).lte(currentDayAfter30DayTime));
// 大于等于当天 下次检验日期 <= 当前天+30天 即为临期
boolMust.filter(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(LocalDate.now().format(formatter)).lte(LocalDate.now().plusDays(30).format(formatter)));
// 且8大类,目的去掉脏数据
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE",StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
request.query(boolMust);
......
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