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
55b48ccf
Commit
55b48ccf
authored
Dec 15, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20201210_可选商品加料需求_yu.sun' into qa
parents
7648fee8
c9a96794
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
7 deletions
+43
-7
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+43
-7
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
55b48ccf
...
@@ -734,12 +734,48 @@ public class ShoppingCartConvertAdapter {
...
@@ -734,12 +734,48 @@ public class ShoppingCartConvertAdapter {
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
//
TODO: 2020/10/22
套餐内可选商品加料,暂无
//
2020/12/15
套餐内可选商品加料,暂无
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
parentProductBean
.
getAdditionalGroupList
()))
{
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
materialGoods
=
new
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
();
List
<
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
groupDetail
=
new
ArrayList
<>();
productMaterialList
.
add
(
materialGoods
);
for
(
ProductTypeBeanDTO
.
ProductGroupType
productGroupType
:
parentProductBean
.
getAdditionalGroupList
()){
comboxGoods
.
setProductMaterialList
(
productMaterialList
);
groupDetail
.
addAll
(
productGroupType
.
getGroupDetail
());
}
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
productMaterial
:
comboxGoods
.
getProductMaterialList
()){
for
(
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
productGroupType
:
groupDetail
){
if
(
productGroupType
.
getProductId
().
equals
(
productMaterial
.
getSpuId
())){
productMaterial
.
setSpuId
(
productGroupType
.
getProductId
());
productMaterial
.
setAmount
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setFinalPrice
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setOriginalAmount
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setOriginalPrice
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setSpuName
(
productGroupType
.
getProductName
());
}
}
}
}
else
{
if
(
CollectionUtils
.
isNotEmpty
(
parentProductBean
.
getAdditionalGroupList
())){
List
<
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
>
groupDetail
=
new
ArrayList
<>();
for
(
ProductTypeBeanDTO
.
ProductGroupType
productGroupType
:
parentProductBean
.
getAdditionalGroupList
()){
groupDetail
.
addAll
(
productGroupType
.
getGroupDetail
());
}
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
productMaterial
:
comboxGoods
.
getProductMaterialList
()){
for
(
ProductTypeBeanDTO
.
ProductGroupType
.
GroupDetailType
productGroupType
:
groupDetail
){
if
(
productGroupType
.
getProductId
().
equals
(
productMaterial
.
getSpuId
())){
productMaterial
.
setSpuId
(
productGroupType
.
getProductId
());
productMaterial
.
setAmount
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setFinalPrice
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setOriginalAmount
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setOriginalPrice
(
productGroupType
.
getProductFinalPrice
().
longValue
());
productMaterial
.
setSpuName
(
productGroupType
.
getProductName
());
}
}
}
}
else
{
//都不存在移除商品
comboxGoods
.
setProductMaterialList
(
new
ArrayList
<>());
}
}
}
}
}
}
...
@@ -928,7 +964,6 @@ public class ShoppingCartConvertAdapter {
...
@@ -928,7 +964,6 @@ public class ShoppingCartConvertAdapter {
if
(
productCombo
.
getSpuId
()
!=
null
&&
!
productCombo
.
getSkuId
().
equals
(
productCombo
.
getSpuId
())
){
if
(
productCombo
.
getSpuId
()
!=
null
&&
!
productCombo
.
getSkuId
().
equals
(
productCombo
.
getSpuId
())
){
ProductTypeBeanDTO
productBeanDTO
=
subProductTypeMap
.
get
(
productCombo
.
getSpuId
());
ProductTypeBeanDTO
productBeanDTO
=
subProductTypeMap
.
get
(
productCombo
.
getSpuId
());
updateComboxGoodsInfoFor
(
productCombo
,
productBeanDTO
,
true
);
updateComboxGoodsInfoFor
(
productCombo
,
productBeanDTO
,
true
);
}
else
{
}
else
{
//套餐子商品为单品
//套餐子商品为单品
updateComboxGoodsInfoForMCoffee
(
productCombo
,
spuProduct
,
true
);
updateComboxGoodsInfoForMCoffee
(
productCombo
,
spuProduct
,
true
);
...
@@ -945,7 +980,8 @@ public class ShoppingCartConvertAdapter {
...
@@ -945,7 +980,8 @@ public class ShoppingCartConvertAdapter {
}
}
}
else
{
}
else
{
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
productGroup
:
cartGoods
.
getProductGroupList
())
{
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
productGroup
:
cartGoods
.
getProductGroupList
())
{
updateComboxGoodsInfoForMCoffee
(
productGroup
,
spuProduct
,
false
);
ProductTypeBeanDTO
productBeanDTO
=
subProductTypeMap
.
get
(
productGroup
.
getSpuId
());
updateComboxGoodsInfoForMCoffee
(
productGroup
,
productBeanDTO
,
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