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
1
Merge Requests
1
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
a74bcb88
Commit
a74bcb88
authored
Jun 28, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5cdbb856
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
122 deletions
+1
-122
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+1
-122
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
a74bcb88
...
...
@@ -236,128 +236,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
@Override
public
String
addMemberUnionidRelated
(
MemberUnionidRelatedDTO
dto
)
{
log
.
info
(
"【新增外部联系人回调】dto={}"
,
JSON
.
toJSONString
(
dto
));
String
corpId
=
dto
.
getCorpid
();
TabHaobanWxEnterprise
wxEnterprise
=
wxEnterpriseService
.
getEnterpriseBycorpId
(
corpId
);
if
(
wxEnterprise
==
null
){
return
""
;
}
String
suiteid
=
dto
.
getSuiteid
();
String
unionIdJson
=
""
;
if
(
SELF_APP
.
equals
(
suiteid
)){
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
wxEnterprise
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CONTACT_CUSTOMER
.
getVal
());
if
(
null
==
secretSetting
)
{
log
.
info
(
"没有配置secret"
);
return
""
;
}
unionIdJson
=
qywxUserApiService
.
getCorpSelfExternalUseridInfo
(
dto
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
dto
.
getExternalUserid
());
}
else
{
unionIdJson
=
qywxUserApiService
.
getExternalUseridInfo
(
dto
.
getCorpid
(),
dto
.
getSuiteid
(),
dto
.
getExternalUserid
());
}
String
userId1
=
dto
.
getWxUserId
();
log
.
info
(
"【新增外部联系人回调】unionIdJson={}"
,
JSON
.
toJSONString
(
unionIdJson
));
String
unionId
=
""
;
String
name
=
""
;
String
follow_user
=
""
;
String
createTime
=
""
;
String
userId
=
""
;
String
avatar
=
""
;
String
relaName
=
""
;
if
(
StringUtils
.
isNotBlank
(
unionIdJson
)){
JSONObject
jo
=
JSON
.
parseObject
(
unionIdJson
);
String
external_contact
=
jo
.
getString
(
"external_contact"
);
if
(
StringUtils
.
isNotBlank
(
external_contact
)){
JSONObject
jt
=
JSON
.
parseObject
(
external_contact
);
unionId
=
jt
.
getString
(
"unionid"
);
name
=
EmojiFilterUtil
.
filterEmojiLast
(
jt
.
getString
(
"name"
),
true
);
relaName
=
EmojiFilterUtil
.
filterEmojiLast
(
jt
.
getString
(
"name"
),
true
);
avatar
=
jt
.
getString
(
"avatar"
);
}
follow_user
=
jo
.
getString
(
"follow_user"
);
if
(
StringUtils
.
isNotBlank
(
follow_user
)){
JSONArray
j
=
JSON
.
parseArray
(
follow_user
);
for
(
Object
object
:
j
)
{
String
followJson
=
JSON
.
toJSONString
(
object
);
JSONObject
follow
=
JSON
.
parseObject
(
followJson
);
userId
=
follow
.
getString
(
"userid"
);
if
(
userId
.
equals
(
userId1
)){
createTime
=
follow
.
getString
(
"createtime"
);
}
}
}
}
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userId1
,
wxEnterprise
.
getWxEnterpriseId
());
if
(
staff
==
null
){
return
""
;
}
TabHaobanClerkMainStoreRelated
r
=
clerkMainStoreRelatedService
.
selectByWxEnterpriseIdAndStoreId
(
staff
.
getStaffId
(),
wxEnterprise
.
getWxEnterpriseId
());
if
(
r
==
null
){
log
.
info
(
"【新增外部联系人】主门店为空"
);
return
""
;
}
StoreDTO
mainStore
=
null
;
mainStore
=
storeService
.
getStore
(
r
.
getStoreId
());
if
(
mainStore
==
null
){
log
.
info
(
"【新增外部联系人】门店为空"
);
return
""
;
}
String
key
=
"external"
+
mainStore
.
getEnterpriseId
()
+
"_"
+
userId1
+
"_"
+
name
+
"_"
+
createTime
;
RedisUtil
.
lock
(
key
,
2
l
);
dto
.
setWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
dto
.
setEnterpriseId
(
mainStore
.
getEnterpriseId
());
MemberDTO
member
=
null
;
if
(
SELF_APP
.
equals
(
suiteid
)){
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staff
.
getStaffId
(),
r
.
getStoreId
());
if
(
staffClerkRelationDTO
==
null
){
log
.
info
(
"【新增外部联系人】主门店未绑定"
);
return
""
;
}
String
clerkCode
=
staffClerkRelationDTO
.
getClerkCode
();
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
mainStore
.
getEnterpriseId
(),
clerkCode
);
log
.
info
(
"【新增外部联系人】clerkCode={},unionid:{}"
,
clerkCode
,
unionId
);
if
(
clerk
!=
null
&&
StringUtils
.
isNotBlank
(
clerk
.
getQrcodeParam
())&&
StringUtils
.
isNotBlank
(
unionId
)){
log
.
info
(
"【新增外部联系人会员】enterpriseId={},unionId={},name={},avatar={},QrcodeParam={}"
,
mainStore
.
getEnterpriseId
(),
unionId
,
name
,
avatar
,
clerk
.
getQrcodeParam
());
member
=
memberOpenCardBusinessService
.
getMemberByQywxChannelParam
(
mainStore
.
getEnterpriseId
(),
unionId
,
""
,
relaName
,
avatar
,
clerk
.
getQrcodeParam
());
}
log
.
info
(
"【新增外部联系人】member={},clerk={}"
,
JSON
.
toJSONString
(
member
),
JSON
.
toJSONString
(
clerk
));
if
(
member
!=
null
){
dto
.
setMemberId
(
member
.
getMemberId
());
}
}
dto
.
setSelfExternalUserid
(
dto
.
getExternalUserid
());
dto
.
setUnionid
(
unionId
);
dto
.
setExternalName
(
name
);
dto
.
setAddCreateTime
(
createTime
);
if
(
StringUtils
.
isBlank
(
unionId
)){
return
""
;
}
dto
.
setSuiteid
(
wxEnterprise
.
getWxSecretKey
());
MemberUnionidRelatedDTO
exsitDTO
=
memberUnionRelatedService
.
getByParams
(
dto
.
getWxUserId
(),
mainStore
.
getEnterpriseId
(),
name
,
createTime
);
String
uuid
=
""
;
if
(
exsitDTO
==
null
){
uuid
=
memberUnionRelatedService
.
addMemberUnionidRelated
(
dto
);
}
else
{
//如果是自建更新uuid
if
(
SELF_APP
.
equals
(
suiteid
)){
exsitDTO
.
setUnionid
(
unionId
);
exsitDTO
.
setMemberId
(
dto
.
getMemberId
());
}
else
{
//更新对外联系人id
exsitDTO
.
setExternalUserid
(
dto
.
getExternalUserid
());
}
memberUnionRelatedService
.
update
(
exsitDTO
);
uuid
=
exsitDTO
.
getMemberUnionidRelatedId
();
}
return
uuid
;
return
addMemberUnionidRelatedNew
(
dto
);
}
...
...
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