记得上下班打卡 | 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
60244791
Commit
60244791
authored
Apr 11, 2022
by
GaoHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit
parent
71f43077
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
11 deletions
+24
-11
GoblinGoodsAnticipateParam.java
...service/goblin/dto/manage/GoblinGoodsAnticipateParam.java
+5
-0
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+6
-5
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+7
-0
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+6
-6
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinGoodsAnticipateParam.java
View file @
60244791
...
@@ -32,6 +32,11 @@ public class GoblinGoodsAnticipateParam{
...
@@ -32,6 +32,11 @@ public class GoblinGoodsAnticipateParam{
/**
/**
* 预约名称
* 预约名称
*/
*/
@ApiModelProperty
(
"预约名称"
)
private
String
name
;
private
String
name
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
60244791
...
@@ -113,7 +113,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -113,7 +113,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//mongodb新增
//mongodb新增
goblinMongoUtils
.
setGoblinGoodsAnticipateVo
(
goodsAnticipateVo
);
goblinMongoUtils
.
setGoblinGoodsAnticipateVo
(
goodsAnticipateVo
);
return
ResponseDto
.
success
();
//返回预约id
return
ResponseDto
.
success
(
antId
);
}
}
return
ResponseDto
.
failure
(
"参数有误"
);
return
ResponseDto
.
failure
(
"参数有误"
);
}
}
...
@@ -210,7 +211,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -210,7 +211,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
)
{
public
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
GoblinGoodsAnticipateValueParam
vo
:
list
)
{
for
(
GoblinGoodsAnticipateValueParam
vo
:
list
)
{
if
(
goblinRedisUtils
.
getAnticipate
(
vo
.
get
AntId
(),
vo
.
get
SkuId
()))
if
(
goblinRedisUtils
.
getAnticipate
(
vo
.
getSkuId
()))
return
ResponseDto
.
failure
(
"该预约已选择该sku"
);
return
ResponseDto
.
failure
(
"该预约已选择该sku"
);
}
}
list
.
forEach
(
item
->
{
list
.
forEach
(
item
->
{
...
@@ -221,7 +222,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -221,7 +222,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
goodsAnticipateValueVo
.
setDelTag
(
0
);
goodsAnticipateValueVo
.
setDelTag
(
0
);
//redis消息
//redis消息
//redis标识存入该sku处于预约列表
//redis标识存入该sku处于预约列表
goblinRedisUtils
.
setAnticipateValue
(
goodsAnticipateValueVo
.
get
AntId
(),
goodsAnticipateValueVo
.
get
SkuId
());
goblinRedisUtils
.
setAnticipateValue
(
goodsAnticipateValueVo
.
getSkuId
());
//保存mysql中间表
//保存mysql中间表
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
...
@@ -257,13 +258,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -257,13 +258,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//删除该sku关联
//删除该sku关联
goblinMongoUtils
.
delAnticipateValueVo
(
goodsAnticipateValueVo
);
goblinMongoUtils
.
delAnticipateValueVo
(
goodsAnticipateValueVo
);
//删除redis
//删除redis
goblinRedisUtils
.
delAnticipateValue
(
goodsAnticipateValueVo
.
get
AntId
(),
goodsAnticipateValueVo
.
get
SkuId
());
goblinRedisUtils
.
delAnticipateValue
(
goodsAnticipateValueVo
.
getSkuId
());
//删除mysql中的关联数据
//删除mysql中的关联数据
sqlValue
.
add
(
new
Object
[]{
sqlValue
.
add
(
new
Object
[]{
goodsAnticipateValueVo
.
getAntId
(),
goodsAnticipateValueVo
.
getAntId
(),
goodsAnticipateValueVo
.
getSkuId
()
goodsAnticipateValueVo
.
getSkuId
()
});
});
sendRedis
(
"goblin_goods_anticipate_value_delete_by_antId_and_skuId"
,
sqlValue
);
sendRedis
(
"goblin_goods_anticipate_value_delete_by_antId_and_skuId"
,
sqlValue
);
}
else
{
}
else
{
//保存mysql中间表
//保存mysql中间表
sqlValue
.
add
(
new
Object
[]{
sqlValue
.
add
(
new
Object
[]{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
60244791
...
@@ -164,6 +164,13 @@ public class GoblinMongoUtils {
...
@@ -164,6 +164,13 @@ public class GoblinMongoUtils {
*/
*/
public
void
delAnticipateValues
(
String
antId
){
public
void
delAnticipateValues
(
String
antId
){
Query
query
=
Query
.
query
(
Criteria
.
where
(
"antId"
).
is
(
antId
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"antId"
).
is
(
antId
));
//查询处所有的sku关联信息
List
<
GoblinGoodsAnticipateValueVo
>
goodsAnticipateValues
=
getGoodsAnticipateValues
(
antId
);
if
(
goodsAnticipateValues
!=
null
&&
goodsAnticipateValues
.
size
()>
0
){
goodsAnticipateValues
.
forEach
(
item
->
{
redisUtils
.
delAnticipateValue
(
item
.
getSkuId
());
});
}
mongoTemplate
.
remove
(
query
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
()).
getDeletedCount
();
mongoTemplate
.
remove
(
query
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
()).
getDeletedCount
();
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
60244791
...
@@ -47,15 +47,15 @@ public class GoblinRedisUtils {
...
@@ -47,15 +47,15 @@ public class GoblinRedisUtils {
/**
/**
* 该skuId已开启预约
* 该skuId已开启预约
*/
*/
public
void
setAnticipateValue
(
String
antId
,
String
skuId
){
public
void
setAnticipateValue
(
String
skuId
){
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
),
1
);
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
),
1
);
}
}
/**
/**
* 删除skuId已开启预约
* 删除skuId已开启预约
*/
*/
public
void
delAnticipateValue
(
String
antId
,
String
skuId
){
public
void
delAnticipateValue
(
String
skuId
){
redisUtil
.
del
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
));
redisUtil
.
del
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
));
}
}
...
@@ -63,8 +63,8 @@ public class GoblinRedisUtils {
...
@@ -63,8 +63,8 @@ public class GoblinRedisUtils {
/**
/**
* 获取关联
* 获取关联
*/
*/
public
boolean
getAnticipate
(
String
antId
,
String
skuId
){
public
boolean
getAnticipate
(
String
skuId
){
return
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
))
!=
null
;
return
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
))
!=
null
;
}
}
public
GoblinGoodAnticipateUserVo
getUserAboutAut
(
String
skuId
,
String
uid
)
{
public
GoblinGoodAnticipateUserVo
getUserAboutAut
(
String
skuId
,
String
uid
)
{
...
...
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