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
12281917
Commit
12281917
authored
Jul 20, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活码unionid
parent
5cea527f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+19
-18
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
12281917
...
...
@@ -314,6 +314,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String
externalUserId
=
dto
.
getExternalUserid
();
String
unionid
=
dto
.
getUnionid
();
String
state
=
dto
.
getState
();
boolean
isHmUnionid
=
false
;
log
.
info
(
"新增外部联系人,wxEnterpriseId:{}"
,
wxEnterpriseId
);
if
(
StringUtils
.
isAnyBlank
(
wxUserId
,
wxEnterpriseId
,
name
,
createTime
,
externalUserId
))
{
log
.
error
(
"新增外部联系人,缺少必须字段:wxUserId:{},wxEnterpriseId:{},name:{},createTime:{},externalUserId:{}"
,
wxUserId
,
wxEnterpriseId
,
name
,
createTime
,
externalUserId
);
...
...
@@ -331,21 +332,20 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
dto
.
setWxUserId
(
staffWxUserId
);
StaffClerkRelationDTO
staffClerkRelationDTO
=
null
;
//活码处理 "DT" "HM"
Long
refId
=
0L
;
WxUserAddLogQDTO
wxUserAddLogQDTO
=
new
WxUserAddLogQDTO
();
HmQrcodeDTO
hmQrcodeDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
state
))
{
String
id
=
state
.
substring
(
2
);
if
(
state
.
contains
(
Manage3Constants
.
HM
))
{
//活码
refId
=
Convert
.
toLong
(
i
d
);
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
ref
Id
);
Long
hmId
=
Convert
.
toLong
(
id
);
log
.
info
(
"普通活码={}"
,
hmI
d
);
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hm
Id
);
if
(
hmQrcodeDTO
==
null
)
{
log
.
error
(
"活码为空:{}"
,
ref
Id
);
log
.
error
(
"活码为空:{}"
,
hm
Id
);
return
;
}
wxUserAddLogQDTO
.
setHmId
(
ref
Id
);
hmQrcodeApiService
.
updateAddNumById
(
ref
Id
,
hmQrcodeDTO
.
getClerkId
());
wxUserAddLogQDTO
.
setHmId
(
hm
Id
);
hmQrcodeApiService
.
updateAddNumById
(
hm
Id
,
hmQrcodeDTO
.
getClerkId
());
//处理活码导购
if
(
hmQrcodeDTO
.
getHmType
()
==
1
)
{
staffClerkRelationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
hmQrcodeDTO
.
getClerkId
(),
wxEnterpriseId
);
...
...
@@ -355,26 +355,27 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
TabHaobanClerkMainStoreRelated
mainStoreRelated
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
mainStoreRelated
!=
null
)
{
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
mainStoreRelated
.
getStoreId
());
hmClerkRelationDTO
=
hmQrcodeApiService
.
getHmClerkByHmIdAndClerkId
(
ref
Id
,
relationDTO
.
getClerkId
());
hmClerkRelationDTO
=
hmQrcodeApiService
.
getHmClerkByHmIdAndClerkId
(
hm
Id
,
relationDTO
.
getClerkId
());
if
(
hmClerkRelationDTO
==
null
)
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmIdAndStaffId
(
ref
Id
,
staffId
);
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmIdAndStaffId
(
hm
Id
,
staffId
);
if
(
hmClerkRelationDTO
==
null
)
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
ref
Id
);
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
hm
Id
);
}
}
}
else
{
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
ref
Id
);
hmClerkRelationDTO
=
hmQrcodeApiService
.
getOneHmClerkByHmId
(
hm
Id
);
}
staffClerkRelationDTO
=
staffClerkRelationService
.
getBindByClerkId
(
hmClerkRelationDTO
.
getClerkId
(),
wxEnterpriseId
);
}
}
else
if
(
state
.
contains
(
Manage3Constants
.
DT
))
{
KeyDataLinkBO
dataForHmLink
=
keyDataService
.
getDataForHmLink
(
id
);
refId
=
dataForHmLink
.
getLinkId
();
unionid
=
dataForHmLink
.
getUnionid
();
Long
linkId
=
dataForHmLink
.
getLinkId
();
Long
hmId
=
dataForHmLink
.
getHmId
();
wxUserAddLogQDTO
.
setLinkId
(
refId
);
unionid
=
dataForHmLink
.
getUnionid
();
log
.
info
(
"动态活码hmId={},linkId={},unionid={}"
,
hmId
,
linkId
,
unionid
);
isHmUnionid
=
true
;
wxUserAddLogQDTO
.
setLinkId
(
linkId
);
wxUserAddLogQDTO
.
setHmId
(
hmId
);
hmQrcodeDTO
=
hmQrcodeApiService
.
getSimpleById
(
hmId
);
if
(
hmQrcodeDTO
==
null
)
{
log
.
error
(
"活码动态为空:{}"
,
hmId
);
...
...
@@ -414,7 +415,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if
(
StringUtils
.
isNotBlank
(
unionid
))
{
log
.
info
(
"有unionid处理:wxEnterpriseId:{},unionid:{}"
,
wxEnterpriseId
,
unionid
);
dto
.
setUnionid
(
unionid
);
memberId
=
addExternalClerkRelated
(
dto
,
staffId
,
staffClerkRelationDTO
,
wxEnterpriseRelated
);
memberId
=
addExternalClerkRelated
(
dto
,
staffId
,
staffClerkRelationDTO
,
wxEnterpriseRelated
,
isHmUnionid
);
}
else
{
log
.
info
(
"发送欢迎语逻辑:wxEnterpriseId:{}"
,
wxEnterpriseId
);
addFriendByWelcome
(
dto
,
staffClerkRelationDTO
);
...
...
@@ -462,14 +463,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param staffClerkRelationDTO
* @param wxEnterpriseRelated
*/
private
String
addExternalClerkRelated
(
MemberUnionidRelatedDTO
dto
,
String
staffId
,
StaffClerkRelationDTO
staffClerkRelationDTO
,
TabHaobanWxEnterpriseRelated
wxEnterpriseRelated
)
{
private
String
addExternalClerkRelated
(
MemberUnionidRelatedDTO
dto
,
String
staffId
,
StaffClerkRelationDTO
staffClerkRelationDTO
,
TabHaobanWxEnterpriseRelated
wxEnterpriseRelated
,
boolean
isHmUnionid
)
{
String
wxUserId
=
dto
.
getWxUserId
();
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
();
String
name
=
dto
.
getExternalName
();
String
createTime
=
dto
.
getAddCreateTime
();
String
externalUserid
=
dto
.
getExternalUserid
();
String
avatar
=
dto
.
getAvatar
();
if
(
wxEnterpriseRelated
.
getMemberOpenCardFlag
()
==
1
)
{
if
(
wxEnterpriseRelated
.
getMemberOpenCardFlag
()
==
1
&&
(!
isHmUnionid
)
)
{
log
.
info
(
"不同开平,走欢迎语逻辑,wxEnterpriseId:{}"
,
wxEnterpriseId
);
addFriendByWelcome
(
dto
,
staffClerkRelationDTO
);
return
""
;
...
...
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