Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
37be0ad6
Commit
37be0ad6
authored
Jun 03, 2021
by
张跃
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'featur/20210519-加价购优化'
parents
1b38bed1
453ec46c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
36 deletions
+30
-36
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/ShoppingBaseServiceImpl.java
+16
-19
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+14
-17
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/ShoppingBaseServiceImpl.java
View file @
37be0ad6
...
@@ -72,12 +72,11 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
...
@@ -72,12 +72,11 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
@Override
@Override
public
void
updateForPopupWindow
(
BaseListCartGoodsVO
baseListCartGoodsVO
,
Integer
showType
,
List
<
PremiumExchangeResponseVo
.
PremiumExchangeProduct
>
chooseSendGoodList
,
List
<
ListCartGoodsBO
.
SendGoods
>
sendGoods
)
{
public
void
updateForPopupWindow
(
BaseListCartGoodsVO
baseListCartGoodsVO
,
Integer
showType
,
List
<
PremiumExchangeResponseVo
.
PremiumExchangeProduct
>
chooseSendGoodList
,
List
<
ListCartGoodsBO
.
SendGoods
>
sendGoods
)
{
if
(
Integer
.
valueOf
(
"5"
).
equals
(
showType
)
&&
!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
chooseSendGoodList
)){
if
(
Integer
.
valueOf
(
"5"
).
equals
(
showType
)
&&
!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
chooseSendGoodList
))
{
chooseSendGoodList
.
forEach
(
good
->{
chooseSendGoodList
.
forEach
(
good
->
{
ListCartGoodsBO
.
SendGoods
first
=
null
;
ListCartGoodsBO
.
SendGoods
first
=
null
;
if
(
sendGoods
!=
null
)
{
first
=
sendGoods
.
stream
().
filter
(
a
->
a
.
getGoodsId
().
equals
(
good
.
getSkuId
())
||
a
.
getGoodsId
().
equals
(
good
.
getSpuId
())).
findFirst
().
orElse
(
null
);
first
=
sendGoods
.
stream
().
filter
(
a
->
a
.
getGoodsId
().
equals
(
good
.
getPid
())).
findFirst
().
orElseGet
(
null
);
if
(
first
==
null
)
return
;
}
CartGoods
cartGoods
=
new
CartGoods
();
CartGoods
cartGoods
=
new
CartGoods
();
cartGoods
.
setSpuId
(
good
.
getSpuId
());
cartGoods
.
setSpuId
(
good
.
getSpuId
());
cartGoods
.
setSkuId
(
good
.
getSkuId
());
cartGoods
.
setSkuId
(
good
.
getSkuId
());
...
@@ -90,19 +89,17 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
...
@@ -90,19 +89,17 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
cartGoods
.
setGoodsId
(
good
.
getPid
());
cartGoods
.
setGoodsId
(
good
.
getPid
());
cartGoods
.
setName
(
good
.
getName
());
cartGoods
.
setName
(
good
.
getName
());
cartGoods
.
setSpuName
(
good
.
getSpuName
());
cartGoods
.
setSpuName
(
good
.
getSpuName
());
cartGoods
.
setQty
(
first
==
null
?
1
:
first
.
getQty
());
cartGoods
.
setQty
(
first
==
null
?
1
:
first
.
getQty
());
if
(
first
!=
null
)
{
cartGoods
.
setActivityCode
(
first
.
getActivityCode
());
cartGoods
.
setActivityCode
(
first
.
getActivityCode
());
if
(!
CollectionUtils
.
isEmpty
(
first
.
getAttributes
()))
{
if
(!
CollectionUtils
.
isEmpty
(
first
.
getAttributes
())){
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
();
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
();
first
.
getAttributes
().
forEach
(
attribute
->
{
first
.
getAttributes
().
forEach
(
attribute
->
{
CartGoods
.
CartGoodsExtra
goodsExtra
=
new
CartGoods
.
CartGoodsExtra
();
CartGoods
.
CartGoodsExtra
goodsExtra
=
new
CartGoods
.
CartGoodsExtra
();
goodsExtra
.
setAttributeId
(
attribute
.
getAttributeId
());
goodsExtra
.
setAttributeId
(
attribute
.
getAttributeId
());
goodsExtra
.
setAttributeName
(
attribute
.
getAttributeValue
());
goodsExtra
.
setAttributeName
(
attribute
.
getAttributeValue
());
extra
.
add
(
goodsExtra
);
extra
.
add
(
goodsExtra
);
});
});
cartGoods
.
setExtra
(
extra
);
cartGoods
.
setExtra
(
extra
);
}
}
}
baseListCartGoodsVO
.
getProducts
().
add
(
cartGoods
);
baseListCartGoodsVO
.
getProducts
().
add
(
cartGoods
);
});
});
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
37be0ad6
...
@@ -786,10 +786,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -786,10 +786,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
)
{
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
)
{
if
(
Integer
.
valueOf
(
"5"
).
equals
(
showType
)
&&
!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
chooseSendGoodList
)){
if
(
Integer
.
valueOf
(
"5"
).
equals
(
showType
)
&&
!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
chooseSendGoodList
)){
chooseSendGoodList
.
forEach
(
good
->{
chooseSendGoodList
.
forEach
(
good
->{
ShoppingCartInfoRequestVo
.
SendGoods
first
=
null
;
ShoppingCartInfoRequestVo
.
SendGoods
first
=
null
;
if
(
sendGoods
!=
null
)
{
first
=
sendGoods
.
stream
().
filter
(
a
->
a
.
getGoodsId
().
equals
(
good
.
getSkuId
())
||
a
.
getGoodsId
().
equals
(
good
.
getSpuId
())).
findFirst
().
orElse
(
null
);
first
=
sendGoods
.
stream
().
filter
(
a
->
a
.
getGoodsId
().
equals
(
good
.
getPid
())).
findFirst
().
orElseGet
(
null
);
if
(
first
==
null
)
return
;
}
CartGoods
cartGoods
=
new
CartGoods
();
CartGoods
cartGoods
=
new
CartGoods
();
cartGoods
.
setSpuId
(
good
.
getSpuId
());
cartGoods
.
setSpuId
(
good
.
getSpuId
());
cartGoods
.
setSkuId
(
good
.
getSkuId
());
cartGoods
.
setSkuId
(
good
.
getSkuId
());
...
@@ -802,19 +801,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -802,19 +801,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
cartGoods
.
setGoodsId
(
good
.
getPid
());
cartGoods
.
setGoodsId
(
good
.
getPid
());
cartGoods
.
setName
(
good
.
getName
());
cartGoods
.
setName
(
good
.
getName
());
cartGoods
.
setSpuName
(
good
.
getSpuName
());
cartGoods
.
setSpuName
(
good
.
getSpuName
());
cartGoods
.
setQty
(
first
==
null
?
1
:
first
.
getQty
());
cartGoods
.
setQty
(
first
==
null
?
1
:
first
.
getQty
());
if
(
first
!=
null
)
{
cartGoods
.
setActivityCode
(
first
.
getActivityCode
());
cartGoods
.
setActivityCode
(
first
.
getActivityCode
());
if
(!
CollectionUtils
.
isEmpty
(
first
.
getAttributes
()))
{
if
(!
CollectionUtils
.
isEmpty
(
first
.
getAttributes
())){
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
();
List
<
CartGoods
.
CartGoodsExtra
>
extra
=
new
ArrayList
();
first
.
getAttributes
().
forEach
(
attribute
->
{
first
.
getAttributes
().
forEach
(
attribute
->
{
CartGoods
.
CartGoodsExtra
goodsExtra
=
new
CartGoods
.
CartGoodsExtra
();
CartGoods
.
CartGoodsExtra
goodsExtra
=
new
CartGoods
.
CartGoodsExtra
();
goodsExtra
.
setAttributeId
(
attribute
.
getAttributeId
());
goodsExtra
.
setAttributeId
(
attribute
.
getAttributeId
());
goodsExtra
.
setAttributeName
(
attribute
.
getAttributeValue
());
goodsExtra
.
setAttributeName
(
attribute
.
getAttributeValue
());
extra
.
add
(
goodsExtra
);
extra
.
add
(
goodsExtra
);
});
});
cartGoods
.
setExtra
(
extra
);
cartGoods
.
setExtra
(
extra
);
}
}
}
shoppingCartGoodsResponseVo
.
getProducts
().
add
(
cartGoods
);
shoppingCartGoodsResponseVo
.
getProducts
().
add
(
cartGoods
);
});
});
...
...
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