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
8298832a
Commit
8298832a
authored
Feb 06, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取导购活码
parent
fc76f2ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
5 deletions
+104
-5
HmLinkApiService.java
...om/gic/haoban/manage/api/service/hm/HmLinkApiService.java
+2
-0
WxUserAddLogServiceImpl.java
...nage/service/service/hm/impl/WxUserAddLogServiceImpl.java
+6
-4
HmLinkApiServiceImpl.java
...age/service/service/out/impl/hm/HmLinkApiServiceImpl.java
+93
-0
TabHaobanHmQrcodeMapper.xml
.../src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
+3
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/hm/HmLinkApiService.java
View file @
8298832a
...
@@ -57,4 +57,6 @@ public interface HmLinkApiService {
...
@@ -57,4 +57,6 @@ public interface HmLinkApiService {
*/
*/
public
ServiceResponse
<
HmLinkWxaDTO
>
getLinkHmFromWxa
(
String
enterpriseId
,
Integer
whitchStore
,
String
storeId
,
public
ServiceResponse
<
HmLinkWxaDTO
>
getLinkHmFromWxa
(
String
enterpriseId
,
Integer
whitchStore
,
String
storeId
,
String
clerkId
,
String
linkShortCode
,
String
mixPhone
,
String
unionid
,
String
memberId
);
String
clerkId
,
String
linkShortCode
,
String
mixPhone
,
String
unionid
,
String
memberId
);
public
ServiceResponse
<
HmLinkWxaDTO
>
getMemberClerkHm
(
String
enterpriseId
,
String
memberId
,
String
unionid
,
Long
linkId
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/WxUserAddLogServiceImpl.java
View file @
8298832a
...
@@ -115,10 +115,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
...
@@ -115,10 +115,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
if
(
null
!=
qdto
.
getLinkId
())
{
if
(
null
!=
qdto
.
getLinkId
())
{
HmLinkBO
link
=
this
.
hmLinkService
.
getByLinkIdFormCache
(
qdto
.
getWxEnterpriseId
(),
HmLinkBO
link
=
this
.
hmLinkService
.
getByLinkIdFormCache
(
qdto
.
getWxEnterpriseId
(),
qdto
.
getEnterpriseId
(),
qdto
.
getLinkId
());
qdto
.
getEnterpriseId
(),
qdto
.
getLinkId
());
entity
.
setAddChannel
(
1
);
if
(
null
!=
link
)
{
entity
.
setLinkId
(
qdto
.
getLinkId
());
entity
.
setAddChannel
(
1
);
entity
.
setLinkName
(
link
.
getName
());
entity
.
setLinkId
(
qdto
.
getLinkId
());
memberLabelId
=
link
.
getMemberLabelId
();
entity
.
setLinkName
(
link
.
getName
());
memberLabelId
=
link
.
getMemberLabelId
();
}
}
}
if
(
null
!=
memberLabelId
)
{
if
(
null
!=
memberLabelId
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmLinkApiServiceImpl.java
View file @
8298832a
...
@@ -30,6 +30,7 @@ import com.gic.commons.util.PageHelperUtils;
...
@@ -30,6 +30,7 @@ import com.gic.commons.util.PageHelperUtils;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.common.utils.DingUtils
;
import
com.gic.haoban.common.utils.DingUtils
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmLinkChatDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmLinkChatDTO
;
...
@@ -43,6 +44,7 @@ import com.gic.haoban.manage.api.enums.hm.HmLinkTypeEnum;
...
@@ -43,6 +44,7 @@ import com.gic.haoban.manage.api.enums.hm.HmLinkTypeEnum;
import
com.gic.haoban.manage.api.service.hm.HmLinkApiService
;
import
com.gic.haoban.manage.api.service.hm.HmLinkApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.errorcode.HaoBanErrCode
;
import
com.gic.haoban.manage.service.errorcode.HaoBanErrCode
;
...
@@ -121,6 +123,8 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
...
@@ -121,6 +123,8 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
private
MemberTagGroupApiService
memberTagGroupApiService
;
private
MemberTagGroupApiService
memberTagGroupApiService
;
@Autowired
@Autowired
private
GroupChatHmService
groupChatHmService
;
private
GroupChatHmService
groupChatHmService
;
@Autowired
private
TabHaobanStaffClerkRelationMapper
staffClerkRelationMapper
;
@Override
@Override
public
ServiceResponse
<
String
>
getHmLinkUrl
()
{
public
ServiceResponse
<
String
>
getHmLinkUrl
()
{
...
@@ -537,6 +541,9 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
...
@@ -537,6 +541,9 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
paramsDTO
.
setSkipVerify
(
hm
.
getPassFlag
()
==
1
);
paramsDTO
.
setSkipVerify
(
hm
.
getPassFlag
()
==
1
);
paramsDTO
.
setState
(
"DT"
+
key
);
paramsDTO
.
setState
(
"DT"
+
key
);
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
hm
.
getStaffId
());
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
hm
.
getStaffId
());
if
(
null
==
tabHaobanStaff
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"成员不存在"
)
;
}
if
(
tabHaobanStaff
!=
null
)
{
if
(
tabHaobanStaff
!=
null
)
{
if
(
qwDTO
.
needOpenUserId3th
())
{
if
(
qwDTO
.
needOpenUserId3th
())
{
paramsDTO
.
setUser
(
Arrays
.
asList
(
tabHaobanStaff
.
getWxOpenUseId
()));
paramsDTO
.
setUser
(
Arrays
.
asList
(
tabHaobanStaff
.
getWxOpenUseId
()));
...
@@ -684,4 +691,90 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
...
@@ -684,4 +691,90 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
}
}
return
flag
;
return
flag
;
}
}
public
ServiceResponse
<
HmLinkWxaDTO
>
getMemberClerkHm
(
String
enterpriseId
,
String
memberId
,
String
unionid
,
Long
linkId
)
{
log
.
info
(
"getMemberClerkHm={},linkId={}"
,
memberId
,
linkId
);
HmLinkWxaDTO
retDTO
=
new
HmLinkWxaDTO
();
HmQrcodeBO
hm
=
null
;
MemberDataDTO
member
=
this
.
getMemberClerk
(
enterpriseId
,
memberId
);
List
<
MemberStoreClerkDataDTO
>
list
=
member
.
getStoreClerkRel
();
List
<
String
>
clerkIdList
=
list
.
stream
().
map
(
dto
->
dto
.
getClerkIdRel
()).
collect
(
Collectors
.
toList
())
;
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
log
.
info
(
"会员下无导购"
);
return
ServiceResponse
.
failure
(
"9999"
,
"会员下无导购"
)
;
}
HmLinkBO
link
=
this
.
hmLinkService
.
getByLinkId
(
null
,
enterpriseId
,
linkId
);
if
(
null
==
link
)
{
log
.
info
(
"链接不存在,linkId={}"
,
linkId
);
return
ServiceResponse
.
failure
(
"9999"
,
"链接不存在"
)
;
}
String
wxEnterpriseId
=
link
.
getWxEnterpriseId
()
;
log
.
info
(
"wxEnterpriseId={}"
,
wxEnterpriseId
);
List
<
StaffClerkRelationDTO
>
staffClerkList
=
this
.
staffClerkRelationMapper
.
listByClerkIds
(
clerkIdList
,
wxEnterpriseId
)
;
if
(
CollectionUtils
.
isEmpty
(
staffClerkList
))
{
log
.
info
(
"会员导购无关联成员"
);
return
ServiceResponse
.
failure
(
"9999"
,
"会员导购无关联成员"
)
;
}
clerkIdList
=
staffClerkList
.
stream
().
map
(
dto
->
dto
.
getClerkId
()).
collect
(
Collectors
.
toList
())
;
List
<
String
>
friendList
=
this
.
tabHaobanExternalClerkRelatedMapper
.
listMemberAndClerk
(
Arrays
.
asList
(
memberId
),
clerkIdList
,
enterpriseId
)
;
if
(
CollectionUtils
.
isNotEmpty
(
friendList
))
{
log
.
info
(
"已存在好友"
);
return
ServiceResponse
.
failure
(
"9999"
,
"已存在好友"
)
;
}
String
mainClerkId
=
member
.
getMainClerkId
();
String
mainStoreId
=
member
.
getMainStoreId
();
// 服务门店
log
.
info
(
"memberId={},主导购={}"
,
memberId
,
mainClerkId
);
if
(
StringUtils
.
isNotBlank
(
mainClerkId
))
{
clerkIdList
.
add
(
mainClerkId
);
hm
=
this
.
getHmFromClerk
(
mainClerkId
,
wxEnterpriseId
,
memberId
,
enterpriseId
);
if
(
null
!=
hm
)
{
log
.
info
(
"获取服务导购活码,mainClerkId={}"
,
mainClerkId
);
}
}
// 协管门店
if
(
null
==
hm
&&
CollectionUtils
.
isNotEmpty
(
list
))
{
log
.
info
(
"处理协管导购"
);
// 协管导购
for
(
MemberStoreClerkDataDTO
item
:
list
)
{
String
clerkId
=
item
.
getClerkIdRel
();
if
(
StringUtils
.
isNotBlank
(
mainStoreId
)
&&
mainStoreId
.
equals
(
item
.
getStoreIdRel
()))
{
continue
;
}
hm
=
this
.
getHmFromClerk
(
clerkId
,
wxEnterpriseId
,
memberId
,
enterpriseId
);
if
(
null
!=
hm
)
{
log
.
info
(
"获取导购活码,clerkId={}"
,
clerkId
);
break
;
}
}
}
if
(
null
!=
hm
)
{
log
.
info
(
"获取到单人活码={}"
,
JSON
.
toJSONString
(
hm
));
retDTO
.
setHmId
(
hm
.
getHmId
());
KeyDataLinkBO
bo
=
new
KeyDataLinkBO
();
bo
.
setUnionid
(
unionid
);
bo
.
setHmId
(
hm
.
getHmId
());
// bo.setLinkId(hm.getHmId());
String
dthmKey
=
this
.
keyDataService
.
saveDataForLink
(
enterpriseId
,
bo
);
if
(
null
!=
dthmKey
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
null
==
qwDTO
)
{
log
.
info
(
"wxEnterprise不存在={}"
,
wxEnterpriseId
);
return
ServiceResponse
.
failure
(
"9999"
,
"企业不存在"
)
;
}
ServiceResponse
<
String
>
addResp
=
this
.
addQrcode
(
hm
,
dthmKey
,
qwDTO
,
retDTO
);
if
(!
addResp
.
isSuccess
())
{
if
(
StringUtils
.
isBlank
(
hm
.
getWxQrcode
()))
{
return
ServiceResponse
.
success
(
retDTO
);
}
retDTO
.
setHmQrcode
(
hm
.
getWxQrcode
());
}
else
{
retDTO
.
setHmQrcode
(
addResp
.
getResult
());
}
}
}
// 生成动态活码
log
.
info
(
"活码数据返回={}"
,
JSON
.
toJSONString
(
retDTO
));
return
ServiceResponse
.
success
(
retDTO
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
View file @
8298832a
...
@@ -253,7 +253,9 @@
...
@@ -253,7 +253,9 @@
<include
refid=
"Base_Column_List"
></include>
<include
refid=
"Base_Column_List"
></include>
from tab_haoban_hm_qrcode
from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag = 1
where clerk_id = #{clerkId} and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"null != wxEnterpriseId"
>
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if
test=
"hmType != null"
>
<if
test=
"hmType != null"
>
and hm_type = #{hmType}
and hm_type = #{hmType}
</if>
</if>
...
...
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