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
30c6911d
Commit
30c6911d
authored
Sep 25, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix/20200924_修复问题临时分支' into develop
parents
59a9dbbb
f33b5737
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
17 deletions
+41
-17
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/adapter/ShoppingCartAdapter.java
+6
-3
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+20
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+12
-12
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
+1
-0
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/adapter/ShoppingCartAdapter.java
View file @
30c6911d
...
@@ -271,9 +271,12 @@ public class ShoppingCartAdapter {
...
@@ -271,9 +271,12 @@ public class ShoppingCartAdapter {
ProductBeanDTO
.
SkuProductBean
skuProduct
=
isSkuProduct
?
spuProduct
.
getSkuList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
cartGoods
.
getSkuId
(),
p
.
getSkuId
())).
findFirst
().
get
()
:
null
;
ProductBeanDTO
.
SkuProductBean
skuProduct
=
isSkuProduct
?
spuProduct
.
getSkuList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
cartGoods
.
getSkuId
(),
p
.
getSkuId
())).
findFirst
().
get
()
:
null
;
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
cartGoods
.
getExtra
());
Map
<
String
,
String
>
attributes
=
getAttributesNew
(
cartGoods
.
getExtra
());
cartGoods
.
setName
(
spuProduct
.
getName
());
if
(!
"早餐啡常搭"
.
equals
(
cartGoods
.
getName
())
&&
!
"早餐啡常搭"
.
equals
(
cartGoods
.
getSkuName
())
&&
!
"早餐啡常搭"
.
equals
(
cartGoods
.
getSpuName
())
cartGoods
.
setSpuName
(
spuProduct
.
getName
());
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getName
())
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getSkuName
())
&&
!
"啡常搭"
.
equals
(
cartGoods
.
getSpuName
()))
{
cartGoods
.
setSkuName
(
isSkuProduct
?
skuProduct
.
getProductName
()
:
spuProduct
.
getName
());
cartGoods
.
setName
(
spuProduct
.
getName
());
cartGoods
.
setSpuName
(
spuProduct
.
getName
());
cartGoods
.
setSkuName
(
isSkuProduct
?
skuProduct
.
getProductName
()
:
spuProduct
.
getName
());
}
cartGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
cartGoods
.
setSpecProductId
(
attributes
.
get
(
ATTRIBUTEID
));
cartGoods
.
setPic
(
spuProduct
.
getPicture
());
cartGoods
.
setPic
(
spuProduct
.
getPicture
());
cartGoods
.
setPackPrice
(
isSkuProduct
?
skuProduct
.
getPackPrice
()
:
spuProduct
.
getPackPrice
());
cartGoods
.
setPackPrice
(
isSkuProduct
?
skuProduct
.
getPackPrice
()
:
spuProduct
.
getPackPrice
());
...
...
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
View file @
30c6911d
...
@@ -188,7 +188,7 @@ public class DeliveryAdapter {
...
@@ -188,7 +188,7 @@ public class DeliveryAdapter {
deliveryProductInfo
.
setProductNumber
(
productList
.
getNumber
());
deliveryProductInfo
.
setProductNumber
(
productList
.
getNumber
());
deliveryProductInfo
.
setProductPrice
(
productList
.
getSalePrice
().
intValue
());
deliveryProductInfo
.
setProductPrice
(
productList
.
getSalePrice
().
intValue
());
//餐道使用
//餐道使用
deliveryProductInfo
.
setCumulatedTotal
(
productList
.
getNumber
()
*
productList
.
getPrice
().
intValue
());
deliveryProductInfo
.
setCumulatedTotal
(
productList
.
getNumber
()
*
productList
.
get
Sale
Price
().
intValue
());
OrderProductAddInfoDto
orderProductAddInfoDto
=
JSON
.
parseObject
(
productList
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
OrderProductAddInfoDto
orderProductAddInfoDto
=
JSON
.
parseObject
(
productList
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
deliveryProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderProductAddInfoDto
.
getTaxId
())
?
orderProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderProductAddInfoDto
.
getTaxId
())
?
orderProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryProductInfo
.
setTaxRate
(
orderProductAddInfoDto
.
getTax
()
>
0
?
orderProductAddInfoDto
.
getTax
()
:
6
);
deliveryProductInfo
.
setTaxRate
(
orderProductAddInfoDto
.
getTax
()
>
0
?
orderProductAddInfoDto
.
getTax
()
:
6
);
...
@@ -204,7 +204,7 @@ public class DeliveryAdapter {
...
@@ -204,7 +204,7 @@ public class DeliveryAdapter {
deliveryComboProductInfo
.
setProductNumber
(
comboProduct
.
getNumber
()/
productList
.
getNumber
());
deliveryComboProductInfo
.
setProductNumber
(
comboProduct
.
getNumber
()/
productList
.
getNumber
());
deliveryComboProductInfo
.
setProductPrice
(
comboProduct
.
getSalePrice
().
intValue
());
deliveryComboProductInfo
.
setProductPrice
(
comboProduct
.
getSalePrice
().
intValue
());
//餐道使用
//餐道使用
deliveryComboProductInfo
.
setCumulatedTotal
(
comboProduct
.
getNumber
()
*
comboProduct
.
getPrice
().
intValue
());
deliveryComboProductInfo
.
setCumulatedTotal
(
comboProduct
.
getNumber
()
*
comboProduct
.
get
Sale
Price
().
intValue
());
OrderProductAddInfoDto
orderComboProductAddInfoDto
=
JSON
.
parseObject
(
comboProduct
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
OrderProductAddInfoDto
orderComboProductAddInfoDto
=
JSON
.
parseObject
(
comboProduct
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
deliveryComboProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderComboProductAddInfoDto
.
getTaxId
())
?
orderComboProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryComboProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderComboProductAddInfoDto
.
getTaxId
())
?
orderComboProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryComboProductInfo
.
setTaxRate
(
orderComboProductAddInfoDto
.
getTax
()
>
0
?
orderComboProductAddInfoDto
.
getTax
()
:
6
);
deliveryComboProductInfo
.
setTaxRate
(
orderComboProductAddInfoDto
.
getTax
()
>
0
?
orderComboProductAddInfoDto
.
getTax
()
:
6
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
30c6911d
...
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
...
@@ -142,6 +143,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -142,6 +143,7 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
StringUtils
.
isNotEmpty
(
addShoppingCartGoodsRequestVo
.
getGroupName
()))
{
if
(
StringUtils
.
isNotEmpty
(
addShoppingCartGoodsRequestVo
.
getGroupName
()))
{
addCartGoods
.
setSkuName
(
addShoppingCartGoodsRequestVo
.
getGroupName
());
addCartGoods
.
setSkuName
(
addShoppingCartGoodsRequestVo
.
getGroupName
());
addCartGoods
.
setSpuName
(
addShoppingCartGoodsRequestVo
.
getGroupName
());
addCartGoods
.
setSpuName
(
addShoppingCartGoodsRequestVo
.
getGroupName
());
addCartGoods
.
setName
(
addShoppingCartGoodsRequestVo
.
getGroupName
());
}
}
//查询多个商品库存信息
//查询多个商品库存信息
// Integer checkQty = this.checkSkuQty(oldCartGoodsList, addCartGoods);
// Integer checkQty = this.checkSkuQty(oldCartGoodsList, addCartGoods);
...
@@ -655,6 +657,19 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -655,6 +657,19 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods
.
setQty
(
orderItem
.
getProductQuantity
());
cartGoods
.
setQty
(
orderItem
.
getProductQuantity
());
cartGoods
.
setSpuId
(
orderItem
.
getProductId
());
cartGoods
.
setSpuId
(
orderItem
.
getProductId
());
cartGoods
.
setSkuId
(
orderItem
.
getProductSpec
());
cartGoods
.
setSkuId
(
orderItem
.
getProductSpec
());
if
(
6
==
orderItem
.
getProductType
())
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
());
}
else
if
(
10
==
orderItem
.
getProductType
())
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
());
}
else
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
COMMON_GOODS
.
getGoodsType
());
}
if
((
"早餐啡常搭"
.
equals
(
orderItem
.
getProductName
())
&&
"早餐啡常搭"
.
equals
(
orderItem
.
getProductSpecName
()))
||
(
"啡常搭"
.
equals
(
orderItem
.
getProductName
())
&&
"啡常搭"
.
equals
(
orderItem
.
getProductSpecName
())))
{
cartGoods
.
setName
(
orderItem
.
getProductName
());
cartGoods
.
setSpuName
(
orderItem
.
getProductName
());
cartGoods
.
setSkuName
(
orderItem
.
getProductName
());
}
if
(
ObjectUtils
.
equals
(
ProductTypeEnum
.
SETMEAL_PRODUCT
.
getCode
(),
orderItem
.
getProductType
())
||
ObjectUtils
.
equals
(
ProductTypeEnum
.
SETMEAL_UPPRICE_PRODUCT
.
getCode
(),
orderItem
.
getProductType
()))
{
if
(
ObjectUtils
.
equals
(
ProductTypeEnum
.
SETMEAL_PRODUCT
.
getCode
(),
orderItem
.
getProductType
())
||
ObjectUtils
.
equals
(
ProductTypeEnum
.
SETMEAL_UPPRICE_PRODUCT
.
getCode
(),
orderItem
.
getProductType
()))
{
// 获取套餐子商品列表
// 获取套餐子商品列表
cartGoods
.
setProductComboList
(
new
ArrayList
<>());
cartGoods
.
setProductComboList
(
new
ArrayList
<>());
...
@@ -759,6 +774,11 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -759,6 +774,11 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
CartGoods
>
nowCartGoodsList
=
new
ArrayList
<>();
List
<
CartGoods
>
nowCartGoodsList
=
new
ArrayList
<>();
//判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1
//判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1
allCartGoodsList
.
forEach
(
oldCartGoods
->
{
allCartGoodsList
.
forEach
(
oldCartGoods
->
{
if
(
oldCartGoods
.
getSpuId
().
equals
(
addCartGoods
.
getSpuId
()))
{
oldCartGoods
.
setSpuName
(
addCartGoods
.
getSpuName
());
oldCartGoods
.
setSkuName
(
addCartGoods
.
getSpuName
());
oldCartGoods
.
setName
(
addCartGoods
.
getName
());
}
int
index
;
int
index
;
if
((
index
=
nowCartGoodsList
.
indexOf
(
oldCartGoods
))
>=
0
)
{
if
((
index
=
nowCartGoodsList
.
indexOf
(
oldCartGoods
))
>=
0
)
{
nowCartGoodsList
.
get
(
index
).
setQty
(
nowCartGoodsList
.
get
(
index
).
getQty
()
+
addCartGoods
.
getQty
());
nowCartGoodsList
.
get
(
index
).
setQty
(
nowCartGoodsList
.
get
(
index
).
getQty
()
+
addCartGoods
.
getQty
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
30c6911d
...
@@ -199,18 +199,18 @@ public class CalculationServiceImpl {
...
@@ -199,18 +199,18 @@ public class CalculationServiceImpl {
}
}
//订单级别券优惠
//订单级别券优惠
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
CouponResults
discount
:
calculationDiscountResult
.
getCouponDiscounts
())
{
//
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.CouponResults discount : calculationDiscountResult.getCouponDiscounts()) {
int
discountAmount
=
(
discount
.
getDiscountAmount
()
==
null
)
?
0
:
discount
.
getDiscountAmount
();
//
int discountAmount = (discount.getDiscountAmount() == null) ? 0 : discount.getDiscountAmount();
Integer
discountType
=
discount
.
getActivityType
();
//
Integer discountType = discount.getActivityType();
if
(
discountType
!=
null
&&
discountAmount
>
0
)
{
//
if (discountType != null && discountAmount > 0) {
ActivityDiscountsDto
activityDiscountsDto
=
new
ActivityDiscountsDto
();
//
ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto();
activityDiscountsDto
.
setActivityCode
(
discount
.
getCouponCode
());
//
activityDiscountsDto.setActivityCode(discount.getCouponCode());
activityDiscountsDto
.
setActivityName
(
discount
.
getActivityName
());
//
activityDiscountsDto.setActivityName(discount.getActivityName());
activityDiscountsDto
.
setActivityType
(
discountType
);
//
activityDiscountsDto.setActivityType(discountType);
activityDiscountsDto
.
setDiscountAmount
(
0
-
discountAmount
);
//
activityDiscountsDto.setDiscountAmount(0 - discountAmount);
activityDiscountsDtos
.
add
(
activityDiscountsDto
);
//
activityDiscountsDtos.add(activityDiscountsDto);
}
//
}
}
//
}
//过滤出加价购
//过滤出加价购
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
>
addMoneyDiscounts
=
discounts
.
stream
().
filter
(
discount
->
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
>
addMoneyDiscounts
=
discounts
.
stream
().
filter
(
discount
->
ActivityTypeEnum
.
TYPE_81
.
getCode
().
equals
(
discount
.
getType
())).
collect
(
Collectors
.
toList
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
View file @
30c6911d
...
@@ -61,6 +61,7 @@ public class SetMealCalculation {
...
@@ -61,6 +61,7 @@ public class SetMealCalculation {
// cartGoods.setOriginalAmount(cartGoods.getOriginalPrice() * cartGoods.getQty());
// cartGoods.setOriginalAmount(cartGoods.getOriginalPrice() * cartGoods.getQty());
cartGoods
.
setPackPrice
(
cartGoods
.
getPackPrice
()
*
cartGoods
.
getQty
());
cartGoods
.
setPackPrice
(
cartGoods
.
getPackPrice
()
*
cartGoods
.
getQty
());
// 可选商品现总价
// 可选商品现总价
productGroupTotalAmount
=
0
l
;
long
productGroupAmount
=
cartGoods
.
getProductGroupList
().
stream
().
mapToLong
(
t
->
t
.
getFinalPrice
()
*
t
.
getQty
()).
sum
();
long
productGroupAmount
=
cartGoods
.
getProductGroupList
().
stream
().
mapToLong
(
t
->
t
.
getFinalPrice
()
*
t
.
getQty
()).
sum
();
productGroupTotalAmount
+=
productGroupAmount
*
cartGoods
.
getQty
();
productGroupTotalAmount
+=
productGroupAmount
*
cartGoods
.
getQty
();
...
...
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