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
e1727802
Commit
e1727802
authored
Feb 04, 2026
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(common): 将saveAllWithCache重命名为saveAllWithFallback
- 将saveWithCache重命名为saveWithFallback
parent
9a987ff9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
ESEquipmentCategory.java
.../amos/boot/module/common/api/dao/ESEquipmentCategory.java
+3
-3
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+3
-2
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/dao/ESEquipmentCategory.java
View file @
e1727802
...
@@ -27,7 +27,7 @@ public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipm
...
@@ -27,7 +27,7 @@ public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipm
@Query
(
"{\"prefix\": {\"ORG_BRANCH_CODE.keyword\": \"?0\"}}"
)
@Query
(
"{\"prefix\": {\"ORG_BRANCH_CODE.keyword\": \"?0\"}}"
)
List
<
ESEquipmentCategoryDto
>
findByOrgBranchCodeKeywordStartingWith
(
String
orgBranchCodePrefix
);
List
<
ESEquipmentCategoryDto
>
findByOrgBranchCodeKeywordStartingWith
(
String
orgBranchCodePrefix
);
default
Iterable
<
ESEquipmentCategoryDto
>
saveAllWith
Cache
(
Iterable
<
ESEquipmentCategoryDto
>
dtos
)
{
default
Iterable
<
ESEquipmentCategoryDto
>
saveAllWith
Fallback
(
Iterable
<
ESEquipmentCategoryDto
>
dtos
)
{
int
batchSize
=
2000
;
int
batchSize
=
2000
;
List
<
ESEquipmentCategoryDto
>
dtoList
=
StreamSupport
.
stream
(
dtos
.
spliterator
(),
false
)
List
<
ESEquipmentCategoryDto
>
dtoList
=
StreamSupport
.
stream
(
dtos
.
spliterator
(),
false
)
...
@@ -105,10 +105,10 @@ public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipm
...
@@ -105,10 +105,10 @@ public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipm
return
dtoList
;
return
dtoList
;
}
}
default
ESEquipmentCategoryDto
saveWith
Cache
(
ESEquipmentCategoryDto
dto
)
{
default
ESEquipmentCategoryDto
saveWith
Fallback
(
ESEquipmentCategoryDto
dto
)
{
// 将单个对象转换为列表进行处理
// 将单个对象转换为列表进行处理
List
<
ESEquipmentCategoryDto
>
dtoList
=
Collections
.
singletonList
(
dto
);
List
<
ESEquipmentCategoryDto
>
dtoList
=
Collections
.
singletonList
(
dto
);
Iterable
<
ESEquipmentCategoryDto
>
result
=
saveAllWith
Cache
(
dtoList
);
Iterable
<
ESEquipmentCategoryDto
>
result
=
saveAllWith
Fallback
(
dtoList
);
// 返回处理后的单个对象
// 返回处理后的单个对象
return
result
.
iterator
().
next
();
return
result
.
iterator
().
next
();
}
}
...
...
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/JgInstallationNoticeServiceImpl.java
View file @
e1727802
...
@@ -1554,7 +1554,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -1554,7 +1554,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgInstallationNotice
));
commonService
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgInstallationNotice
));
if
(!
ValidationUtil
.
isEmpty
(
esEquipmentDtos
))
{
if
(!
ValidationUtil
.
isEmpty
(
esEquipmentDtos
))
{
// 只有审批完成后esEquipmentDtos不为空,才会更新es信息
// 只有审批完成后esEquipmentDtos不为空,才会更新es信息
esEquipmentCategory
.
saveAllWith
Cache
(
esEquipmentDtos
);
esEquipmentCategory
.
saveAllWith
Fallback
(
esEquipmentDtos
);
}
}
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -2549,7 +2549,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
...
@@ -2549,7 +2549,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
commonService
.
saveExecuteFlowData2Redis
(
jgInstallationNotice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgInstallationNotice
));
commonService
.
saveExecuteFlowData2Redis
(
jgInstallationNotice
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgInstallationNotice
));
if
(!
ValidationUtil
.
isEmpty
(
esEquipmentDtos
))
{
if
(!
ValidationUtil
.
isEmpty
(
esEquipmentDtos
))
{
// 只有审批完成后esEquipmentDtos不为空,才会更新es信息
// 只有审批完成后esEquipmentDtos不为空,才会更新es信息
esEquipmentCategory
.
saveAllWith
Cache
(
esEquipmentDtos
);
esEquipmentCategory
.
saveAllWith
Fallback
(
esEquipmentDtos
);
}
}
}
}
}
}
\ No newline at end of file
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