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
1bf081fb
Commit
1bf081fb
authored
Apr 18, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:企微通讯录回调部门修改
parent
3ce80451
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
16 deletions
+7
-16
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+7
-16
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
1bf081fb
...
@@ -129,7 +129,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -129,7 +129,7 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"【成员部门同步回调处理】dto={}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"【成员部门同步回调处理】dto={}"
,
JSON
.
toJSONString
(
param
));
String
suiteId
=
dto
.
getSuiteId
();
String
suiteId
=
dto
.
getSuiteId
();
if
(!
SELF_APP
.
equals
(
suiteId
))
{
if
(!
SELF_APP
.
equals
(
suiteId
))
{
log
.
info
(
"通讯录只处理自建应用回调 dto={}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"通讯录只处理自建应用回调 dto={}"
,
JSON
.
toJSONString
(
param
));
return
;
return
;
}
}
//处理部门
//处理部门
...
@@ -314,27 +314,18 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -314,27 +314,18 @@ public class MessageApiServiceImpl implements MessageApiService {
String
authCorpId
=
qywxCallBackDTO
.
getAuthCorpId
();
String
authCorpId
=
qywxCallBackDTO
.
getAuthCorpId
();
DepartmentDTO
departmentDTO
=
new
DepartmentDTO
();
DepartmentDTO
departmentDTO
=
new
DepartmentDTO
();
departmentDTO
.
setIsStore
(
0
);
departmentDTO
.
setIsStore
(
0
);
TabHaobanWx
Enterprise
enterprise
=
this
.
enterpriseService
.
getEnterpriseByc
orpId
(
authCorpId
);
TabHaobanWx
Application
wxApplication
=
wxApplicationService
.
selectByC
orpId
(
authCorpId
);
if
(
enterprise
==
null
)
{
if
(
Objects
.
isNull
(
wxApplication
)
)
{
log
.
info
(
"
为查询到企业:authCorpId:{}"
,
authCorpId
);
log
.
info
(
"
授权企业不存在,{}"
,
qywxCallBackDTO
.
getAuthCorpId
()
);
return
;
return
;
}
}
String
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
wxApplication
.
getWxEnterpriseId
();
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
());
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
return
;
return
;
}
}
String
corpid
=
""
;
String
secret
=
secretSetting
.
getSecretVal
();
String
secret
=
secretSetting
.
getSecretVal
();
if
(
authCorpId
.
length
()
>
20
)
{
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
3
);
if
(
application
!=
null
)
{
corpid
=
application
.
getCorpid
();
}
}
else
{
corpid
=
authCorpId
;
}
TabHaobanDepartment
parentDepartment
=
new
TabHaobanDepartment
();
TabHaobanDepartment
parentDepartment
=
new
TabHaobanDepartment
();
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
,
wxEnterpriseId
);
parentDepartment
=
this
.
departmentService
.
getByWxId
(
qywxCallBackDTO
.
getParentId
()
+
""
,
wxEnterpriseId
);
...
@@ -350,7 +341,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -350,7 +341,7 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企微同步父部门不存在"
);
log
.
info
(
"企微同步父部门不存在"
);
return
;
return
;
}
}
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
deptDetail
=
qywxDepartmentApiService
.
getSelfDepartmentById
(
corpi
d
,
secret
,
wxDeptId
);
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
deptDetail
=
qywxDepartmentApiService
.
getSelfDepartmentById
(
authCorpI
d
,
secret
,
wxDeptId
);
departmentDTO
.
setDepartmentName
(
deptDetail
.
getName
());
departmentDTO
.
setDepartmentName
(
deptDetail
.
getName
());
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setChainId
(
parentDepartment
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setChainId
(
parentDepartment
.
getChainId
()
+
Constant
.
ID_SEPARATOR
+
parentDepartment
.
getDepartmentId
());
...
@@ -360,7 +351,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -360,7 +351,7 @@ public class MessageApiServiceImpl implements MessageApiService {
departmentDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
departmentDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
departmentDTO
.
setWxDepartmentId
(
wxDeptId
+
""
);
departmentDTO
.
setWxDepartmentId
(
wxDeptId
+
""
);
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
if
(
qywxCallBackDTO
.
getParentId
()
!=
null
)
{
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpi
d
,
secret
,
qywxCallBackDTO
.
getParentId
());
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
authCorpI
d
,
secret
,
qywxCallBackDTO
.
getParentId
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
wxDepartmentDTO
:
list
)
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
wxDepartmentDTO
:
list
)
{
if
(
Convert
.
toStr
(
wxDepartmentDTO
.
getId
()).
equals
(
departmentDTO
.
getDepartmentId
()))
{
if
(
Convert
.
toStr
(
wxDepartmentDTO
.
getId
()).
equals
(
departmentDTO
.
getDepartmentId
()))
{
...
...
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