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
e7836482
Commit
e7836482
authored
Jun 26, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(jg): 优化设备类别保存逻辑并添加立即刷新索引功能
- 新增 EquipmentCategoryService 类,提供 saveWithImmediateRefresh 方法 - 在 IdxBizJgRegisterInfoServiceImpl 中使用新方法保存设备类别信息 - 修复数据源复制逻辑中的潜在 bug
parent
93c6fb44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
EquipmentCategoryService.java
...ule/common/biz/service/impl/EquipmentCategoryService.java
+24
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+5
-2
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/EquipmentCategoryService.java
0 → 100644
View file @
e7836482
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.data.elasticsearch.core.ElasticsearchOperations
;
import
org.springframework.stereotype.Service
;
@Service
@RequiredArgsConstructor
public
class
EquipmentCategoryService
{
private
final
ESEquipmentCategory
equipmentCategoryDao
;
private
final
ElasticsearchOperations
elasticsearchOperations
;
public
ESEquipmentCategoryDto
saveWithImmediateRefresh
(
ESEquipmentCategoryDto
dto
)
{
ESEquipmentCategoryDto
saved
=
equipmentCategoryDao
.
save
(
dto
);
// 手动触发索引刷新
elasticsearchOperations
.
indexOps
(
ESEquipmentCategoryDto
.
class
).
refresh
();
return
saved
;
}
}
\ No newline at end of file
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/IdxBizJgRegisterInfoServiceImpl.java
View file @
e7836482
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
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.biz.service.impl.EquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
...
...
@@ -244,6 +245,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
ESEquipmentCategory
esEquipmentCategory
;
@Autowired
EquipmentCategoryService
equipmentCategoryService
;
@Autowired
ICommonService
commonService
;
@Autowired
CommonMapper
commonMapper
;
...
...
@@ -3280,7 +3283,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String
sourceRecord
=
equipmentClassForm
.
get
(
RECORD
).
toString
();
// bug-21203
if
(
equipmentInfoForm
.
containsKey
(
"DATA_SOURCE"
))
{
String
dataSourceCopy
=
equipmentInfoForm
.
get
(
"DATA_SOURCE"
).
toString
()
;
String
dataSourceCopy
=
dataSource
;
if
(
dataSourceCopy
.
startsWith
(
"jg_his_black"
))
{
dataSource
=
"jg_his_black_"
+
sourceRecord
;
}
else
if
(
dataSourceCopy
.
startsWith
(
"jg_his"
))
{
...
...
@@ -3673,7 +3676,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Date
nextInspectDate
=
(
Date
)
map
.
get
(
"NEXT_INSPECT_DATE"
);
dto
.
setNEXT_INSPECT_DATE
(
DateUtil
.
parse
(
DateUtil
.
format
(
nextInspectDate
,
DatePattern
.
NORM_DATE_PATTERN
)).
getTime
());
}
e
sEquipmentCategory
.
save
(
dto
);
e
quipmentCategoryService
.
saveWithImmediateRefresh
(
dto
);
}
}
...
...
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