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
9699537c
Commit
9699537c
authored
Jan 25, 2022
by
xugaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[鸿星尔克定制开发]:回调处理,更改店员接口调用
parent
a9aaddee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+28
-7
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
9699537c
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.out.impl;
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.clerk.api.dto.ClerkQwDTO
;
import
com.gic.clerk.api.dto.ClerkQwDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.GlobalInfo
;
...
@@ -38,6 +39,8 @@ import org.springframework.stereotype.Service;
...
@@ -38,6 +39,8 @@ import org.springframework.stereotype.Service;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* 接收企业微信或者gic推送消息进行处理
* 接收企业微信或者gic推送消息进行处理
...
@@ -84,6 +87,8 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -84,6 +87,8 @@ public class MessageApiServiceImpl implements MessageApiService {
@Autowired
@Autowired
private
WxEnterpriseRelatedService
wxEnterpriseRelatedService
;
private
WxEnterpriseRelatedService
wxEnterpriseRelatedService
;
@Autowired
private
ClerkService
clerkService
;
@Override
@Override
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
...
@@ -134,8 +139,8 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -134,8 +139,8 @@ public class MessageApiServiceImpl implements MessageApiService {
return
;
return
;
}
}
ServiceResponse
response
=
staffApiService
.
getWxSaveNew
(
dto
.
getUserid
(),
enterprise
.
getWxEnterpriseId
());
ServiceResponse
response
=
staffApiService
.
getWxSaveNew
(
dto
.
getUserid
(),
enterprise
.
getWxEnterpriseId
());
if
(
response
.
getCode
()
!=
1
){
if
(
response
.
getCode
()
!=
1
)
{
log
.
info
(
"添加企业员工失败
参数:{}"
,
response
.
getMessage
());
log
.
info
(
"添加企业员工失败
:{}"
,
response
.
getMessage
());
return
;
return
;
}
}
// 取第一个企业的id
// 取第一个企业的id
...
@@ -155,6 +160,14 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -155,6 +160,14 @@ public class MessageApiServiceImpl implements MessageApiService {
// }
// }
}
}
/**
* desc: 鸿星尔克定制需求校验-后期可扩展为配置形式
*
* @param dto dto
* @return : {@link boolean}
* @author : YongEn
* @date : 2022/1/25
*/
private
boolean
checkErkeDeal
(
QywxCallBackDTO
dto
)
{
private
boolean
checkErkeDeal
(
QywxCallBackDTO
dto
)
{
if
(
Objects
.
isNull
(
dto
)
||
StringUtils
.
isEmpty
(
dto
.
getUserid
()))
{
if
(
Objects
.
isNull
(
dto
)
||
StringUtils
.
isEmpty
(
dto
.
getUserid
()))
{
return
false
;
return
false
;
...
@@ -170,16 +183,24 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -170,16 +183,24 @@ public class MessageApiServiceImpl implements MessageApiService {
private
void
doDealUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
)
{
private
void
doDealUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
)
{
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
// TODO: 2022/1/24 获取部门名称
String
mainDeptId
=
dto
.
getMainDepartment
();
clerkQwDTO
.
setStoreName
(
""
);
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departments
=
qywxDepartmentApiService
.
listDepartment
(
dto
.
getAuthCorpId
(),
dto
.
getSuiteId
(),
Integer
.
valueOf
(
mainDeptId
));
if
(
CollectionUtils
.
isEmpty
(
departments
))
{
log
.
info
(
"通过主部门查询部门列表为空 mainDeptId:{}"
,
mainDeptId
);
return
;
}
Map
<
Integer
,
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departmentIdMap
=
departments
.
stream
()
.
collect
(
Collectors
.
toMap
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
::
getId
,
Function
.
identity
(),
(
a
,
b
)
->
a
));
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
mainDept
=
departmentIdMap
.
get
(
Integer
.
valueOf
(
mainDeptId
));
clerkQwDTO
.
setStoreName
(
mainDept
.
getName
());
clerkQwDTO
.
setClerkCode
(
dto
.
getUserid
());
clerkQwDTO
.
setClerkCode
(
dto
.
getUserid
());
clerkQwDTO
.
setClerkName
(
dto
.
getUserName
());
clerkQwDTO
.
setClerkName
(
dto
.
getUserName
());
// TODO: 2022/1/24 数组第一个
clerkQwDTO
.
setClerkType
(
dto
.
getIsLeaderInDept
()[
0
]);
clerkQwDTO
.
setClerkType
(
1
);
clerkQwDTO
.
setClerkGener
(
dto
.
getGender
());
clerkQwDTO
.
setClerkGener
(
dto
.
getGender
());
clerkQwDTO
.
setPhoneNumber
(
dto
.
getMobile
());
clerkQwDTO
.
setPhoneNumber
(
dto
.
getMobile
());
clerkQwDTO
.
setNationcode
(
dto
.
getTelephone
());
clerkQwDTO
.
setNationcode
(
dto
.
getTelephone
());
// TODO: 2022/1/24 调用接口
// 调用换导购接口逻辑
clerkService
.
syncClerkForQw
(
clerkQwDTO
);
}
}
private
void
dealDepartment
(
QywxCallBackDTO
qywxCallBackDTO
)
{
private
void
dealDepartment
(
QywxCallBackDTO
qywxCallBackDTO
)
{
...
...
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