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
4dcd9ab2
Commit
4dcd9ab2
authored
Jul 15, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refact(综合搜索):数据同步调整
1.人员的单位类型暂时和企业索引一致
parent
22fe572a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
11 deletions
+26
-11
BaseEnterpriseUpdate.java
...ot/module/common/biz/refresh/cm/BaseEnterpriseUpdate.java
+9
-9
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+7
-1
UserRefreshHandler.java
...ot/module/tcm/biz/refresh/handler/UserRefreshHandler.java
+10
-1
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/refresh/cm/BaseEnterpriseUpdate.java
View file @
4dcd9ab2
...
@@ -17,8 +17,8 @@ import java.util.stream.Collectors;
...
@@ -17,8 +17,8 @@ import java.util.stream.Collectors;
public
class
BaseEnterpriseUpdate
{
public
class
BaseEnterpriseUpdate
{
public
final
String
jyjcjg
=
"检验检测机构"
;
public
final
String
jyjcjg
=
"检验检测机构"
;
public
final
String
jy
dw
=
"检验单位
"
;
public
final
String
jy
jg
=
"检验机构
"
;
public
final
String
jc
dw
=
"检测单位
"
;
public
final
String
jc
jg
=
"检测机构
"
;
public
final
String
jyjgCode
=
"1233-1"
;
public
final
String
jyjgCode
=
"1233-1"
;
public
final
String
jcjgCode
=
"1233-2"
;
public
final
String
jcjgCode
=
"1233-2"
;
...
@@ -27,9 +27,9 @@ public class BaseEnterpriseUpdate {
...
@@ -27,9 +27,9 @@ public class BaseEnterpriseUpdate {
return
oldUnitType
;
return
oldUnitType
;
}
}
// 如果单位类型中包含检验检测机构、检测单位、检验单位,且有资质信息,则更新单位类型
// 如果单位类型中包含检验检测机构、检测单位、检验单位,且有资质信息,则更新单位类型
if
((
oldUnitType
.
contains
(
jyjcjg
)
||
oldUnitType
.
contains
(
jy
dw
)
||
oldUnitType
.
contains
(
jcdw
))
&&
!
ListUtils
.
isEmpty
(
unitLicences
))
{
if
((
oldUnitType
.
contains
(
jyjcjg
)
||
oldUnitType
.
contains
(
jy
jg
)
||
oldUnitType
.
contains
(
jcjg
))
&&
!
ListUtils
.
isEmpty
(
unitLicences
))
{
long
jydwCount
=
unitLicences
.
stream
().
filter
(
e
->
jyjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jy
dw
.
equals
(
e
.
getCertType
())).
count
();
long
jydwCount
=
unitLicences
.
stream
().
filter
(
e
->
jyjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jy
jg
.
equals
(
e
.
getCertType
())).
count
();
long
jcdwCount
=
unitLicences
.
stream
().
filter
(
e
->
jcjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jc
dw
.
equals
(
e
.
getCertType
())).
count
();
long
jcdwCount
=
unitLicences
.
stream
().
filter
(
e
->
jcjgCode
.
equals
(
e
.
getCertTypeCode
())
||
jc
jg
.
equals
(
e
.
getCertType
())).
count
();
// 如果资质中不含有检验和检测资质,则不更新单位类型
// 如果资质中不含有检验和检测资质,则不更新单位类型
if
(
jydwCount
==
0
&&
jcdwCount
==
0
)
{
if
(
jydwCount
==
0
&&
jcdwCount
==
0
)
{
return
oldUnitType
;
return
oldUnitType
;
...
@@ -37,13 +37,13 @@ public class BaseEnterpriseUpdate {
...
@@ -37,13 +37,13 @@ public class BaseEnterpriseUpdate {
// 处理旧的单位类型
// 处理旧的单位类型
Set
<
String
>
units
=
Arrays
.
stream
(
oldUnitType
.
split
(
"#"
)).
collect
(
Collectors
.
toSet
());
Set
<
String
>
units
=
Arrays
.
stream
(
oldUnitType
.
split
(
"#"
)).
collect
(
Collectors
.
toSet
());
units
.
remove
(
jyjcjg
);
units
.
remove
(
jyjcjg
);
units
.
remove
(
jy
dw
);
units
.
remove
(
jy
jg
);
units
.
remove
(
jc
dw
);
units
.
remove
(
jc
jg
);
if
(
jydwCount
>
0
)
{
if
(
jydwCount
>
0
)
{
units
.
add
(
jy
dw
);
units
.
add
(
jy
jg
);
}
}
if
(
jcdwCount
>
0
)
{
if
(
jcdwCount
>
0
)
{
units
.
add
(
jc
dw
);
units
.
add
(
jc
jg
);
}
}
return
String
.
join
(
"#"
,
units
);
return
String
.
join
(
"#"
,
units
);
}
else
{
}
else
{
...
...
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 @
4dcd9ab2
...
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.dto.KeyValueDto
;
import
com.yeejoin.amos.boot.biz.common.dto.KeyValueDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
...
@@ -1470,6 +1471,9 @@ public class DataHandlerServiceImpl {
...
@@ -1470,6 +1471,9 @@ public class DataHandlerServiceImpl {
TzBaseEnterpriseInfo:
:
getSuperviseOrgName
TzBaseEnterpriseInfo:
:
getSuperviseOrgName
).
eq
(
BaseEntity:
:
getIsDelete
,
false
));
).
eq
(
BaseEntity:
:
getIsDelete
,
false
));
Map
<
String
,
TzBaseEnterpriseInfo
>
useCodeEnterpriseMap
=
units
.
stream
().
collect
(
Collectors
.
toMap
(
TzBaseEnterpriseInfo:
:
getUseCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
Map
<
String
,
TzBaseEnterpriseInfo
>
useCodeEnterpriseMap
=
units
.
stream
().
collect
(
Collectors
.
toMap
(
TzBaseEnterpriseInfo:
:
getUseCode
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
Iterable
<
EsBaseEnterpriseInfo
>
esBaseEnterpriseInfoIterable
=
enterpriseInfoDao
.
findAll
();
List
<
EsBaseEnterpriseInfo
>
esBaseEnterpriseInfos
=
Lists
.
newArrayList
(
esBaseEnterpriseInfoIterable
);
Map
<
String
,
String
>
esUseCodeEnterpriseMap
=
esBaseEnterpriseInfos
.
stream
().
collect
(
Collectors
.
toMap
(
EsBaseEnterpriseInfo:
:
getUseCode
,
EsBaseEnterpriseInfo:
:
getUnitType
,(
k1
,
k2
)->
k2
));
LambdaQueryWrapper
<
TzsUserInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
TzsUserInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
)
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
)
.
orderByDesc
(
BaseEntity:
:
getSequenceNbr
);
.
orderByDesc
(
BaseEntity:
:
getSequenceNbr
);
...
@@ -1486,7 +1490,9 @@ public class DataHandlerServiceImpl {
...
@@ -1486,7 +1490,9 @@ public class DataHandlerServiceImpl {
esUserInfo
.
setSubPost
(
RefreshDataUtils
.
castStrList2String
(
u
.
getSubPost
()));
esUserInfo
.
setSubPost
(
RefreshDataUtils
.
castStrList2String
(
u
.
getSubPost
()));
esUserInfo
.
setEquipType
(
RefreshDataUtils
.
castStrList2String
(
u
.
getEquipType
()));
esUserInfo
.
setEquipType
(
RefreshDataUtils
.
castStrList2String
(
u
.
getEquipType
()));
esUserInfo
.
setEquipTypeName
(
RefreshDataUtils
.
castEquCategory2Name
(
esUserInfo
.
getEquipType
()));
esUserInfo
.
setEquipTypeName
(
RefreshDataUtils
.
castEquCategory2Name
(
esUserInfo
.
getEquipType
()));
esUserInfo
.
setUnitType
(
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getUnitType
());
// 人员类型暂时取esBaseEnterpriseInfo按照资质分开后的,等检验和检测分开后,按照实际情况取就即可:useCodeEnterpriseMap.getOrDefault(u.getUnitCode(), new TzBaseEnterpriseInfo()).getUnitType()
String
unitType
=
esUseCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getUnitType
());
esUserInfo
.
setUnitType
(
unitType
);
esUserInfo
.
setSuperviseOrgName
(
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getSuperviseOrgName
());
esUserInfo
.
setSuperviseOrgName
(
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getSuperviseOrgName
());
esUserInfo
.
setSuperviseOrgCode
(
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getSuperviseOrgCode
());
esUserInfo
.
setSuperviseOrgCode
(
useCodeEnterpriseMap
.
getOrDefault
(
u
.
getUnitCode
(),
new
TzBaseEnterpriseInfo
()).
getSuperviseOrgCode
());
esUserInfo
.
setLicenses
(
this
.
buildUserLicenses
(
u
.
getSequenceNbr
()));
esUserInfo
.
setLicenses
(
this
.
buildUserLicenses
(
u
.
getSequenceNbr
()));
...
...
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 @
4dcd9ab2
...
@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.tcm.biz.refresh.handler;
...
@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.tcm.biz.refresh.handler;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsBaseEnterpriseInfoDao
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsUserInfoDao
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsUserInfoDao
;
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.EsUserInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
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.api.service.IDataRefreshHandler
;
...
@@ -18,6 +20,8 @@ import lombok.RequiredArgsConstructor;
...
@@ -18,6 +20,8 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Optional
;
@Component
@Component
@Slf4j
@Slf4j
@RequiredArgsConstructor
@RequiredArgsConstructor
...
@@ -29,6 +33,8 @@ public class UserRefreshHandler implements IDataRefreshHandler {
...
@@ -29,6 +33,8 @@ public class UserRefreshHandler implements IDataRefreshHandler {
private
final
EsUserInfoDao
esUserInfoDao
;
private
final
EsUserInfoDao
esUserInfoDao
;
private
final
EsBaseEnterpriseInfoDao
esBaseEnterpriseInfoDao
;
private
final
CommonRefreshService
commonRefreshService
;
private
final
CommonRefreshService
commonRefreshService
;
...
@@ -62,7 +68,10 @@ public class UserRefreshHandler implements IDataRefreshHandler {
...
@@ -62,7 +68,10 @@ public class UserRefreshHandler implements IDataRefreshHandler {
esUserInfo
.
setSubPost
(
RefreshDataUtils
.
castStrList2String
(
userInfo
.
getSubPost
()));
esUserInfo
.
setSubPost
(
RefreshDataUtils
.
castStrList2String
(
userInfo
.
getSubPost
()));
esUserInfo
.
setEquipType
(
RefreshDataUtils
.
castStrList2String
(
userInfo
.
getEquipType
()));
esUserInfo
.
setEquipType
(
RefreshDataUtils
.
castStrList2String
(
userInfo
.
getEquipType
()));
esUserInfo
.
setEquipTypeName
(
RefreshDataUtils
.
castEquCategory2Name
(
esUserInfo
.
getEquipType
()));
esUserInfo
.
setEquipTypeName
(
RefreshDataUtils
.
castEquCategory2Name
(
esUserInfo
.
getEquipType
()));
esUserInfo
.
setUnitType
(
unit
.
getUnitType
());
Optional
<
EsBaseEnterpriseInfo
>
esBaseEnterpriseInfo
=
esBaseEnterpriseInfoDao
.
findById
(
unit
.
getSequenceNbr
()
+
""
);
// 人员类型暂时取esBaseEnterpriseInfo按照资质分开后的,等检验和检测分开后,按照实际情况取就即可:unit.getUnitType()
String
unitType
=
esBaseEnterpriseInfo
.
map
(
EsBaseEnterpriseInfo:
:
getUnitType
).
orElse
(
unit
.
getUnitType
());
esUserInfo
.
setUnitType
(
unitType
);
esUserInfo
.
setSuperviseOrgName
(
unit
.
getSuperviseOrgName
());
esUserInfo
.
setSuperviseOrgName
(
unit
.
getSuperviseOrgName
());
esUserInfo
.
setSuperviseOrgCode
(
unit
.
getSuperviseOrgCode
());
esUserInfo
.
setSuperviseOrgCode
(
unit
.
getSuperviseOrgCode
());
esUserInfo
.
setLicenses
(
commonRefreshService
.
buildUserLicenses
(
userInfo
.
getSequenceNbr
()));
esUserInfo
.
setLicenses
(
commonRefreshService
.
buildUserLicenses
(
userInfo
.
getSequenceNbr
()));
...
...
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