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
870f063f
Commit
870f063f
authored
Dec 15, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/qa' into qa
parents
a3c7ab32
e1236f50
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
22 deletions
+46
-22
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+6
-2
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
+36
-19
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
870f063f
...
...
@@ -1220,7 +1220,7 @@ public class OrderAdapter {
responseVo
.
setOidBase64Image
(
oidBase64Image
);
}
//设置是否是第三方配送单
if
(
ordersBean
.
getAddInfo
()
!=
null
&&
StringUtils
.
isNotEmpty
(
ordersBean
.
getAddInfo
().
getDeliveryId
())&&
"0"
.
equals
(
ordersBean
.
getAddInfo
().
getDeliveryId
()))
{
if
(
ordersBean
.
getAddInfo
()
!=
null
&&
StringUtils
.
isNotEmpty
(
ordersBean
.
getAddInfo
().
getDeliveryId
())&&
!
"0"
.
equals
(
ordersBean
.
getAddInfo
().
getDeliveryId
()))
{
responseVo
.
setHasThirdDelivery
(
true
);
responseVo
.
setDeliveryId
(
ordersBean
.
getAddInfo
().
getDeliveryId
());
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
870f063f
...
...
@@ -964,8 +964,12 @@ public class ShoppingCartConvertAdapter {
Long
comboxGoodsOriginalPrice
=
cartGoods
.
getProductComboList
().
stream
().
mapToLong
(
t
->
t
.
getOriginalAmount
()).
sum
();
Long
groupGoodsOriginalPrice
=
cartGoods
.
getProductGroupList
().
stream
().
mapToLong
(
t
->
t
.
getOriginalAmount
()).
sum
();
Long
groupGoodsFinalPrice
=
cartGoods
.
getProductGroupList
().
stream
().
mapToLong
(
t
->
t
.
getFinalPrice
()).
sum
();
cartGoods
.
setOriginalPrice
(
null
!=
cartGoods
.
getOriginalPrice
()?
cartGoods
.
getOriginalPrice
()
:
comboxGoodsOriginalPrice
);
if
(
isSetMealProduct
&&
isSkuProduct
)
{
cartGoods
.
setOriginalPrice
(
null
!=
spuProduct
.
getFinalPrice
()
?
spuProduct
.
getFinalPrice
()
:
comboxGoodsOriginalPrice
);
}
else
{
cartGoods
.
setOriginalPrice
(
null
!=
cartGoods
.
getOriginalPrice
()
?
cartGoods
.
getOriginalPrice
()
:
comboxGoodsOriginalPrice
);
}
cartGoods
.
setOriginalAmount
((
cartGoods
.
getOriginalPrice
()+
groupGoodsOriginalPrice
)*
cartGoods
.
getQty
());
//咨询商品服务,套餐售价取originalPrice
cartGoods
.
setFinalPrice
(
null
!=
cartGoods
.
getOriginalPrice
()
?
cartGoods
.
getOriginalPrice
()
:
...
...
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
View file @
870f063f
...
...
@@ -354,6 +354,9 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
*/
public
void
updateShoppingCartGoodsDiscount
(
CouponPromotionVO
couponPromotionVO
,
ActivityQueryDto
activityQueryDto
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
List
<
CartGoods
>
cartGoodsList
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
UserLoginInfoDto
userLoginInfoDto
,
String
menuType
,
Long
deliveryAmount
)
{
log
.
info
(
"pindantest cuxiao->"
+
calculationDiscountResult
);
log
.
info
(
"pindantest cartGoodsList->"
+
cartGoodsList
);
log
.
info
(
"pindantest activityQueryDto->"
+
activityQueryDto
);
//默认计算优惠
DefaultPromotionService
defaultPromotionService
=
(
DefaultPromotionService
)
PromotionFactory
.
getPromotionService
(
ShoppingCartPromotionEnum
.
DEFAULT_PROMOTION
);
defaultPromotionService
.
updateShoppingCartGoodsDiscount
(
couponPromotionVO
,
activityQueryDto
,
calculationDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
,
userLoginInfoDto
,
shoppingCartInfoRequestVo
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
View file @
870f063f
...
...
@@ -140,7 +140,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
}
public
CartGoods
buildNewLine
(
CartGoods
cgs
,
Integer
activityType
,
Integer
qty
,
Long
newPrice
,
String
goodsId
){
public
CartGoods
buildNewLine
(
CartGoods
cgs
,
Integer
activityType
,
Integer
qty
,
Long
newPrice
,
String
goodsId
,
Long
originalPrice
){
CartGoods
newCartGoods
=
new
CartGoods
();
// 购物车的行设置和原来的行一致,便于前端在更新商品数量的时候。能够根据购物车行聚合商品数量
// 因为半价行是从主行中拆出来的
...
...
@@ -153,11 +153,11 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
newCartGoods
.
setSkuId
(
cgs
.
getSkuId
());
newCartGoods
.
setSpecProductId
(
cgs
.
getSpecProductId
());
// 价格只用一个商品的价格
newCartGoods
.
setOriginalPrice
(
cgs
.
getOriginalPrice
()
);
newCartGoods
.
setOriginalPrice
(
originalPrice
);
// 价格只用一个商品的价格
newCartGoods
.
setPackPrice
(
cgs
.
getPackPrice
());
// 价格只用一个商品的价格
newCartGoods
.
setOriginalAmount
(
cgs
.
getOriginalPrice
()
);
newCartGoods
.
setOriginalAmount
(
originalPrice
);
// 价格只用一个商品的价格
newCartGoods
.
setFinalPrice
(
newPrice
);
// 价格只用一个商品的价格
...
...
@@ -219,9 +219,9 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
// 构建半价行
CartGoods
cartGoods
=
new
CartGoods
();
if
(
i
<
2
){
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
product
.
getFinalPrice
(),
product
.
getGoodsId
());
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
product
.
getFinalPrice
(),
product
.
getGoodsId
()
,
null
);
}
else
{
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
product
.
getFinalPrice
(),
null
);
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
product
.
getFinalPrice
(),
null
,
null
);
}
newProducts
.
add
(
cartGoods
);
...
...
@@ -277,7 +277,33 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
List
<
CartGoods
>
halfProduct
=
new
ArrayList
<>();
for
(
int
x
=
0
;
x
<
products
.
size
()
;
x
++){
CartGoods
product
=
products
.
get
(
x
);
// 小料信息
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
==
null
){
continue
;
}
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
smallMaterial
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
();
Integer
smallMaterialOriTotal
=
0
;
Long
halfSmallMaterialOriTotal
=
0L
;
if
(
smallMaterial
!=
null
&&
!
smallMaterial
.
isEmpty
()){
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
sm
:
smallMaterial
){
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
smDiscounts
=
sm
.
getDiscounts
();
if
(
smDiscounts
!=
null
&&
!
smDiscounts
.
isEmpty
()){
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
smDiscount
:
smDiscounts
){
if
(
ObjectUtils
.
equals
(
smDiscount
.
getType
(),
ActivityTypeEnum
.
TYPE_53
.
getCode
())){
halfSmallMaterialOriTotal
=
halfSmallMaterialOriTotal
+
smDiscount
.
getSignleDiscount
();
}
}
}
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
}
// 商品的单价 = 商品单价+小料单价
Long
originalPrice
=
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getOriginalPrice
());
// 要添加的半价行数量,该字段从促销返回
Integer
num
=
0
;
// 商品优惠的金额
...
...
@@ -292,9 +318,11 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
// 第二件优惠活动,在点餐页需要给优惠商品单独显示一行
// 复制商品加到购物车
discountAmount
=
discount
.
getDiscount
();
Long
newPrice
=
product
.
getOriginalPrice
()
-
discountAmount
;
// 现单价 = 商品原单价+小料原单价-商品现单价小料现单价
Long
newPrice
=
originalPrice
-
discountAmount
-
halfSmallMaterialOriTotal
;
// 构建半价行
CartGoods
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
newPrice
,
product
.
getGoodsId
());
CartGoods
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
newPrice
,
product
.
getGoodsId
()
,
originalPrice
);
halfProduct
.
add
(
cartGoods
);
}
}
...
...
@@ -328,19 +356,8 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
product
.
setGoodsId
(
null
);
}
ApiLog
.
info
(
"coco小料"
,
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()),
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
());
// 小料信息
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
==
null
){
continue
;
}
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
smallMaterial
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
();
Integer
smallMaterialOriTotal
=
0
;
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
sm
:
smallMaterial
){
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
// 商品的单价 = 商品单价+小料单价
product
.
setOriginalPrice
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getOriginalPrice
()
);
product
.
setOriginalPrice
(
originalPrice
);
// 商品现单价 = 商品现单价+小料现单价
product
.
setFinalPrice
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getFinalPrice
());
...
...
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