Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
36b798e9
Commit
36b798e9
authored
Aug 15, 2025
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 大屏总览——一物一赋码二级弹窗接口修改
parent
786fd6eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
30 deletions
+36
-30
DPFilterParamForDetailDto.java
...boot/module/common/api/dto/DPFilterParamForDetailDto.java
+5
-0
EquipmentStaticsServiceImpl.java
...atistcs/biz/service/impl/EquipmentStaticsServiceImpl.java
+31
-30
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DPFilterParamForDetailDto.java
View file @
36b798e9
...
...
@@ -70,6 +70,11 @@ public class DPFilterParamForDetailDto {
private
String
superviseUnitName
;
/**
* 监管单位名称(接收单位/管辖机构)
*/
private
String
orgBranchCode
;
/**
* 企业单位名称(发起单位/使用单位)
*/
private
String
companyName
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/EquipmentStaticsServiceImpl.java
View file @
36b798e9
...
...
@@ -14,7 +14,6 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.ShardSearchFailure
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.core.CountRequest
;
...
...
@@ -28,13 +27,14 @@ import org.springframework.data.domain.PageRequest;
import
org.springframework.data.elasticsearch.core.query.NativeSearchQuery
;
import
org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -51,6 +51,8 @@ public class EquipmentStaticsServiceImpl {
private
static
final
String
EQUSTATE
=
"EQU_STATE"
;
private
static
final
String
SUPERVISORYCODE
=
"SUPERVISORY_CODE"
;
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
@Resource
private
SafetyProblemTracingMapper
safetyProblemTracingMapper
;
...
...
@@ -297,15 +299,21 @@ public class EquipmentStaticsServiceImpl {
public
Page
<
Map
<
String
,
Object
>>
normalPage
(
Integer
current
,
Integer
size
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
()
!=
null
){
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
().
contains
(
"_"
)){
String
code
=
dpFilterParamForDetailDto
.
getOrgBranchCode
().
split
(
"_"
)[
0
];
orgCode
=
stCommonService
.
getAndSetOrgCode
(
code
);
}
}
if
(
StringUtils
.
isEmpty
(
orgCode
)){
return
new
Page
<>(
current
,
size
);
}
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_
view_jg_all
"
);
request
.
indices
(
"idx_biz_
equipment_info
"
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
...
...
@@ -315,30 +323,22 @@ public class EquipmentStaticsServiceImpl {
}
}
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
//
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
//检验状态0临期1超期
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInspectionStatus
())){
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getInspectionStatus
())){
// 且下次检验日期大于等于当天 且查询 下次检验日期 <= 当前天+30天 即为临期
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
).
getTime
();
long
currentDayAfter30DayTime
=
DateUtil
.
offsetDay
(
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
),
30
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
currentDayTime
).
lte
(
currentDayAfter30DayTime
));
}
else
{
// 查询下次检验日期小于当前天的设备,即为超期检验超期设备
List
<
String
>
typeList
=
new
ArrayList
<>();
typeList
.
add
(
"维保超期"
);
typeList
.
add
(
"检验超期"
);
List
<
String
>
sourceIds
=
safetyProblemTracingMapper
.
getSourceId
(
orgCode
,
typeList
);
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
sourceIds
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInspectionStatus
()))
{
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getInspectionStatus
()))
{
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
LocalDate
.
now
().
format
(
formatter
)).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)));
}
else
{
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lt
(
LocalDate
.
now
().
format
(
formatter
)));
}
}
/**
* 使用单位
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUseUnitName
())){
boolMust
.
must
(
QueryBuilders
.
matchPhrase
Query
(
"USE_UNIT_NAME"
,
"*"
+
dpFilterParamForDetailDto
.
getUseUnitName
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
wildcard
Query
(
"USE_UNIT_NAME"
,
"*"
+
dpFilterParamForDetailDto
.
getUseUnitName
()
+
"*"
));
}
/**
* 使用登记编号
...
...
@@ -350,50 +350,51 @@ public class EquipmentStaticsServiceImpl {
* 96333
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getCode96333
())){
boolMust
.
must
(
QueryBuilders
.
matchPhrase
Query
(
"CODE96333"
,
"*"
+
dpFilterParamForDetailDto
.
getCode96333
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
wildcard
Query
(
"CODE96333"
,
"*"
+
dpFilterParamForDetailDto
.
getCode96333
()
+
"*"
));
}
/**
* 监管码
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisoryCode
())){
boolMust
.
must
(
QueryBuilders
.
matchPhrase
Query
(
"SUPERVISORY_CODE"
,
"*"
+
dpFilterParamForDetailDto
.
getSupervisoryCode
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
wildcard
Query
(
"SUPERVISORY_CODE"
,
"*"
+
dpFilterParamForDetailDto
.
getSupervisoryCode
()
+
"*"
));
}
/**
* 所属地区
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUsePlace
())){
boolMust
.
must
(
QueryBuilders
.
matchPhrase
Query
(
"USE_PLACE"
,
"*"
+
dpFilterParamForDetailDto
.
getUsePlace
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
wildcard
Query
(
"USE_PLACE"
,
"*"
+
dpFilterParamForDetailDto
.
getUsePlace
()
+
"*"
));
}
/**
* 设备状态
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquState
())){
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"EQU_STATE"
,
dpFilterParamForDetailDto
.
getEquState
(
)));
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"EQU_STATE"
,
EquimentEnum
.
getCode
.
get
(
dpFilterParamForDetailDto
.
getEquState
()
)));
}
/**
* 信息化
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInformationSituation
())){
boolMust
.
must
(
QueryBuilders
.
match
PhraseQuery
(
"INFORMATION_SITUATION"
,
"*"
+
dpFilterParamForDetailDto
.
getInformationSituation
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
match
Query
(
"INFORMATION_SITUATION"
,
dpFilterParamForDetailDto
.
getInformationSituation
()
));
}
/**
* 设备类别
*/
if
(
StrUtil
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquCategory
())){
boolMust
.
must
(
QueryBuilders
.
matchPhrase
Query
(
"EQU_CATEGORY"
,
"*"
+
dpFilterParamForDetailDto
.
getEquCategory
()
+
"*"
));
boolMust
.
must
(
QueryBuilders
.
wildcard
Query
(
"EQU_CATEGORY"
,
"*"
+
dpFilterParamForDetailDto
.
getEquCategory
()
+
"*"
));
}
//监管码状态0已赋码1未赋码
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
())){
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
boolMust
.
must
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
}
else
{
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
}
else
{
boolMust
.
mustNot
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
}
}
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getNextInspectionDate
())){
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
DateUtil
.
parse
(
dpFilterParamForDetailDto
.
getNextInspectionDate
()).
getTime
()));
String
[]
timeArray
=
dpFilterParamForDetailDto
.
getNextInspectionDate
().
split
(
","
);
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
timeArray
[
0
]).
lte
(
timeArray
[
1
]));
}
searchSourceBuilder
.
query
(
boolMust
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment