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
8dda1f6e
Commit
8dda1f6e
authored
Mar 18, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:同步通讯录修改
parent
e86462bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+1
-1
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+10
-8
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+2
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
8dda1f6e
...
...
@@ -42,7 +42,7 @@ public interface StaffApiService {
* @param userId
* @param wxEnterpriseId
*/
void
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
);
ServiceResponse
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
);
/**
* 成员修改
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
8dda1f6e
...
...
@@ -8,6 +8,7 @@ import com.gic.clerk.api.service.ClerkService;
import
com.gic.commons.util.*
;
import
com.gic.haoban.app.customer.service.api.service.InnerApiService
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.AppPageType
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
...
...
@@ -125,8 +126,8 @@ public class MessageApiServiceImpl implements MessageApiService {
QywxCallBackDTO
dto
=
JSON
.
parseObject
(
param
,
QywxCallBackDTO
.
class
);
log
.
info
(
"【成员部门同步回调处理】dto={}"
,
JSON
.
toJSONString
(
param
));
String
suiteId
=
dto
.
getSuiteId
();
if
(
CONTACT_APP
.
equals
(
suiteId
)
||
SELF_APP
.
equals
(
suiteId
))
{
log
.
info
(
"
自建
和客户联系回调不处理"
);
if
(
!
SELF_APP
.
equals
(
suiteId
))
{
log
.
info
(
"
好办
和客户联系回调不处理"
);
return
;
}
//处理成员
...
...
@@ -177,7 +178,7 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param enterpriseId
* @param secret
*/
private
void
dealClerkUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
,
String
secret
)
{
private
void
dealClerkUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
,
String
secret
,
String
staffName
)
{
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
String
mainDeptId
=
dto
.
getMainDepartment
();
...
...
@@ -191,7 +192,7 @@ public class MessageApiServiceImpl implements MessageApiService {
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
mainDept
=
departmentIdMap
.
get
(
Integer
.
valueOf
(
mainDeptId
));
clerkQwDTO
.
setStoreName
(
mainDept
.
getName
());
clerkQwDTO
.
setClerkCode
(
dto
.
getUserid
());
clerkQwDTO
.
setClerkName
(
dto
.
getUserName
()
);
clerkQwDTO
.
setClerkName
(
staffName
);
clerkQwDTO
.
setClerkType
(
dto
.
getIsLeaderInDept
()[
0
]);
clerkQwDTO
.
setClerkGener
(
dto
.
getGender
());
clerkQwDTO
.
setPhoneNumber
(
dto
.
getMobile
());
...
...
@@ -223,12 +224,13 @@ public class MessageApiServiceImpl implements MessageApiService {
if
(
changeType
.
equals
(
WxEditType
.
ADD_USER
.
getCode
()))
{
log
.
info
(
"成员同步新增,userid:{}"
,
userid
);
//新增
this
.
staffApiService
.
wxGetAdd
(
userid
,
wxEnterpriseId
);
ServiceResponse
serviceResponse
=
this
.
staffApiService
.
wxGetAdd
(
userid
,
wxEnterpriseId
);
// 校验适用企业-定制
boolean
suitWxEnterpriseIid
=
checkSuitEnterpriseId
(
wxEnterpriseId
);
if
(
suitWxEnterpriseIid
)
{
String
staffName
=
Convert
.
toStr
(
serviceResponse
.
getResult
());
//鸿星尔克定制
dealErKe
(
qywxCallBackDTO
,
wxEnterpriseId
);
dealErKe
(
qywxCallBackDTO
,
wxEnterpriseId
,
staffName
);
}
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATE_USER
.
getCode
()))
{
log
.
info
(
"成员同步修改,userid:{}"
,
userid
);
...
...
@@ -406,7 +408,7 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param qywxCallBackDTO
* @param wxEnterpriseId
*/
private
void
dealErKe
(
QywxCallBackDTO
qywxCallBackDTO
,
String
wxEnterpriseId
)
{
private
void
dealErKe
(
QywxCallBackDTO
qywxCallBackDTO
,
String
wxEnterpriseId
,
String
staffName
)
{
log
.
info
(
"成员同步定制化开始"
);
// 处理定制-目前鸿星尔克用
boolean
checkErkeDeal
=
checkErkeDeal
(
qywxCallBackDTO
);
...
...
@@ -424,7 +426,7 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"没有配置secret:{}"
,
wxEnterpriseId
);
return
;
}
dealClerkUser
(
qywxCallBackDTO
,
relatedList
.
get
(
0
).
getEnterpriseId
(),
secretSetting
.
getSecretVal
());
dealClerkUser
(
qywxCallBackDTO
,
relatedList
.
get
(
0
).
getEnterpriseId
(),
secretSetting
.
getSecretVal
()
,
staffName
);
log
.
info
(
"成员同步定制化结束"
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
8dda1f6e
...
...
@@ -509,10 +509,11 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
void
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
)
{
public
ServiceResponse
wxGetAdd
(
String
userId
,
String
wxEnterpriseId
)
{
RedisUtil
.
lock
(
"haoban_add_user"
+
wxEnterpriseId
+
userId
,
2L
);
ServiceResponse
wxSaveNew
=
getWxSaveNew
(
userId
,
wxEnterpriseId
);
logger
.
info
(
"信息:{}"
,
JSONObject
.
toJSONString
(
wxSaveNew
));
return
wxSaveNew
;
}
@Override
...
...
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