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
4f898dd5
Commit
4f898dd5
authored
Jun 26, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(amos-boot-module-jg): 重构设备质量评分更新逻辑
- 引入 EquipmentCategoryService 以替代直接使用 equipmentCategoryDao - 使用 saveWithImmediateRefresh 方法替代原有的 save 方法,以确保数据实时更新
parent
bf012fb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
EquipQualityScoreUpdateService.java
...re/event/service/impl/EquipQualityScoreUpdateService.java
+6
-1
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 @
4f898dd5
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.EquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ReminderItemDto
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.biz.factory.GradeStrategyFactory
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.biz.factory.GradeStrategyFactory
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.reminder.core.event.EquipCreateOrEditEvent
;
...
@@ -18,6 +19,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
...
@@ -18,6 +19,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -44,6 +46,9 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
...
@@ -44,6 +46,9 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
private
final
GradeStrategyFactory
gradeStrategyFactory
;
private
final
GradeStrategyFactory
gradeStrategyFactory
;
@Autowired
EquipmentCategoryService
equipmentCategoryService
;
@Override
@Override
public
Boolean
support
(
EquipCreateOrEditEvent
.
EquipType
equipType
)
{
public
Boolean
support
(
EquipCreateOrEditEvent
.
EquipType
equipType
)
{
return
EquipCreateOrEditEvent
.
EquipType
.
equip
.
equals
(
equipType
);
return
EquipCreateOrEditEvent
.
EquipType
.
equip
.
equals
(
equipType
);
...
@@ -61,7 +66,7 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
...
@@ -61,7 +66,7 @@ public class EquipQualityScoreUpdateService implements IQualityScoreUpdate {
Integer
level
=
this
.
getReminderLevel
(
bizType
,
record
);
Integer
level
=
this
.
getReminderLevel
(
bizType
,
record
);
op
.
ifPresent
(
equipmentCategory
->
{
op
.
ifPresent
(
equipmentCategory
->
{
equipmentCategory
.
setDataQualityScore
(
level
);
equipmentCategory
.
setDataQualityScore
(
level
);
equipmentCategory
Dao
.
save
(
equipmentCategory
);
equipmentCategory
Service
.
saveWithImmediateRefresh
(
equipmentCategory
);
});
});
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
);
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
);
...
...
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