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
a10765ab
Commit
a10765ab
authored
Dec 15, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::udpate::rollback
parent
74942a86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
43 deletions
+7
-43
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+7
-43
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
a10765ab
...
...
@@ -717,48 +717,12 @@ public class ShoppingCartConvertAdapter {
comboxGoods
.
setTaxId
(
isComboxGoods
?
(
StringUtils
.
isNotEmpty
(
productComboType
.
getTaxId
())
?
productComboType
.
getTaxId
()
:
""
)
:
(
StringUtils
.
isNotEmpty
(
groupDetailType
.
getTaxId
())
?
groupDetailType
.
getTaxId
()
:
""
));
//2020/12/1
5 套餐内可选商品加料,暂无
//2020/12/1
0 套餐内可选商品加料
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
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
{
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
<>());
}
}
List
<
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
materialGoods
=
new
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
MaterialGoods
();
productMaterialList
.
add
(
materialGoods
);
comboxGoods
.
setProductMaterialList
(
productMaterialList
);
}
}
...
...
@@ -907,7 +871,7 @@ public class ShoppingCartConvertAdapter {
try
{
//是否是sku商品
boolean
isSkuProduct
=
ObjectUtils
.
equals
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
(),
cartGoods
.
getGoodsType
())
||
!
ObjectUtils
.
equals
(
cartGoods
.
getSpuId
(),
cartGoods
.
getSkuId
());
||
!
ObjectUtils
.
equals
(
cartGoods
.
getSpuId
(),
cartGoods
.
getSkuId
());
// 如果是套餐商品,更新套餐内固定商品&可选商品的详细信息
boolean
isSetMealProduct
=
ObjectUtils
.
equals
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
ProductType
.
SetMeal
.
getCode
(),
spuProduct
.
getType
())
||
ObjectUtils
.
equals
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
ProductType
.
IncreasedPackage
.
getCode
(),
spuProduct
.
getType
());
ProductTypeBeanDTO
.
SkuProductBean
skuProduct
=
isSkuProduct
?
spuProduct
.
getSkuList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
cartGoods
.
getSkuId
(),
p
.
getSkuId
())).
findFirst
().
get
()
:
null
;
...
...
@@ -947,6 +911,7 @@ public class ShoppingCartConvertAdapter {
if
(
productCombo
.
getSpuId
()
!=
null
&&
!
productCombo
.
getSkuId
().
equals
(
productCombo
.
getSpuId
())
){
ProductTypeBeanDTO
productBeanDTO
=
subProductTypeMap
.
get
(
productCombo
.
getSpuId
());
updateComboxGoodsInfoFor
(
productCombo
,
productBeanDTO
,
true
);
}
else
{
//套餐子商品为单品
updateComboxGoodsInfoForMCoffee
(
productCombo
,
spuProduct
,
true
);
...
...
@@ -963,7 +928,6 @@ public class ShoppingCartConvertAdapter {
}
}
else
{
for
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
ComboxGoods
productGroup
:
cartGoods
.
getProductGroupList
())
{
// ProductTypeBeanDTO productBeanDTO = subProductTypeMap.get(productGroup.getSpuId());
updateComboxGoodsInfoForMCoffee
(
productGroup
,
spuProduct
,
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