记得上下班打卡 | 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
4c733f66
Commit
4c733f66
authored
Jan 21, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改购物车
parent
f5841133
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
GoblinFrontLoginController.java
...service/goblin/controller/GoblinFrontLoginController.java
+7
-7
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+1
-6
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontLoginController.java
View file @
4c733f66
...
@@ -29,13 +29,13 @@ public class GoblinFrontLoginController {
...
@@ -29,13 +29,13 @@ public class GoblinFrontLoginController {
@GetMapping
(
"addShopCart"
)
@GetMapping
(
"addShopCart"
)
@ApiOperation
(
"加入购物车"
)
@ApiOperation
(
"加入购物车"
)
public
ResponseDto
addShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
addShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
addShoopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
addShoopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
}
}
@GetMapping
(
"updateShopCart"
)
@GetMapping
(
"updateShopCart"
)
@ApiOperation
(
"修改购物车"
)
@ApiOperation
(
"修改购物车"
)
public
ResponseDto
updateShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
updateShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
updateShopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
updateShopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
}
}
...
@@ -43,25 +43,25 @@ public class GoblinFrontLoginController {
...
@@ -43,25 +43,25 @@ public class GoblinFrontLoginController {
@GetMapping
(
"getShopCartCount"
)
@GetMapping
(
"getShopCartCount"
)
@ApiOperation
(
"获取购物车数量"
)
@ApiOperation
(
"获取购物车数量"
)
public
ResponseDto
getShopCartCount
(
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
getShopCartCount
(
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getShopCartCount
(
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
getShopCartCount
(
userId
,
type
));
}
}
@PostMapping
(
"deleteShopCart"
)
@PostMapping
(
"deleteShopCart"
)
@ApiOperation
(
"删除购物车"
)
@ApiOperation
(
"删除购物车"
)
public
ResponseDto
deleteShopCart
(
@RequestParam
(
name
=
"skuIds"
,
required
=
false
)
String
skuIds
,
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
deleteShopCart
(
@RequestParam
(
name
=
"skuIds"
,
required
=
false
)
String
skuIds
,
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
delteShoppingCart
(
skuIds
.
split
(
","
),
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
delteShoppingCart
(
skuIds
.
split
(
","
),
userId
,
type
));
}
}
@PostMapping
(
"saveData"
)
@PostMapping
(
"saveData"
)
@ApiOperation
(
"保存数据购物车过度"
)
@ApiOperation
(
"保存数据购物车过度"
)
public
ResponseDto
saveData
(
@RequestParam
(
name
=
"data"
,
required
=
false
)
String
data
,
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
saveData
(
@RequestParam
(
name
=
"data"
,
required
=
false
)
String
data
,
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
saveDate
(
data
,
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
saveDate
(
data
,
userId
,
type
));
}
}
@PostMapping
(
"getData"
)
@PostMapping
(
"getData"
)
@ApiOperation
(
"获得购物车过度"
)
@ApiOperation
(
"获得购物车过度"
)
public
ResponseDto
getData
(
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
getData
(
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getDate
(
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
getDate
(
userId
,
type
));
}
}
...
@@ -69,7 +69,7 @@ public class GoblinFrontLoginController {
...
@@ -69,7 +69,7 @@ public class GoblinFrontLoginController {
@GetMapping
(
"getShopCart"
)
@GetMapping
(
"getShopCart"
)
@ApiOperation
(
"获得购物车列表"
)
@ApiOperation
(
"获得购物车列表"
)
public
ResponseDto
<
GoblinShoppingCartVoo
>
getShopCart
(
@RequestParam
(
name
=
"type"
,
required
=
fals
e
)
Integer
type
)
{
public
ResponseDto
<
GoblinShoppingCartVoo
>
getShopCart
(
@RequestParam
(
name
=
"type"
,
required
=
tru
e
)
Integer
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getShoppCart
(
userId
,
type
));
return
ResponseDto
.
success
(
goblinFrontService
.
getShoppCart
(
userId
,
type
));
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
4c733f66
...
@@ -937,7 +937,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -937,7 +937,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
GoblinShoppingCartVoo
goblinShoppingCartVoo
=
(
GoblinShoppingCartVoo
)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
));
GoblinShoppingCartVoo
goblinShoppingCartVoo
=
(
GoblinShoppingCartVoo
)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
));
if
(
null
!=
goblinShoppingCartVoo
)
{
if
(
null
!=
goblinShoppingCartVoo
)
{
List
<
GoblinShoppingCartVo
>
shopList
=
goblinShoppingCartVoo
.
getShopList
();
List
<
GoblinShoppingCartVo
>
shopList
=
goblinShoppingCartVoo
.
getShopList
();
Iterator
<
GoblinShoppingCartVo
>
shopIter
=
shopList
.
iterator
();
Iterator
<
GoblinShoppingCartVo
>
shopIter
=
shopList
.
iterator
();
while
(
shopIter
.
hasNext
()){
while
(
shopIter
.
hasNext
()){
GoblinShoppingCartVo
goblinShoppingCartVo
=
shopIter
.
next
();
GoblinShoppingCartVo
goblinShoppingCartVo
=
shopIter
.
next
();
...
@@ -1046,9 +1045,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1046,9 +1045,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
});
}
}
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
log
.
info
(
"sql信息{}"
,
sqlDatas
);
log
.
debug
(
"sql信息{}"
,
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
log
.
info
(
"发送购物车消息队列完毕"
);
}
}
public
void
insertShopCartMysql
(
String
carId
,
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
Integer
type
){
public
void
insertShopCartMysql
(
String
carId
,
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
Integer
type
){
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
...
@@ -1060,7 +1058,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1060,7 +1058,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
});
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
log
.
info
(
"发送购物车消息队列完毕"
);
}
}
public
void
updateShopCartMysql
(
String
carId
,
Integer
number
,
String
userId
){
public
void
updateShopCartMysql
(
String
carId
,
Integer
number
,
String
userId
){
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
...
@@ -1072,7 +1069,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1072,7 +1069,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
});
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
log
.
info
(
"发送购物车消息队列完毕"
);
}
}
//删除
//删除
...
@@ -1089,7 +1085,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1089,7 +1085,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
String
sqlDatas
=
SqlMapping
.
gets
(
sqls
,
sqlData
);
log
.
info
(
sqlDatas
);
log
.
info
(
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
log
.
info
(
"发送购物车消息队列完毕"
);
}
}
...
...
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