Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lyf-beidou-cdp-api
Overview
Overview
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
zhoupeng
lyf-beidou-cdp-api
Commits
a81ba901
Commit
a81ba901
authored
Sep 20, 2023
by
zhoupeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交导入组织架构openapi接口
parent
624cc144
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
SyncEmployeCdpServiceImpl.java
.../order/domain/service/impl/SyncEmployeCdpServiceImpl.java
+16
-3
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/rome/order/domain/service/impl/SyncEmployeCdpServiceImpl.java
View file @
a81ba901
...
@@ -205,17 +205,24 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
...
@@ -205,17 +205,24 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
}
else
{
}
else
{
//批量添加
//批量添加
List
<
EmpMainDataResDTO
>
batchAdd
=
new
ArrayList
<>();
List
<
EmpMainDataResDTO
>
batchAdd
=
new
ArrayList
<>();
Map
<
Long
,
SyncEmployeeCdpDO
>
empMainMap
=
employeeCdpListByUserIds
.
stream
().
collect
(
Collectors
.
toMap
(
SyncEmployeeCdpDO:
:
getUserId
,
Function
.
identity
()));
//批量更新
List
<
EmpMainDataResDTO
>
batchUpdateAdd
=
new
ArrayList
<>();
Map
<
Long
,
SyncEmployeeCdpDO
>
empMainMap
=
employeeCdpListByUserIds
.
stream
().
collect
(
Collectors
.
toMap
(
SyncEmployeeCdpDO:
:
getUserId
,
Function
.
identity
(),
(
var1
,
var2
)
->
var1
));
for
(
EmpMainDataResDTO
empResDTO:
empResList
)
{
for
(
EmpMainDataResDTO
empResDTO:
empResList
)
{
Long
userId
=
empResDTO
.
getUserId
();
Long
userId
=
empResDTO
.
getUserId
();
if
(!
empMainMap
.
containsKey
(
userId
)){
if
(!
empMainMap
.
containsKey
(
userId
)){
batchAdd
.
add
(
empResDTO
);
batchAdd
.
add
(
empResDTO
);
}
else
{
batchUpdateAdd
.
add
(
empResDTO
);
}
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
batchAdd
)){
if
(!
CollectionUtils
.
isEmpty
(
batchAdd
)){
syncEmployeeCdpMapper
.
batchSaveEmpCdp
(
batchAdd
);
syncEmployeeCdpMapper
.
batchSaveEmpCdp
(
batchAdd
);
allEmps
.
addAll
(
batchAdd
);
allEmps
.
addAll
(
batchAdd
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
batchUpdateAdd
)){
allEmps
.
addAll
(
batchUpdateAdd
);
}
}
}
}
}
...
@@ -263,10 +270,16 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
...
@@ -263,10 +270,16 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
}
}
empMainStaffsReqDTO
.
setAccountId
(
empMainDataResDTO
.
getUserId
()+
""
);
empMainStaffsReqDTO
.
setAccountId
(
empMainDataResDTO
.
getUserId
()+
""
);
empMainStaffsReqDTO
.
setAccountName
(
empMainDataResDTO
.
getName
());
empMainStaffsReqDTO
.
setAccountName
(
empMainDataResDTO
.
getName
());
String
employeeNumber
=
empMainDataResDTO
.
getEmployeeNumber
();
//判断数据库中对应的邮箱是否存在
//判断数据库中对应的邮箱是否存在
String
companyEmail
=
empMainDataResDTO
.
getCompanyEmail
();
//
String companyEmail = empMainDataResDTO.getCompanyEmail();
if
(
beidouEmail
){
if
(
beidouEmail
){
empMainStaffsReqDTO
.
setEmail
(
companyEmail
);
if
(
StringUtils
.
isEmpty
(
employeeNumber
)){
empMainStaffsReqDTO
.
setEmail
(
null
);
}
else
{
//工号作为邮箱号
empMainStaffsReqDTO
.
setEmail
(
employeeNumber
);
}
}
else
{
}
else
{
empMainStaffsReqDTO
.
setEmail
(
null
);
empMainStaffsReqDTO
.
setEmail
(
null
);
}
}
...
...
src/main/resources/application.yml
View file @
a81ba901
...
@@ -131,7 +131,7 @@ beidou:
...
@@ -131,7 +131,7 @@ beidou:
#密钥
#密钥
secret
:
ajdjhfwjk123
secret
:
ajdjhfwjk123
#是否同步邮件
#是否同步邮件
email
:
fals
e
email
:
tru
e
#登录完成后回调业务地址
#登录完成后回调业务地址
consoleUrl
:
https://beidou.test.laiyifen.com
consoleUrl
:
https://beidou.test.laiyifen.com
...
...
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