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
b6054cf2
Commit
b6054cf2
authored
Oct 15, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg): 修复设备事件发布时的空指针问题
- 使用 removeIf 替代 remove 方法以安全移除空元素 - 增加空列表检查,避免发布空事件 - 修复质量评分更新服务中返回空值的问题,改为返回默认值 0 - 添加数据刷新消息发送前的空校验,防止空指针异常
parent
e6601a53
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
EquipQualityScoreUpdateService.java
...re/event/service/impl/EquipQualityScoreUpdateService.java
+4
-1
ProjectQualityScoreUpdateService.java
.../event/service/impl/ProjectQualityScoreUpdateService.java
+4
-1
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+6
-2
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/reminder/core/event/service/impl/EquipQualityScoreUpdateService.java
View file @
b6054cf2
...
...
@@ -61,7 +61,7 @@ public class EquipQualityScoreUpdateService extends DefaultQualityScoreUpdateSer
IdxBizJgUseInfo
useInfo
=
getIdxBizJgUseInfo
(
record
);
IdxBizJgRegisterInfo
registerInfo
=
getIdxBizJgRegisterInfo
(
record
);
if
(
ValidationUtil
.
isEmpty
(
useInfo
)
||
ValidationUtil
.
isEmpty
(
registerInfo
))
{
return
null
;
return
0
;
}
matchItemDto
.
setBizType
(
bizType
);
matchItemDto
.
setEquList
(
registerInfo
.
getEquList
());
...
...
@@ -96,6 +96,9 @@ public class EquipQualityScoreUpdateService extends DefaultQualityScoreUpdateSer
}
private
void
sendDataRefreshMsgEquip
(
List
<
String
>
records
)
{
if
(
ValidationUtil
.
isEmpty
(
records
))
{
return
;
}
eventPublisher
.
publish
(
new
DataRefreshEvent
(
this
,
records
,
DataRefreshEvent
.
DataType
.
equipment
.
name
(),
DataRefreshEvent
.
Operation
.
UPDATE
));
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/reminder/core/event/service/impl/ProjectQualityScoreUpdateService.java
View file @
b6054cf2
...
...
@@ -58,7 +58,7 @@ public class ProjectQualityScoreUpdateService extends DefaultQualityScoreUpdateS
private
Integer
getReminderLevel
(
String
bizType
,
String
projectContraptionId
)
{
IdxBizJgProjectContraption
projectContraption
=
idxBizJgProjectContraptionService
.
getById
(
projectContraptionId
);
if
(
ValidationUtil
.
isEmpty
(
projectContraption
))
{
return
null
;
return
0
;
}
MatchItemDto
matchItemDto
=
MatchItemDto
.
builder
().
build
();
matchItemDto
.
setBizType
(
bizType
);
...
...
@@ -81,6 +81,9 @@ public class ProjectQualityScoreUpdateService extends DefaultQualityScoreUpdateS
* @param projectContraptionIds 装置ids
*/
private
void
sendDataRefreshMsg
(
Set
<
String
>
projectContraptionIds
)
{
if
(
ValidationUtil
.
isEmpty
(
projectContraptionIds
))
{
return
;
}
List
<
IdxBizJgUseInfo
>
useInfos
=
idxBizJgUseInfoService
.
list
(
new
LambdaQueryWrapper
<
IdxBizJgUseInfo
>()
.
in
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
projectContraptionIds
)
.
select
(
IdxBizJgUseInfo:
:
getRecord
));
...
...
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/DataHandlerServiceImpl.java
View file @
b6054cf2
...
...
@@ -2395,8 +2395,9 @@ public class DataHandlerServiceImpl {
esEquipmentCategoryList
.
size
(),
projectContraptionIds
.
size
(),
equipRecord
.
size
());
if
(!
ValidationUtil
.
isEmpty
(
equipRecord
))
{
equipRecord
.
remove
(
n
ull
);
equipRecord
.
remove
If
(
Objects:
:
isN
ull
);
log
.
info
(
"发布设备事件,设备数量: {}"
,
equipRecord
.
size
());
if
(!
ValidationUtil
.
isEmpty
(
equipRecord
))
{
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
...
...
@@ -2404,10 +2405,12 @@ public class DataHandlerServiceImpl {
EquipCreateOrEditEvent
.
EquipType
.
equip
));
}
}
if
(!
ValidationUtil
.
isEmpty
(
projectContraptionIds
))
{
projectContraptionIds
.
remove
(
n
ull
);
projectContraptionIds
.
remove
If
(
Objects:
:
isN
ull
);
log
.
info
(
"发布装置设备事件,设备数量: {}"
,
projectContraptionIds
.
size
());
if
(!
ValidationUtil
.
isEmpty
(
projectContraptionIds
))
{
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
...
...
@@ -2415,6 +2418,7 @@ public class DataHandlerServiceImpl {
EquipCreateOrEditEvent
.
EquipType
.
project
));
}
}
total
.
addAndGet
(
esEquipmentCategoryList
.
size
());
log
.
debug
(
"当前批次处理完成,累计处理{}条设备"
,
total
.
get
());
...
...
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