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
bf4f5d07
Commit
bf4f5d07
authored
Jul 02, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(综合搜索):增量更新
1.、数据同步增加删除逻辑
parent
e25fb137
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
4 deletions
+37
-4
EsUserInfoDao.java
...eejoin/amos/boot/module/common/api/dao/EsUserInfoDao.java
+1
-0
EquipRefreshHandler.java
...ot/module/jg/biz/refresh/handler/EquipRefreshHandler.java
+10
-0
EnterpriseRefreshHandler.java
...ule/tcm/biz/refresh/handler/EnterpriseRefreshHandler.java
+14
-1
UserRefreshHandler.java
...ot/module/tcm/biz/refresh/handler/UserRefreshHandler.java
+12
-3
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/EsUserInfoDao.java
View file @
bf4f5d07
...
...
@@ -6,4 +6,5 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
EsUserInfoDao
extends
PagingAndSortingRepository
<
EsUserInfo
,
String
>
{
void
deleteAllByUnitCode
(
String
useCode
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/refresh/handler/EquipRefreshHandler.java
View file @
bf4f5d07
...
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshHandler
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.refresh.StatisticsDataUpdateService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgDesignInfoServiceImpl
;
...
...
@@ -52,6 +53,11 @@ public class EquipRefreshHandler implements IDataRefreshHandler {
@Override
public
void
doRefresh
(
TzsDataRefreshMessage
message
)
{
log
.
info
(
"3库数据,设备开始刷库:唯一标识:{}"
,
message
.
getDataId
());
switch
(
DataRefreshEvent
.
Operation
.
valueOf
(
message
.
getOperation
())){
case
DELETE:
esEquipmentDao
.
deleteById
(
message
.
getDataId
());
case
INSERT:
case
UPDATE:
String
record
=
message
.
getDataId
();
ESEquipmentInfo
esEquipmentInfo
=
new
ESEquipmentInfo
();
Map
<
String
,
Object
>
map
=
categoryOtherInfoMapper
.
selectDataById
(
record
);
...
...
@@ -82,6 +88,10 @@ public class EquipRefreshHandler implements IDataRefreshHandler {
esEquipmentInfo
.
setMaintenances
(
lastMaintenanceRecordInfo
.
getSequenceNbr
()
!=
null
?
Collections
.
singletonList
(
BeanUtil
.
copyProperties
(
lastMaintenanceRecordInfo
,
ESEquipmentInfo
.
Maintenance
.
class
))
:
new
ArrayList
<>());
esEquipmentInfo
.
setTechParams
(
this
.
buildTechParamByEquList
(
record
,
categoryEs
.
getEQU_LIST_CODE
()));
esEquipmentDao
.
save
(
esEquipmentInfo
);
break
;
default
:
log
.
error
(
"uno operation: {}"
,
message
.
getOperation
());
}
}
private
List
<
ESEquipmentInfo
.
TechParam
>
buildTechParamByEquList
(
String
record
,
String
equListCode
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/refresh/handler/EnterpriseRefreshHandler.java
View file @
bf4f5d07
...
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.EsBaseEnterpriseInfo;
import
com.yeejoin.amos.boot.module.common.api.entity.EsUserInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshHandler
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.utils.RefreshDataUtils
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseUnitLicence
;
...
...
@@ -46,8 +47,15 @@ public class EnterpriseRefreshHandler implements IDataRefreshHandler {
@Override
public
void
doRefresh
(
TzsDataRefreshMessage
message
)
{
log
.
info
(
"3库数据,企业开始刷库:唯一标识:{}"
,
message
.
getDataId
());
// 企业信息更新
TzBaseEnterpriseInfo
enterpriseInfo
=
tzBaseEnterpriseInfoMapper
.
selectById
(
message
.
getDataId
());
switch
(
DataRefreshEvent
.
Operation
.
valueOf
(
message
.
getOperation
()))
{
case
DELETE:
enterpriseInfoDao
.
deleteById
(
message
.
getDataId
());
esUserInfoDao
.
deleteAllByUnitCode
(
enterpriseInfo
.
getUseCode
());
break
;
case
INSERT:
case
UPDATE:
// 企业信息更新
EsBaseEnterpriseInfo
esBaseEnterpriseInfo
=
new
EsBaseEnterpriseInfo
();
BeanUtil
.
copyProperties
(
enterpriseInfo
,
esBaseEnterpriseInfo
);
esBaseEnterpriseInfo
.
setSequenceNbr
(
enterpriseInfo
.
getSequenceNbr
()
+
""
);
...
...
@@ -71,5 +79,10 @@ public class EnterpriseRefreshHandler implements IDataRefreshHandler {
if
(
userInfosEs
.
iterator
().
hasNext
())
{
esUserInfoDao
.
saveAll
(
userInfosEs
);
}
break
;
default
:
log
.
error
(
"uno operation: {}"
,
message
.
getOperation
());
break
;
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/refresh/handler/UserRefreshHandler.java
View file @
bf4f5d07
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.EsUserInfoDao;
import
com.yeejoin.amos.boot.module.common.api.entity.EsUserInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.api.service.IDataRefreshHandler
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.common.biz.utils.RefreshDataUtils
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
...
...
@@ -16,7 +17,6 @@ import com.yeejoin.amos.boot.module.tcm.biz.refresh.CommonRefreshService;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StopWatch
;
@Component
@Slf4j
...
...
@@ -40,8 +40,12 @@ public class UserRefreshHandler implements IDataRefreshHandler {
@Override
public
void
doRefresh
(
TzsDataRefreshMessage
message
)
{
log
.
info
(
"3库数据,人员开始刷库:唯一标识:{}"
,
message
.
getDataId
());
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
switch
(
DataRefreshEvent
.
Operation
.
valueOf
(
message
.
getOperation
()))
{
case
DELETE:
esUserInfoDao
.
deleteById
(
message
.
getDataId
());
break
;
case
INSERT:
case
UPDATE:
TzsUserInfo
userInfo
=
userInfoMapper
.
selectById
(
message
.
getDataId
());
TzBaseEnterpriseInfo
unit
=
enterpriseInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzBaseEnterpriseInfo
>()
.
select
(
BaseEntity:
:
getSequenceNbr
,
...
...
@@ -62,5 +66,10 @@ public class UserRefreshHandler implements IDataRefreshHandler {
esUserInfo
.
setSuperviseOrgCode
(
unit
.
getSuperviseOrgCode
());
esUserInfo
.
setLicenses
(
commonRefreshService
.
buildUserLicenses
(
userInfo
.
getSequenceNbr
()));
esUserInfoDao
.
save
(
esUserInfo
);
break
;
default
:
log
.
error
(
"uno operation: {}"
,
message
.
getOperation
());
break
;
}
}
}
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