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
3a5f54fa
Commit
3a5f54fa
authored
Jan 07, 2021
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
9e470cc2
4a7ffe93
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
11 deletions
+52
-11
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+14
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+20
-11
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
+15
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
3a5f54fa
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
3a5f54fa
...
@@ -425,6 +425,9 @@ public class CartGoods {
...
@@ -425,6 +425,9 @@ public class CartGoods {
if
(
CollectionUtils
.
isNotEmpty
(
productGroupList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
productGroupList
))
{
for
(
ComboxGoods
goods
:
productGroupList
)
{
for
(
ComboxGoods
goods
:
productGroupList
)
{
originalString
.
append
(
goods
.
toString
());
originalString
.
append
(
goods
.
toString
());
if
(
CollectionUtils
.
isNotEmpty
(
goods
.
getProductMaterialList
()))
{
goods
.
getProductMaterialList
().
stream
().
sorted
(
Comparator
.
comparing
(
MaterialGoods:
:
getSpuId
)).
forEach
(
e
->
originalString
.
append
(
e
.
getSpuId
()));
}
}
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
productMaterialList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
productMaterialList
))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
3a5f54fa
...
@@ -1368,6 +1368,19 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1368,6 +1368,19 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods
.
setTax
(
productBeanListSpuClass
.
get
(
0
).
getTax
());
cartGoods
.
setTax
(
productBeanListSpuClass
.
get
(
0
).
getTax
());
cartGoods
.
setTaxId
(
productBeanListSpuClass
.
get
(
0
).
getTaxId
());
cartGoods
.
setTaxId
(
productBeanListSpuClass
.
get
(
0
).
getTaxId
());
//套餐固定商品赋值
if
(
CollectionUtils
.
isNotEmpty
(
productBeanListSpuClass
.
get
(
0
).
getProductComboList
())){
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductComboList
())){
for
(
CartGoods
.
ComboxGoods
comboxGoods
:
cartGoods
.
getProductComboList
())
{
for
(
ProductBeanDTO
.
ProductComboType
comboType:
productBeanListSpuClass
.
get
(
0
).
getProductComboList
()){
if
(
comboxGoods
.
getGoodsId
().
equals
(
comboType
.
getProductId
())
&&
comboType
.
getQuantity
()>
0
){
comboxGoods
.
setQty
(
comboType
.
getQuantity
());
}
}
}
}
}
//套餐可选商品赋值
//套餐可选商品赋值
if
(
CollectionUtils
.
isNotEmpty
(
productBeanListSpuClass
.
get
(
0
).
getProductGroupList
())){
if
(
CollectionUtils
.
isNotEmpty
(
productBeanListSpuClass
.
get
(
0
).
getProductGroupList
())){
for
(
ProductBeanDTO
.
ProductGroupType
groupType
:
productBeanListSpuClass
.
get
(
0
).
getProductGroupList
())
{
for
(
ProductBeanDTO
.
ProductGroupType
groupType
:
productBeanListSpuClass
.
get
(
0
).
getProductGroupList
())
{
...
@@ -1476,6 +1489,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1476,6 +1489,7 @@ public class ShoppingCartMCoffeeServiceImpl {
CartGoods
.
MaterialGoods
materialGoods
=
new
CartGoods
.
MaterialGoods
();
CartGoods
.
MaterialGoods
materialGoods
=
new
CartGoods
.
MaterialGoods
();
materialGoods
.
setSpuId
(
materialRequestVo
.
getSpuId
());
materialGoods
.
setSpuId
(
materialRequestVo
.
getSpuId
());
materialGoods
.
setGroupId
(
materialRequestVo
.
getGroupId
());
materialGoods
.
setGroupId
(
materialRequestVo
.
getGroupId
());
materialGoods
.
setCustomerCode
(
materialRequestVo
.
getCustomerCode
());
comboxMaterialGoodsList
.
add
(
materialGoods
);
comboxMaterialGoodsList
.
add
(
materialGoods
);
}
}
productCombox
.
setProductMaterialList
(
comboxMaterialGoodsList
);
productCombox
.
setProductMaterialList
(
comboxMaterialGoodsList
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
3a5f54fa
...
@@ -82,12 +82,8 @@ public class CalculationServiceImpl {
...
@@ -82,12 +82,8 @@ public class CalculationServiceImpl {
@Autowired
@Autowired
private
MaterialCalculation
materialCalculation
;
private
MaterialCalculation
materialCalculation
;
// @Autowired
// private ShoppingCartConvertAdapter shoppingCartConvertAdapter;
@Autowired
@Autowired
private
ShoppingCartMccafeAdapter
shoppingCartMccafeAdapter
;
private
ShoppingCartMccafeAdapter
shoppingCartMccafeAdapter
;
// @Autowired
// private ItemServiceImpl itemService;
/**
/**
* 更新购物车行优惠信息
* 更新购物车行优惠信息
...
@@ -414,13 +410,26 @@ public class CalculationServiceImpl {
...
@@ -414,13 +410,26 @@ public class CalculationServiceImpl {
if
(
"0"
.
equals
(
materialGoods
.
getGoodsId
())){
if
(
"0"
.
equals
(
materialGoods
.
getGoodsId
())){
continue
;
continue
;
}
}
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
material
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
productGroup
=
material
.
setType
(
2
);
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
material
.
setGoodsId
(
materialGoods
.
getGoodsId
());
productGroup
.
setType
(
2
);
material
.
setGoodsQuantity
(
materialGoods
.
getQty
());
productGroup
.
setGoodsId
(
materialGoods
.
getGoodsId
());
material
.
setOriginalPrice
(
null
!=
materialGoods
.
getFinalPrice
()
?
productGroup
.
setGoodsQuantity
(
materialGoods
.
getQty
());
productGroup
.
setOriginalPrice
(
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
()
:
0
);
materialGoods
.
getFinalPrice
()
:
0
);
materials
.
add
(
material
);
materials
.
add
(
productGroup
);
if
(
CollectionUtils
.
isNotEmpty
(
materialGoods
.
getProductMaterialList
())){
for
(
CartGoods
.
MaterialGoods
goods
:
materialGoods
.
getProductMaterialList
())
{
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
material
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
.
Material
();
material
.
setType
(
1
);
material
.
setGoodsId
(
goods
.
getSpuId
());
material
.
setGoodsQuantity
(
1
);
material
.
setOriginalPrice
(
null
!=
goods
.
getFinalPrice
()
?
goods
.
getFinalPrice
()
:
0
);
materials
.
add
(
material
);
}
}
}
}
}
}
...
@@ -508,7 +517,7 @@ public class CalculationServiceImpl {
...
@@ -508,7 +517,7 @@ public class CalculationServiceImpl {
//单品、多规格加料
//单品、多规格加料
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductMaterialList
())){
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductMaterialList
())){
for
(
CartGoods
.
MaterialGoods
materialGoods
:
cartGoods
.
getProductMaterialList
()){
for
(
CartGoods
.
MaterialGoods
materialGoods
:
cartGoods
.
getProductMaterialList
()){
materialPrice
+=
materialGoods
.
getFinalPrice
()
*
cartGoods
.
getQty
(
);
materialPrice
+=
(
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
()
:
0
)
*
(
null
!=
cartGoods
.
getQty
()
?
cartGoods
.
getQty
()
:
0
);
}
}
}
}
return
materialPrice
;
return
materialPrice
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
View file @
3a5f54fa
...
@@ -98,6 +98,21 @@ public class SetMealCalculation {
...
@@ -98,6 +98,21 @@ public class SetMealCalculation {
productGroupTotalAmount
+
productComboTotalAmount
+
materialPrice
;
productGroupTotalAmount
+
productComboTotalAmount
+
materialPrice
;
cartGoods
.
setAmount
(
amount
);
cartGoods
.
setAmount
(
amount
);
}
}
//套餐可选商品加料
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductGroupList
())){
for
(
CartGoods
.
ComboxGoods
comboxGoods
:
cartGoods
.
getProductGroupList
()){
Long
productGroupmaterialPrice
=
0L
;
if
(
CollectionUtils
.
isNotEmpty
(
comboxGoods
.
getProductMaterialList
())){
for
(
CartGoods
.
MaterialGoods
materialGoods
:
comboxGoods
.
getProductMaterialList
()){
productGroupmaterialPrice
+=
null
!=
materialGoods
.
getFinalPrice
()
?
materialGoods
.
getFinalPrice
()
*
cartGoods
.
getQty
()
:
0
;
}
}
comboxGoods
.
setAmount
((
null
==
comboxGoods
.
getAmount
()
?
0
:
comboxGoods
.
getAmount
())+
productGroupmaterialPrice
);
materialPrice
=
materialPrice
+
productGroupmaterialPrice
;
}
}
Long
comboOriginalPriceAmount
=
null
!=
cartGoods
.
getOriginalAmount
()
?
cartGoods
.
getOriginalAmount
()
:
Long
comboOriginalPriceAmount
=
null
!=
cartGoods
.
getOriginalAmount
()
?
cartGoods
.
getOriginalAmount
()
:
productComboTotalAmount
;
productComboTotalAmount
;
cartGoods
.
setOriginalAmount
(
productGroupTotalAmount
+
comboOriginalPriceAmount
+
materialPrice
);
cartGoods
.
setOriginalAmount
(
productGroupTotalAmount
+
comboOriginalPriceAmount
+
materialPrice
);
...
...
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