Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
bd0e85da
Commit
bd0e85da
authored
Feb 23, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加日志
parent
b1e7b81c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+8
-8
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
bd0e85da
...
...
@@ -122,7 +122,8 @@ public class MessageApiServiceImpl implements MessageApiService {
departmentDTO
.
setDepartmentName
(
qywxCallBackDTO
.
getDepartmentName
());
departmentDTO
.
setIsStore
(
0
);
departmentDTO
.
setRelatedId
(
qywxCallBackDTO
.
getId
()+
""
);
TabHaobanDepartment
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
);
TabHaobanWxEnterprise
enterprise
=
this
.
enterpriseService
.
getEnterpriseBycorpId
(
qywxCallBackDTO
.
getAuthCorpId
());
TabHaobanDepartment
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
,
enterprise
.
getWxEnterpriseId
());
if
(
parentDepartment
==
null
){
return
;
}
...
...
@@ -130,14 +131,13 @@ public class MessageApiServiceImpl implements MessageApiService {
departmentDTO
.
setChainId
(
parentDepartment
.
getChainId
()+
Constant
.
ID_SEPARATOR
+
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setChainName
(
parentDepartment
.
getChainName
()
+
Constant
.
NAME_SEPARATOR
+
parentDepartment
.
getChainName
());
departmentDTO
.
setLevel
(
parentDepartment
.
getLevel
()
+
1
);
TabHaobanWxEnterprise
enterprise
=
this
.
enterpriseService
.
getEnterpriseBycorpId
(
qywxCallBackDTO
.
getAuthCorpId
());
departmentDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
departmentDTO
.
setWxDepartmentId
(
qywxCallBackDTO
.
getId
()+
""
);
if
(
qywxCallBackDTO
.
getChangeType
().
equals
(
WxEditType
.
ADDDEPART
.
getCode
())){
String
response
=
this
.
departmentService
.
add
(
departmentDTO
);
log
.
info
(
"微信同步新增部门:{}"
,
JSON
.
toJSONString
(
response
));
}
else
if
(
qywxCallBackDTO
.
getChangeType
().
equals
(
WxEditType
.
UPDATEDEPART
.
getCode
())){
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
if
(
department
==
null
){
String
response
=
this
.
departmentService
.
add
(
departmentDTO
);
log
.
info
(
"微信同步新增部门:{}"
,
JSON
.
toJSONString
(
response
));
...
...
@@ -147,7 +147,7 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企业微信更新同步完成"
);
}
}
else
{
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getId
()
+
""
,
enterprise
.
getWxEnterpriseId
()
);
if
(
department
==
null
){
log
.
info
(
"微信同步删除部门不存在"
);
}
else
{
...
...
@@ -178,7 +178,7 @@ public class MessageApiServiceImpl implements MessageApiService {
staff
.
setStaffId
(
oldStaff
.
getStaffId
());
this
.
staffService
.
updateByPrimaryKey
(
staff
);
this
.
staffDepartmentRelatedService
.
delByUserid
(
qywxCallBackDTO
.
getUserid
());
this
.
addUserDepart
(
qywxCallBackDTO
,
oldStaff
.
getStaffId
());
this
.
addUserDepart
(
qywxCallBackDTO
,
oldStaff
.
getStaffId
()
,
enterprise
.
getWxEnterpriseId
()
);
}
else
{
this
.
addUser
(
qywxCallBackDTO
,
staff
);
}
...
...
@@ -199,14 +199,14 @@ public class MessageApiServiceImpl implements MessageApiService {
private
void
addUser
(
QywxCallBackDTO
qywxCallBackDTO
,
TabHaobanStaff
staff
){
String
add
=
this
.
staffService
.
add
(
staff
);
log
.
info
(
"新增用户返回结果:{}"
,
add
);
this
.
addUserDepart
(
qywxCallBackDTO
,
add
);
this
.
addUserDepart
(
qywxCallBackDTO
,
add
,
staff
.
getWxEnterpriseId
()
);
}
private
void
addUserDepart
(
QywxCallBackDTO
qywxCallBackDTO
,
String
staffId
){
private
void
addUserDepart
(
QywxCallBackDTO
qywxCallBackDTO
,
String
staffId
,
String
wxEnterpriseId
){
String
[]
departArr
=
qywxCallBackDTO
.
getDepartment
();
if
(
departArr
!=
null
){
for
(
String
s
:
departArr
){
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
s
);
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
s
,
wxEnterpriseId
);
if
(
department
==
null
){
log
.
info
(
"部门不存在"
);
continue
;
...
...
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