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
e4c55eaf
Commit
e4c55eaf
authored
Aug 07, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加料只做正常商品价格计算
parent
ba7aeb3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuySendPromotionService.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/MaterialPromotionService.java
+7
-13
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuySendPromotionService.java
View file @
e4c55eaf
...
@@ -269,6 +269,8 @@ public class BuySendPromotionService implements IPromotionService {
...
@@ -269,6 +269,8 @@ public class BuySendPromotionService implements IPromotionService {
cartGoods
.
setClassificationId
(
cartGood
.
getClassificationId
());
cartGoods
.
setClassificationId
(
cartGood
.
getClassificationId
());
cartGoods
.
setClassificationName
(
cartGood
.
getClassificationName
());
cartGoods
.
setClassificationName
(
cartGood
.
getClassificationName
());
cartGoods
.
setQty
(
sendGoods
.
getSendNumber
()
>
0
?
sendGoods
.
getSendNumber
()
:
SEND_NUMBER
);
cartGoods
.
setQty
(
sendGoods
.
getSendNumber
()
>
0
?
sendGoods
.
getSendNumber
()
:
SEND_NUMBER
);
//赠品不允许有加料
cartGood
.
setProductMaterialList
(
new
ArrayList
());
newCartGoodsList
.
add
(
cartGoods
);
newCartGoodsList
.
add
(
cartGoods
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/MaterialPromotionService.java
View file @
e4c55eaf
...
@@ -46,7 +46,9 @@ public class MaterialPromotionService implements IPromotionService {
...
@@ -46,7 +46,9 @@ public class MaterialPromotionService implements IPromotionService {
HashMap
<
String
,
MaterialApportion
>
map
=
getApportionGoodsDetail
(
calculationDiscountResult
);
HashMap
<
String
,
MaterialApportion
>
map
=
getApportionGoodsDetail
(
calculationDiscountResult
);
if
(
map
!=
null
&&
!
map
.
isEmpty
())
{
if
(
map
!=
null
&&
!
map
.
isEmpty
())
{
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
if
(
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductMaterialList
()))
continue
;
//非正常商品
if
(
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductMaterialList
())
||
!
cartGoods
.
getGoodsType
().
equals
(
GoodsTypeEnum
.
COMMON_GOODS
))
continue
;
for
(
CartGoods
.
MaterialGoods
materialGoods
:
cartGoods
.
getProductMaterialList
())
{
for
(
CartGoods
.
MaterialGoods
materialGoods
:
cartGoods
.
getProductMaterialList
())
{
MaterialApportion
apportion
=
map
.
get
(
materialGoods
.
getSpuId
());
MaterialApportion
apportion
=
map
.
get
(
materialGoods
.
getSpuId
());
//设置小料行单价和行总价
//设置小料行单价和行总价
...
@@ -86,7 +88,8 @@ public class MaterialPromotionService implements IPromotionService {
...
@@ -86,7 +88,8 @@ public class MaterialPromotionService implements IPromotionService {
if
(
map
==
null
&&
map
.
isEmpty
())
return
;
if
(
map
==
null
&&
map
.
isEmpty
())
return
;
List
<
ShoppingCartGoodsDto
.
CartGoodsDetailDto
>
products
=
shoppingCartGoodsDto
.
getProducts
();
List
<
ShoppingCartGoodsDto
.
CartGoodsDetailDto
>
products
=
shoppingCartGoodsDto
.
getProducts
();
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
product
:
products
)
{
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
product
:
products
)
{
if
(
CollectionUtils
.
isEmpty
(
product
.
getMaterialList
()))
continue
;
if
(
CollectionUtils
.
isEmpty
(
product
.
getMaterialList
())
||
!
product
.
getProductType
().
equals
(
GoodsTypeEnum
.
COMMON_GOODS
))
continue
;
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
materialGoods
:
product
.
getMaterialList
())
{
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
.
MaterialGoods
materialGoods
:
product
.
getMaterialList
())
{
MaterialApportion
material
=
map
.
get
(
materialGoods
.
getSpuId
());
MaterialApportion
material
=
map
.
get
(
materialGoods
.
getSpuId
());
if
(
material
.
getApportionAmount
().
intValue
()
==
0
)
continue
;
if
(
material
.
getApportionAmount
().
intValue
()
==
0
)
continue
;
...
@@ -128,21 +131,12 @@ public class MaterialPromotionService implements IPromotionService {
...
@@ -128,21 +131,12 @@ public class MaterialPromotionService implements IPromotionService {
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getApportionGoods
()))
{
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getApportionGoods
()))
{
return
null
;
return
null
;
}
}
/*
HashMap<String, ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.Material> hashMap = new HashMap<>();
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods apportionGood : calculationDiscountResult.getApportionGoods()) {
if (CollectionUtils.isEmpty(apportionGood.getSmallMaterial())) continue;
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.Material material : apportionGood.getSmallMaterial()) {
hashMap.put(material.getGoodsId(), material);
}
}
return hashMap;
*/
HashMap
<
String
,
MaterialApportion
>
mApportion
=
new
HashMap
<>();
HashMap
<
String
,
MaterialApportion
>
mApportion
=
new
HashMap
<>();
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ApportionGoods
apportionGood
:
calculationDiscountResult
.
getApportionGoods
())
{
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ApportionGoods
apportionGood
:
calculationDiscountResult
.
getApportionGoods
())
{
if
(
CollectionUtils
.
isEmpty
(
apportionGood
.
getSmallMaterial
()))
continue
;
if
(
CollectionUtils
.
isEmpty
(
apportionGood
.
getSmallMaterial
()))
continue
;
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ApportionGoods
.
Material
material
:
apportionGood
.
getSmallMaterial
())
{
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
ApportionGoods
.
Material
material
:
apportionGood
.
getSmallMaterial
())
{
if
(
material
.
getApportionAmount
()
>
0
&&
mApportion
.
get
(
material
.
getGoodsId
())
==
null
)
{
if
(
material
.
getApportionAmount
()
==
0
)
continue
;
if
(
mApportion
.
get
(
material
.
getGoodsId
())
==
null
)
{
MaterialApportion
materialApportion
=
new
MaterialApportion
();
MaterialApportion
materialApportion
=
new
MaterialApportion
();
materialApportion
.
setSalePrice
(
material
.
getNowPrice
());
materialApportion
.
setSalePrice
(
material
.
getNowPrice
());
materialApportion
.
setAmount
(
material
.
getNowPrice
()
*
material
.
getGoodsQuantity
());
materialApportion
.
setAmount
(
material
.
getNowPrice
()
*
material
.
getGoodsQuantity
());
...
...
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