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
a6d99abe
Commit
a6d99abe
authored
Oct 24, 2025
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_bugfix' into develop_tzs_bugfix
parents
e7f49f33
2b4a60a9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
16 deletions
+46
-16
SafetyProblemTracingGenServiceImpl.java
.../biz/service/impl/SafetyProblemTracingGenServiceImpl.java
+46
-16
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/SafetyProblemTracingGenServiceImpl.java
View file @
a6d99abe
...
...
@@ -277,17 +277,27 @@ public class SafetyProblemTracingGenServiceImpl{
correctData
.
addAll
(
inspectionSet
);
}
else
if
(!
maintenanceSet
.
isEmpty
())
{
// 再次查询维保备案这些数据有没有检验超期的问题
maintenanceSet
.
removeAll
(
realOutOfInspectRecord
);
// 没有则可以愉快地更新设备状态为正常
correctData
.
addAll
(
maintenanceSet
);
// 再次查询检验这些数据有没有维保超期问题
inspectionSet
.
removeAll
(
realOutOfMaintenanceRecord
);
// 没有则可以愉快地更新设备状态为正常
correctData
.
addAll
(
inspectionSet
);
// 找出仅在maintenanceSet中而不在realOutOfInspectRecord中的元素(真正需要更新的维保数据)
List
<
String
>
maintenanceOnly
=
maintenanceSet
.
stream
()
.
filter
(
id
->
!
realOutOfMaintenanceRecord
.
contains
(
id
))
.
collect
(
Collectors
.
toList
());
// 找出仅在inspectionSet中而不在realOutOfMaintenanceRecord中的元素(真正需要更新的检验数据)
List
<
String
>
inspectionOnly
=
inspectionSet
.
stream
()
.
filter
(
id
->
!
realOutOfInspectRecord
.
contains
(
id
))
.
collect
(
Collectors
.
toList
());
correctData
.
addAll
(
maintenanceOnly
);
correctData
.
addAll
(
inspectionOnly
);
}
if
(!
ValidationUtil
.
isEmpty
(
correctData
))
{
logger
.
info
(
"开始更新设备表和ES数据状态--updateOtherTableAndES"
);
int
batchSize
=
1000
;
for
(
int
i
=
0
;
i
<
correctData
.
size
();
i
+=
batchSize
)
{
List
<
String
>
batch
=
correctData
.
subList
(
i
,
Math
.
min
(
i
+
batchSize
,
correctData
.
size
()));
safetyProblemTracingService
.
updateOtherTableAndES
(
Sets
.
newHashSet
(
batch
));
}
logger
.
info
(
"更新设备表和ES数据状态完成--updateOtherTableAndES,更新数据:{}条"
,
correctData
.
size
());
}
safetyProblemTracingService
.
updateOtherTableAndES
(
Sets
.
newHashSet
(
correctData
));
logger
.
info
(
"设备维保备案和检验超期数据修正完成,更新数据:{}条"
,
correctData
.
size
());
}
private
List
<
String
>
handleOutOfMaintenanceErrorData
(
Set
<
String
>
realOutOfMaintenanceRecord
)
{
...
...
@@ -295,6 +305,7 @@ public class SafetyProblemTracingGenServiceImpl{
if
(
ValidationUtil
.
isEmpty
(
realOutOfMaintenanceRecord
))
{
return
Lists
.
newArrayList
();
}
logger
.
info
(
"设备维保超期safety表数据修正开始,实际检验超期数据:{}条"
,
realOutOfMaintenanceRecord
.
size
());
List
<
SafetyProblemTracing
>
problemList
=
safetyProblemTracingService
.
list
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
select
(
SafetyProblemTracing:
:
getSourceId
)
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
SafetyProblemStatusEnum
.
UNHANDLED
.
getCode
())
...
...
@@ -305,20 +316,29 @@ public class SafetyProblemTracingGenServiceImpl{
return
Lists
.
newArrayList
();
}
// 追溯问题表中未处理的维保超期设备
List
<
String
>
outOfMaintenanceEquipIds
=
problemList
.
stream
().
map
(
SafetyProblemTracing:
:
getSourceId
).
collect
(
Collectors
.
toList
());
// 未超期但错误生成的维保超期设备
outOfMaintenanceEquipIds
.
removeIf
(
realOutOfMaintenanceRecord:
:
contains
);
List
<
String
>
outOfMaintenanceEquipIds
=
problemList
.
stream
()
.
map
(
SafetyProblemTracing:
:
getSourceId
)
.
filter
(
id
->
!
realOutOfMaintenanceRecord
.
contains
(
id
))
.
collect
(
Collectors
.
toList
());
if
(
ValidationUtil
.
isEmpty
(
outOfMaintenanceEquipIds
))
{
return
Lists
.
newArrayList
();
}
logger
.
info
(
"设备维保超期safety表数据修正开始,待更新数据:{}条"
,
outOfMaintenanceEquipIds
.
size
());
// 分批处理更新
int
batchSize
=
1000
;
for
(
int
i
=
0
;
i
<
outOfMaintenanceEquipIds
.
size
();
i
+=
batchSize
)
{
List
<
String
>
batch
=
outOfMaintenanceEquipIds
.
subList
(
i
,
Math
.
min
(
i
+
batchSize
,
outOfMaintenanceEquipIds
.
size
()));
safetyProblemTracingService
.
lambdaUpdate
()
.
set
(
SafetyProblemTracing:
:
getProblemStatusCode
,
SafetyProblemStatusEnum
.
HANDLED
.
getCode
())
.
set
(
SafetyProblemTracing:
:
getProblemStatus
,
SafetyProblemStatusEnum
.
HANDLED
.
getName
())
.
set
(
SafetyProblemTracing:
:
getRecDate
,
new
Date
())
.
in
(
SafetyProblemTracing:
:
getSourceId
,
outOfMaintenanceEquipIds
)
.
in
(
SafetyProblemTracing:
:
getSourceId
,
batch
)
.
eq
(
SafetyProblemTracing:
:
getProblemTypeCode
,
SafetyProblemTypeEnum
.
WBCQ
.
getProblemTypeCode
())
.
eq
(
SafetyProblemTracing:
:
getIsDelete
,
Boolean
.
FALSE
)
.
update
();
}
logger
.
info
(
"设备维保超期safety表数据修正完成,已更新数据:{}条"
,
outOfMaintenanceEquipIds
.
size
());
return
outOfMaintenanceEquipIds
;
}
...
...
@@ -327,6 +347,7 @@ public class SafetyProblemTracingGenServiceImpl{
if
(
ValidationUtil
.
isEmpty
(
realOutOfInspectRecord
))
{
return
Lists
.
newArrayList
();
}
logger
.
info
(
"设备检验超期safety表数据修正开始,实际检验超期数据:{}条"
,
realOutOfInspectRecord
.
size
());
List
<
SafetyProblemTracing
>
problemList
=
safetyProblemTracingService
.
list
(
new
LambdaQueryWrapper
<
SafetyProblemTracing
>()
.
select
(
SafetyProblemTracing:
:
getSourceId
)
.
eq
(
SafetyProblemTracing:
:
getProblemStatusCode
,
SafetyProblemStatusEnum
.
UNHANDLED
.
getCode
())
...
...
@@ -337,20 +358,29 @@ public class SafetyProblemTracingGenServiceImpl{
return
Lists
.
newArrayList
();
}
// 追溯问题表中未处理的检验超期设备
List
<
String
>
outOfInspectionEquipIds
=
problemList
.
stream
().
map
(
SafetyProblemTracing:
:
getSourceId
).
collect
(
Collectors
.
toList
());
// 未超期但错误生成的检验超期设备
outOfInspectionEquipIds
.
removeIf
(
realOutOfInspectRecord:
:
contains
);
List
<
String
>
outOfInspectionEquipIds
=
problemList
.
stream
()
.
map
(
SafetyProblemTracing:
:
getSourceId
)
.
filter
(
id
->
!
realOutOfInspectRecord
.
contains
(
id
))
.
collect
(
Collectors
.
toList
());
if
(
ValidationUtil
.
isEmpty
(
outOfInspectionEquipIds
))
{
return
Lists
.
newArrayList
();
}
logger
.
info
(
"设备检验超期safety表数据修正开始,待更新数据:{}条"
,
outOfInspectionEquipIds
.
size
());
// 分批处理更新
int
batchSize
=
1000
;
for
(
int
i
=
0
;
i
<
outOfInspectionEquipIds
.
size
();
i
+=
batchSize
)
{
List
<
String
>
batch
=
outOfInspectionEquipIds
.
subList
(
i
,
Math
.
min
(
i
+
batchSize
,
outOfInspectionEquipIds
.
size
()));
safetyProblemTracingService
.
lambdaUpdate
()
.
set
(
SafetyProblemTracing:
:
getProblemStatusCode
,
SafetyProblemStatusEnum
.
HANDLED
.
getCode
())
.
set
(
SafetyProblemTracing:
:
getProblemStatus
,
SafetyProblemStatusEnum
.
HANDLED
.
getName
())
.
set
(
SafetyProblemTracing:
:
getRecDate
,
new
Date
())
.
in
(
SafetyProblemTracing:
:
getSourceId
,
outOfInspectionEquipIds
)
.
in
(
SafetyProblemTracing:
:
getSourceId
,
batch
)
.
eq
(
SafetyProblemTracing:
:
getProblemTypeCode
,
SafetyProblemTypeEnum
.
JYCQ
.
getProblemTypeCode
())
.
eq
(
SafetyProblemTracing:
:
getIsDelete
,
Boolean
.
FALSE
)
.
update
();
}
logger
.
info
(
"设备检验超期safety表数据修正完成,已更新数据:{}条"
,
outOfInspectionEquipIds
.
size
());
return
outOfInspectionEquipIds
;
}
...
...
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