Commit 2c65fde4 authored by tianyiming's avatar tianyiming

bug修改

parent 35834e00
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.dto; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.util.List;
/** /**
* 大屏筛选过滤对象 * 大屏筛选过滤对象
...@@ -195,7 +196,7 @@ public class DPFilterParamForDetailDto { ...@@ -195,7 +196,7 @@ public class DPFilterParamForDetailDto {
/** /**
* 下次检验日期 * 下次检验日期
*/ */
private String nextInspectionDate; private List<String> nextInspectionDate;
/** /**
* 姓名 * 姓名
*/ */
......
...@@ -26,6 +26,7 @@ import org.springframework.data.domain.PageRequest; ...@@ -26,6 +26,7 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -375,9 +376,16 @@ public class EquipmentStaticsServiceImpl { ...@@ -375,9 +376,16 @@ public class EquipmentStaticsServiceImpl {
boolMust.must(QueryBuilders.wildcardQuery("EQU_CATEGORY", "*" + dpFilterParamForDetailDto.getEquCategory() + "*")); boolMust.must(QueryBuilders.wildcardQuery("EQU_CATEGORY", "*" + dpFilterParamForDetailDto.getEquCategory() + "*"));
} }
if (StringUtils.isNotEmpty(dpFilterParamForDetailDto.getNextInspectionDate())) { if (!CollectionUtils.isEmpty(dpFilterParamForDetailDto.getNextInspectionDate())) {
String[] timeArray = dpFilterParamForDetailDto.getNextInspectionDate().split(","); String startDate = dpFilterParamForDetailDto.getNextInspectionDate().get(0);
boolMust.filter(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(timeArray[0]).lte(timeArray[1])); String endDate = dpFilterParamForDetailDto.getNextInspectionDate().get(1);
if (startDate != null && endDate != null) {
boolMust.filter(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(startDate).lte(endDate));
} else if (startDate != null) {
boolMust.filter(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").gte(startDate));
} else if (endDate != null) {
boolMust.filter(QueryBuilders.rangeQuery("NEXT_INSPECT_DATE").lte(endDate));
}
} }
} }
} }
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