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
38be5df2
Commit
38be5df2
authored
Mar 08, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:成员同步日志
parent
4b070b44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+12
-7
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
38be5df2
...
...
@@ -115,7 +115,7 @@ public class MessageApiServiceImpl implements MessageApiService {
@Override
public
void
dealWxMessage
(
String
param
)
{
QywxCallBackDTO
dto
=
JSON
.
parseObject
(
param
,
QywxCallBackDTO
.
class
);
log
.
info
(
"【成员回调处理】dto={}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"【成员
同步
回调处理】dto={}"
,
JSON
.
toJSONString
(
param
));
TabHaobanWxApplication
wxApplication
=
wxApplicationService
.
selectByCorpId
(
dto
.
getAuthCorpId
());
if
(
Objects
.
isNull
(
wxApplication
))
{
log
.
info
(
"通过corpId:【{}】未查询到授权企业,无法处理"
,
dto
.
getAuthCorpId
());
...
...
@@ -125,6 +125,7 @@ public class MessageApiServiceImpl implements MessageApiService {
// 校验适用企业-定制
boolean
suitWxEnterpriseIid
=
checkSuitEnterpriseId
(
wxEnterpriseId
);
if
(
suitWxEnterpriseIid
)
{
log
.
info
(
"成员同步定制化开始"
);
// 处理定制-目前鸿星尔克用
boolean
checkErkeDeal
=
checkErkeDeal
(
dto
);
if
(!
checkErkeDeal
)
{
...
...
@@ -153,6 +154,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
// 取第一个企业的id
doDealUser
(
dto
,
relatedList
.
get
(
0
).
getEnterpriseId
(),
secretSetting
.
getSecretVal
());
log
.
info
(
"成员同步定制化结束"
);
}
else
{
dealUser
(
dto
);
}
...
...
@@ -227,15 +229,15 @@ public class MessageApiServiceImpl implements MessageApiService {
String
changeType
=
qywxCallBackDTO
.
getChangeType
();
if
(
changeType
.
equals
(
WxEditType
.
ADDUSER
.
getCode
()))
{
log
.
info
(
"成员新增,userid:{}"
,
userid
);
log
.
info
(
"成员
同步
新增,userid:{}"
,
userid
);
//新增
this
.
staffApiService
.
wxGetAdd
(
userid
,
wxEnterpriseId
);
}
else
if
(
changeType
.
equals
(
WxEditType
.
UPDATEUSER
.
getCode
()))
{
log
.
info
(
"成员修改,userid:{}"
,
userid
);
log
.
info
(
"成员
同步
修改,userid:{}"
,
userid
);
//修改
TabHaobanStaff
oldStaff
=
this
.
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
if
(
oldStaff
==
null
)
{
log
.
error
(
"成员更新失败,无历史员工数据:userid:{},wxEnterpriseId:{}"
,
userid
,
wxEnterpriseId
);
log
.
error
(
"成员
同步
更新失败,无历史员工数据:userid:{},wxEnterpriseId:{}"
,
userid
,
wxEnterpriseId
);
return
;
}
TabHaobanStaff
staff
=
new
TabHaobanStaff
();
...
...
@@ -261,7 +263,7 @@ public class MessageApiServiceImpl implements MessageApiService {
for
(
String
s
:
departArr
)
{
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
s
,
wxEnterpriseId
);
if
(
department
==
null
)
{
log
.
info
(
"部门不存在"
);
log
.
info
(
"
成员同步,
部门不存在"
);
continue
;
}
departmentIds
.
append
(
department
.
getDepartmentId
()).
append
(
","
);
...
...
@@ -278,11 +280,11 @@ public class MessageApiServiceImpl implements MessageApiService {
StaffDTO
staffDTO
=
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
);
staffApiService
.
staffEdit
(
staffDTO
,
departmentIds
.
toString
());
}
else
if
(
changeType
.
equals
(
WxEditType
.
DELETEUSER
.
getCode
()))
{
log
.
info
(
"成员删除,userid:{}"
,
userid
);
log
.
info
(
"成员
同步
删除,userid:{}"
,
userid
);
//删除
TabHaobanStaff
oldStaff
=
this
.
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
if
(
oldStaff
==
null
)
{
log
.
info
(
"微信同步删除的门店不存在,{}"
,
userid
);
log
.
info
(
"微信
成员
同步删除的门店不存在,{}"
,
userid
);
return
;
}
//销毁卡券
...
...
@@ -291,7 +293,10 @@ public class MessageApiServiceImpl implements MessageApiService {
this
.
staffDepartmentRelatedService
.
delByUserid
(
userid
);
//删除员工表
this
.
staffService
.
delByStaffId
(
oldStaff
.
getStaffId
());
}
else
{
log
.
error
(
"成员同步类型错误,changeType:{}"
,
changeType
);
}
log
.
error
(
"成员同步结束"
);
}
private
String
changeHeaderImageUrl
(
String
headImgUrl
)
{
...
...
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