记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
f33a0d5d
Commit
f33a0d5d
authored
Apr 22, 2022
by
GaoHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit备注:本能不能为本人助力 后期去掉注解
parent
08872f72
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
24 deletions
+47
-24
GoblinGoodsAnticipateValueParam.java
...ce/goblin/dto/manage/GoblinGoodsAnticipateValueParam.java
+4
-0
HelpValueVo.java
...m/liquidnet/service/goblin/dto/manage/vo/HelpValueVo.java
+4
-0
GoblinGoodsAnticipateShareVo.java
...t/service/goblin/dto/vo/GoblinGoodsAnticipateShareVo.java
+12
-0
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+6
-12
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+3
-0
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+18
-12
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinGoodsAnticipateValueParam.java
View file @
f33a0d5d
...
...
@@ -54,4 +54,8 @@ public class GoblinGoodsAnticipateValueParam{
@ApiModelProperty
(
position
=
18
,
required
=
false
,
value
=
"创建日期"
)
private
String
createdDate
;
@ApiModelProperty
(
required
=
false
,
value
=
"预约类型(1:预约提醒,2:预约获得购买资格)"
)
private
Integer
type
;
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/vo/HelpValueVo.java
View file @
f33a0d5d
...
...
@@ -49,6 +49,10 @@ public class HelpValueVo implements java.io.Serializable, Cloneable{
this
.
setType
(
shareVo
.
getType
());
this
.
setPeopleType
(
shareVo
.
getPeopleType
());
this
.
setSkuId
(
shareVo
.
getSkuId
());
this
.
setHelpUserAvatar
(
shareVo
.
getAvatarImgList
());
this
.
setNickname
(
shareVo
.
getNickname
());
this
.
setAvatar
(
shareVo
.
getAvatar
());
this
.
setHelpPeople
(
shareVo
.
getHelpPeople
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsAnticipateShareVo.java
View file @
f33a0d5d
...
...
@@ -8,6 +8,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
...
...
@@ -49,6 +50,12 @@ public class GoblinGoodsAnticipateShareVo implements Serializable,Cloneable{
*/
private
String
avatar
;
/**
* 助力人数
*/
@ApiModelProperty
(
value
=
"目前有多少助力"
)
private
Integer
helpPeople
;
/**
* 预约开始时间
*/
...
...
@@ -68,6 +75,11 @@ public class GoblinGoodsAnticipateShareVo implements Serializable,Cloneable{
*/
private
LocalDateTime
createdDate
;
/**
* 头像集合
*/
private
List
<
String
>
avatarImgList
;
private
static
final
GoblinGoodsAnticipateShareVo
obj
=
new
GoblinGoodsAnticipateShareVo
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
f33a0d5d
...
...
@@ -142,7 +142,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//查询redis关联记录
String
sid
=
goblinRedisUtils
.
getShare
(
skuId
,
uid
);
if
(
sid
!=
null
)
{
return
ResponseDto
.
failure
(
"
1
"
,
"已开启助力"
,
sid
);
return
ResponseDto
.
failure
(
"
0
"
,
"已开启助力"
,
sid
);
}
else
{
//查询sku需要助力人数
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
...
...
@@ -161,6 +161,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
goblinGoodsAnticipateShareVo
.
setCreatedDate
(
LocalDateTime
.
now
());
goblinGoodsAnticipateShareVo
.
setAboutStartDate
(
valueBySkuId
.
getAboutStartDate
());
goblinGoodsAnticipateShareVo
.
setAboutEndDate
(
valueBySkuId
.
getAboutEndDate
());
goblinGoodsAnticipateShareVo
.
setHelpPeople
(
0
);
goblinGoodsAnticipateShareVo
.
setAvatarImgList
(
CollectionUtil
.
arrayListString
());
//开启助力
//mongodb缓存
//goblinMongoUtils.setGoblinGoodsAnticipateShareVo(goblinGoodsAnticipateShareVo);
...
...
@@ -202,9 +204,9 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//获取uid
String
uid
=
CurrentUtil
.
getCurrentUid
();
if
(
shareVo
.
getUid
().
equals
(
uid
)){
return
ResponseDto
.
failure
(
"助力失败,本人不能为本人助力!"
);
}
//
if (shareVo.getUid().equals(uid)){
//
return ResponseDto.failure("助力失败,本人不能为本人助力!");
//
}
//查询mongodb 是否助力过该分享
// GoblinGoodsAnticipateHelpVo goodsAnticipateHelpVo = goblinMongoUtils.getHelpVo(sid, uid);
...
...
@@ -251,18 +253,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
@Override
public
ResponseDto
<
HelpValueVo
>
getHelpValue
(
String
sid
)
{
//助力头像前六个
List
<
String
>
helpUserAvatar
=
goblinRedisUtils
.
getHelpUserAvatar
(
sid
);
//目前有多少助力
Integer
helpPeople
=
goblinRedisUtils
.
getHelpSidAddHelp
(
sid
);
//获取分享助力信息
GoblinGoodsAnticipateShareVo
shareVo
=
goblinRedisUtils
.
getShareVo
(
sid
);
HelpValueVo
helpValueVo
=
HelpValueVo
.
getNew
();
helpValueVo
.
copy
(
shareVo
);
helpValueVo
.
setHelpUserAvatar
(
helpUserAvatar
);
helpValueVo
.
setHelpPeople
(
helpPeople
);
helpValueVo
.
setAvatar
(
helpValueVo
.
getAvatar
());
helpValueVo
.
setNickname
(
helpValueVo
.
getNickname
());
return
ResponseDto
.
success
(
helpValueVo
);
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
f33a0d5d
...
...
@@ -61,6 +61,9 @@ public class GoblinMongoUtils {
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
Pageable
pageable
=
PageRequest
.
of
(
goblinGoodsAnticipateValueParam
.
getPageNum
()
-
1
,
20
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdDate"
));
Criteria
criteria
=
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"uid"
).
is
(
uid
);
if
(
goblinGoodsAnticipateValueParam
.
getType
()!=
null
){
criteria
=
criteria
.
and
(
"type"
).
is
(
goblinGoodsAnticipateValueParam
.
getType
());
}
if
(
StringUtils
.
isNotBlank
(
goblinGoodsAnticipateValueParam
.
getName
()))
{
criteria
=
criteria
.
and
(
"skuName"
).
regex
(
".*?"
+
goblinGoodsAnticipateValueParam
.
getName
()
+
".*"
);
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
f33a0d5d
...
...
@@ -185,22 +185,22 @@ public class GoblinRedisUtils {
* 保存用户头像
*/
public
void
setHelpUserAvatar
(
String
sid
,
String
avatar
)
{
Object
list
=
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SHARE_HELP_AVATAR
.
concat
(
sid
)
);
List
<
String
>
urlList
=
list
!=
null
?
(
List
<
String
>)
list
:
CollectionUtil
.
arrayListString
(
);
urlList
.
add
(
avatar
);
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SHARE_HELP_AVATAR
.
concat
(
sid
),
urlList
);
GoblinGoodsAnticipateShareVo
shareVo
=
getShareVo
(
sid
);
// Object list = redisUtil.get(GoblinRedisConst.ANTICIPATE_SHARE_HELP_AVATAR.concat(sid)
);
shareVo
.
getAvatarImgList
()
.
add
(
avatar
);
setShareVo
(
shareVo
);
}
/**
* 获取用户预约头像
*/
public
List
<
String
>
getHelpUserAvatar
(
String
sid
)
{
String
rdk
=
GoblinRedisConst
.
ANTICIPATE_SHARE_HELP_AVATAR
.
concat
(
sid
);
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
arrayListString
();
GoblinGoodsAnticipateShareVo
shareVo
=
getShareVo
(
sid
);
if
(
shareVo
!=
null
)
{
return
shareVo
.
getAvatarImgList
();
}
else
{
return
(
List
<
String
>)
obj
;
return
CollectionUtil
.
arrayListString
()
;
}
}
...
...
@@ -236,16 +236,22 @@ public class GoblinRedisUtils {
* 助力id人数+1
*/
public
void
setHelpSidAddHelp
(
String
sid
)
{
GoblinGoodsAnticipateShareVo
shareVo
=
getShareVo
(
sid
);
Integer
helpPeople
=
shareVo
.
getHelpPeople
();
shareVo
.
setHelpPeople
(
helpPeople
!=
null
?
helpPeople
+=
1
:
1
);
Integer
helpByUidAndSid
=
getHelpSidAddHelp
(
sid
);
int
num
=
helpByUidAndSid
!=
null
?
helpByUidAndSid
+=
1
:
1
;
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SHARE_SID
.
concat
(
sid
),
num
);
setShareVo
(
shareVo
);
}
/**
* 获取 助力id人数
*/
public
Integer
getHelpSidAddHelp
(
String
sid
){
Integer
people
=
(
Integer
)
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SHARE_SID
.
concat
(
sid
));
GoblinGoodsAnticipateShareVo
shareVo
=
getShareVo
(
sid
);
Integer
people
=
null
;
if
(
shareVo
!=
null
){
people
=
shareVo
.
getHelpPeople
();
}
return
people
!=
null
?
people
:
0
;
}
...
...
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