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
b2d22054
Commit
b2d22054
authored
Apr 20, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自建-通讯录
parent
46fcfda0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+1
-1
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+5
-2
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+9
-10
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
b2d22054
...
@@ -535,7 +535,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
...
@@ -535,7 +535,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
unlockTask
(
wxEnterpriseId
);
unlockTask
(
wxEnterpriseId
);
return
"没有配置secret"
;
return
"没有配置secret"
;
}
}
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
qywxDepartmentApiService
.
listSelfDepartment
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
1
);
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
qywxDepartmentApiService
.
listSelfDepartment
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
1
,
qwDTO
.
getUrlHost
()
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
logger
.
info
(
"没有数据同步"
);
logger
.
info
(
"没有数据同步"
);
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
exception_close
.
getVal
());
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
exception_close
.
getVal
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
b2d22054
...
@@ -13,6 +13,7 @@ import com.gic.haoban.common.utils.StringUtil;
...
@@ -13,6 +13,7 @@ import com.gic.haoban.common.utils.StringUtil;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentShortDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentShortDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
...
@@ -207,7 +208,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -207,7 +208,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
RedisUtil
.
getCache
(
key
)
==
null
)
{
if
(
RedisUtil
.
getCache
(
key
)
==
null
)
{
RedisUtil
.
setCache
(
key
,
1
,
60
*
60L
);
RedisUtil
.
setCache
(
key
,
1
,
60
*
60L
);
String
taskId
=
StringUtil
.
randomUUID
();
String
taskId
=
StringUtil
.
randomUUID
();
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
null
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
null
,
qwDTO
.
getUrlHost
());
logger
.
info
(
"企业所有部门数据:{}"
,
JSON
.
toJSONString
(
list
));
logger
.
info
(
"企业所有部门数据:{}"
,
JSON
.
toJSONString
(
list
));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
,
corpid
,
contactSecret
,
taskId
);
this
.
addAllDepartment
(
list
,
0
,
wxEnterpriseId
,
corpid
,
contactSecret
,
taskId
);
...
@@ -225,7 +227,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -225,7 +227,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
String
corpid
=
json
.
getString
(
"corpid"
);
String
corpid
=
json
.
getString
(
"corpid"
);
String
contactSecret
=
json
.
getString
(
"contactSecret"
);
String
contactSecret
=
json
.
getString
(
"contactSecret"
);
String
taskId
=
json
.
getString
(
"taskId"
);
String
taskId
=
json
.
getString
(
"taskId"
);
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
parentId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
corpid
,
contactSecret
,
parentId
,
qwDTO
.
getUrlHost
());
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
handerList
=
new
ArrayList
<>();
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
handerList
=
new
ArrayList
<>();
if
(
parentId
.
equals
(
0
))
{
if
(
parentId
.
equals
(
0
))
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
list
)
{
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
list
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
b2d22054
...
@@ -196,12 +196,12 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -196,12 +196,12 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param enterpriseId
* @param enterpriseId
* @param secret
* @param secret
*/
*/
private
void
dealClerkUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
,
String
secret
,
String
staffName
)
{
private
void
dealClerkUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
,
String
secret
,
String
staffName
,
WxEnterpriseQwDTO
qwDTO
)
{
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
String
mainDeptId
=
dto
.
getMainDepartment
();
String
mainDeptId
=
dto
.
getMainDepartment
();
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departments
=
qywxDepartmentApiService
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departments
=
qywxDepartmentApiService
.
listSelfDepartment
(
dto
.
getAuthCorpId
(),
secret
,
Integer
.
valueOf
(
mainDeptId
));
.
listSelfDepartment
(
dto
.
getAuthCorpId
(),
secret
,
Integer
.
valueOf
(
mainDeptId
)
,
qwDTO
.
getUrlHost
()
);
if
(
CollectionUtils
.
isEmpty
(
departments
))
{
if
(
CollectionUtils
.
isEmpty
(
departments
))
{
log
.
info
(
"通过主部门查询部门列表为空 mainDeptId:{}"
,
mainDeptId
);
log
.
info
(
"通过主部门查询部门列表为空 mainDeptId:{}"
,
mainDeptId
);
return
;
return
;
...
@@ -243,7 +243,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -243,7 +243,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
}
String
wxEnterpriseId
=
wxEnterprise
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
wxEnterprise
.
getWxEnterpriseId
();
String
changeType
=
qywxCallBackDTO
.
getChangeType
();
String
changeType
=
qywxCallBackDTO
.
getChangeType
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
changeType
.
equals
(
WxEditType
.
ADD_USER
.
getCode
()))
{
if
(
changeType
.
equals
(
WxEditType
.
ADD_USER
.
getCode
()))
{
log
.
info
(
"成员同步新增,userid:{}"
,
userid
);
log
.
info
(
"成员同步新增,userid:{}"
,
userid
);
// 新增
// 新增
...
@@ -253,7 +253,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -253,7 +253,7 @@ public class MessageApiServiceImpl implements MessageApiService {
if
(
suitWxEnterpriseIid
)
{
if
(
suitWxEnterpriseIid
)
{
String
staffName
=
Convert
.
toStr
(
serviceResponse
.
getResult
());
String
staffName
=
Convert
.
toStr
(
serviceResponse
.
getResult
());
// 鸿星尔克定制
// 鸿星尔克定制
dealErKe
(
qywxCallBackDTO
,
wxEnterpriseId
,
staffName
);
dealErKe
(
qywxCallBackDTO
,
wxEnterpriseId
,
staffName
,
qwDTO
);
}
}
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATE_USER
.
getCode
()))
{
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATE_USER
.
getCode
()))
{
log
.
info
(
"成员同步修改,userid:{}"
,
userid
);
log
.
info
(
"成员同步修改,userid:{}"
,
userid
);
...
@@ -261,7 +261,6 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -261,7 +261,6 @@ public class MessageApiServiceImpl implements MessageApiService {
TabHaobanStaff
oldStaff
=
this
.
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
TabHaobanStaff
oldStaff
=
this
.
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
if
(
oldStaff
==
null
)
{
if
(
oldStaff
==
null
)
{
//员工可能修改userId,需要拿到openUserId再去查询一次
//员工可能修改userId,需要拿到openUserId再去查询一次
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
qwDTO
!=
null
&&
(
qwDTO
.
getWxSecurityType
()
==
1
||
qwDTO
.
getWxSecurityType
()
==
3
)){
if
(
qwDTO
!=
null
&&
(
qwDTO
.
getWxSecurityType
()
==
1
||
qwDTO
.
getWxSecurityType
()
==
3
)){
String
openUserid
=
getOpenUserid
(
userid
,
qwDTO
);
String
openUserid
=
getOpenUserid
(
userid
,
qwDTO
);
if
(
StringUtils
.
isNotBlank
(
openUserid
)){
if
(
StringUtils
.
isNotBlank
(
openUserid
)){
...
@@ -336,7 +335,6 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -336,7 +335,6 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"没有配置secret,wxEnterpriseId:{}"
,
wxEnterpriseId
);
log
.
info
(
"没有配置secret,wxEnterpriseId:{}"
,
wxEnterpriseId
);
return
;
return
;
}
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
corpId
,
secretSetting
.
getSecretVal
(),
userid
,
qwDTO
.
getUrlHost
());
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
corpId
,
secretSetting
.
getSecretVal
(),
userid
,
qwDTO
.
getUrlHost
());
if
(
null
!=
user
)
{
if
(
null
!=
user
)
{
Integer
status
=
user
.
getStatus
();
Integer
status
=
user
.
getStatus
();
...
@@ -404,6 +402,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -404,6 +402,7 @@ public class MessageApiServiceImpl implements MessageApiService {
return
;
return
;
}
}
String
wxEnterpriseId
=
wxApplication
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
wxApplication
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
...
@@ -427,7 +426,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -427,7 +426,7 @@ public class MessageApiServiceImpl implements MessageApiService {
return
;
return
;
}
}
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
deptDetail
=
qywxDepartmentApiService
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
deptDetail
=
qywxDepartmentApiService
.
getSelfDepartmentById
(
authCorpId
,
secret
,
wxDeptId
);
.
getSelfDepartmentById
(
authCorpId
,
secret
,
wxDeptId
,
qwDTO
.
getUrlHost
()
);
departmentDTO
.
setDepartmentName
(
deptDetail
.
getName
());
departmentDTO
.
setDepartmentName
(
deptDetail
.
getName
());
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setParentDepartmentId
(
parentDepartment
.
getDepartmentId
());
departmentDTO
.
setChainId
(
departmentDTO
.
setChainId
(
...
@@ -439,7 +438,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -439,7 +438,7 @@ public class MessageApiServiceImpl implements MessageApiService {
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
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
list
=
this
.
qywxDepartmentApiService
.
listSelfDepartment
(
authCorpId
,
secret
,
qywxCallBackDTO
.
getParentId
());
.
listSelfDepartment
(
authCorpId
,
secret
,
qywxCallBackDTO
.
getParentId
()
,
qwDTO
.
getUrlHost
()
);
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
()))
{
...
@@ -490,7 +489,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -490,7 +489,7 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param qywxCallBackDTO
* @param qywxCallBackDTO
* @param wxEnterpriseId
* @param wxEnterpriseId
*/
*/
private
void
dealErKe
(
QywxCallBackDTO
qywxCallBackDTO
,
String
wxEnterpriseId
,
String
staffName
)
{
private
void
dealErKe
(
QywxCallBackDTO
qywxCallBackDTO
,
String
wxEnterpriseId
,
String
staffName
,
WxEnterpriseQwDTO
qwDTO
)
{
log
.
info
(
"成员同步定制化开始"
);
log
.
info
(
"成员同步定制化开始"
);
// 处理定制-目前鸿星尔克用
// 处理定制-目前鸿星尔克用
boolean
checkErkeDeal
=
checkErkeDeal
(
qywxCallBackDTO
);
boolean
checkErkeDeal
=
checkErkeDeal
(
qywxCallBackDTO
);
...
@@ -509,7 +508,7 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -509,7 +508,7 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
return
;
return
;
}
}
dealClerkUser
(
qywxCallBackDTO
,
relatedList
.
get
(
0
).
getEnterpriseId
(),
secretSetting
.
getSecretVal
(),
staffName
);
dealClerkUser
(
qywxCallBackDTO
,
relatedList
.
get
(
0
).
getEnterpriseId
(),
secretSetting
.
getSecretVal
(),
staffName
,
qwDTO
);
log
.
info
(
"成员同步定制化结束"
);
log
.
info
(
"成员同步定制化结束"
);
}
}
...
...
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