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
25a35cd6
Commit
25a35cd6
authored
Mar 31, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
互动记录多商品类型
parent
6fc22b45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
+26
-13
InteractRecordBuilder.java
...ervice/service/content/adaptor/InteractRecordBuilder.java
+17
-0
InteractRecordMessageService.java
...service/content/message/InteractRecordMessageService.java
+8
-13
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+1
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/adaptor/InteractRecordBuilder.java
View file @
25a35cd6
...
...
@@ -16,6 +16,7 @@ import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import
com.gic.haoban.manage.service.pojo.bo.content.InteractRecordExtendInfoBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO
;
import
com.gic.haoban.manage.service.pojo.bo.content.context.InteractRecordMessageContext
;
import
com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO
;
import
com.gic.store.goods.dto.goods.GoodsInfoSimpleDTO
;
import
com.gic.store.goods.dto.goods.GoodsSpuInfoDTO
;
import
com.gic.store.goods.service.GoodsInfoOutApiService
;
...
...
@@ -284,6 +285,22 @@ public class InteractRecordBuilder {
return
map
;
}
public
Integer
getGoodsCount
(
InteractRecordMessageBO
interactRecordMessageBO
,
Map
<
String
,
List
<
List
<
String
>>>
multipleMap
)
{
Integer
goodsCount
=
1
;
if
(
StringUtils
.
isBlank
(
interactRecordMessageBO
.
getWxaLinkId
()))
{
return
goodsCount
;
}
if
(
MapUtil
.
isEmpty
(
multipleMap
))
{
return
goodsCount
;
}
List
<
List
<
String
>>
groupGoodsIds
=
multipleMap
.
get
(
interactRecordMessageBO
.
getWxaLinkId
());
if
(
CollectionUtils
.
isNotEmpty
(
groupGoodsIds
))
{
goodsCount
=
groupGoodsIds
.
stream
().
mapToInt
(
List:
:
size
).
sum
();
log
.
info
(
"多商品分享页面goodsCount:{}"
,
goodsCount
);
}
return
goodsCount
;
}
public
Map
<
String
,
InteractRecordExtendInfoBO
>
buildGroupGoodsByWxaLinkId
(
String
enterpriseId
,
List
<
String
>
wxaLinkIds
)
{
Map
<
String
,
InteractRecordExtendInfoBO
>
extendInfoBOMap
=
new
HashMap
<>();
Map
<
String
,
List
<
List
<
String
>>>
map
=
getGroupGoodsIdByWxaLinkIds
(
wxaLinkIds
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/content/message/InteractRecordMessageService.java
View file @
25a35cd6
...
...
@@ -57,26 +57,21 @@ public class InteractRecordMessageService {
*/
public
void
dealRecord
(
InteractRecordMessageBO
interactRecordMessageBO
)
{
log
.
info
(
"【dealRecord】处理埋点事件 >> {}"
,
JSON
.
toJSONString
(
interactRecordMessageBO
));
InteractRecordMessageContext
context
=
InteractRecordMessageContext
.
create
(
interactRecordMessageBO
);
// 参数是否完整
// 根据businessId clerkId memberId materialId 构建唯一标识key
String
recordKey
=
context
.
buildRecordKey
();
RedisUtil
.
lock
(
recordKey
,
3L
,
TimeUnit
.
SECONDS
,
2L
);
// 查询多商品页面数据
Map
<
String
,
List
<
List
<
String
>>>
multipleMap
=
null
;
if
(
StringUtils
.
isNotBlank
(
interactRecordMessageBO
.
getWxaLinkId
()))
{
multipleMap
=
interactRecordBuilder
.
getGroupGoodsIdByWxaLinkIds
(
Lists
.
newArrayList
(
interactRecordMessageBO
.
getWxaLinkId
()));
if
(
MapUtil
.
isNotEmpty
(
multipleMap
))
{
List
<
List
<
String
>>
groupGoodsIds
=
multipleMap
.
get
(
interactRecordMessageBO
.
getWxaLinkId
());
if
(
CollectionUtils
.
isNotEmpty
(
groupGoodsIds
))
{
Integer
goodsCount
=
groupGoodsIds
.
stream
().
mapToInt
(
List:
:
size
).
sum
();
log
.
info
(
"多商品分享页面goodsCount:{}"
,
goodsCount
);
interactRecordMessageBO
.
setGoodsCount
(
goodsCount
);
}
}
Integer
goodsCount
=
interactRecordBuilder
.
getGoodsCount
(
interactRecordMessageBO
,
multipleMap
);
interactRecordMessageBO
.
setGoodsCount
(
goodsCount
);
}
InteractRecordMessageContext
context
=
InteractRecordMessageContext
.
create
(
interactRecordMessageBO
);
// 参数是否完整
// 根据businessId clerkId memberId materialId 构建唯一标识key
String
recordKey
=
context
.
buildRecordKey
();
RedisUtil
.
lock
(
recordKey
,
3L
,
TimeUnit
.
SECONDS
,
2L
);
// 根据key 查询是否存在记录
InteractRecordBO
interactRecordBO
=
null
;
if
(
MaterialInteractRecordEventType
.
ORDER
.
getCode
().
equals
(
interactRecordMessageBO
.
getEventType
()))
{
...
...
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
25a35cd6
...
...
@@ -251,6 +251,7 @@
<dubbo:reference
interface=
"com.gic.content.api.service.ContentMaterialApiService"
id=
"contentMaterialApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.content.api.service.ContentSettingApiService"
id=
"contentSettingApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.content.api.service.ContentMemberBuryPointApiService"
id=
"contentMemberBuryPointApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.content.api.service.analysis.GoodsAnalysisMemberBuryPointApiService"
id=
"goodsAnalysisMemberBuryPointApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.MenuApiService"
id=
"menuApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.ext.api.service.MemberGrowthWriteApiService"
id=
"memberGrowthWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.integral.IntegralWriteApiService"
id=
"integralWriteApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
...
...
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