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
5edf0984
Commit
5edf0984
authored
Mar 18, 2020
by
姜海波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
满额减配送费
parent
d63df331
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
12 deletions
+22
-12
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+2
-2
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+2
-0
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+17
-10
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
5edf0984
...
@@ -126,7 +126,7 @@ public class OrderAdapter {
...
@@ -126,7 +126,7 @@ public class OrderAdapter {
long
deliveryAmount
=
0
;
long
deliveryAmount
=
0
;
long
discountDeliveryAmount
=
0
;
long
discountDeliveryAmount
=
0
;
if
(
deliveryInfoDto
!=
null
)
{
if
(
deliveryInfoDto
!=
null
)
{
deliveryAmount
=
getUserRealDeliveryAmount
(
deliveryInfoDto
.
getStoreDeliveryInfoDto
(),
deliveryInfoDto
.
getUserLongitude
(),
deliveryInfoDto
.
getUserLatitude
()
);
deliveryAmount
=
shoppingCartGoodsDto
.
getDeliveryAmount
(
);
if
(
shoppingCartGoodsDto
.
getIsDiscountDelivery
()
&&
deliveryAmount
>
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
()){
if
(
shoppingCartGoodsDto
.
getIsDiscountDelivery
()
&&
deliveryAmount
>
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
()){
discountDeliveryAmount
=
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
();
discountDeliveryAmount
=
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
();
...
@@ -586,7 +586,7 @@ public class OrderAdapter {
...
@@ -586,7 +586,7 @@ public class OrderAdapter {
long
deliveryAmount
=
0
;
long
deliveryAmount
=
0
;
long
discountDeliveryAmount
=
0
;
long
discountDeliveryAmount
=
0
;
if
(
userDeliveryInfoDto
!=
null
)
{
if
(
userDeliveryInfoDto
!=
null
)
{
deliveryAmount
=
getUserRealDeliveryAmount
(
userDeliveryInfoDto
.
getStoreDeliveryInfoDto
(),
userDeliveryInfoDto
.
getUserLongitude
(),
userDeliveryInfoDto
.
getUserLatitude
()
);
deliveryAmount
=
shoppingCartGoodsDto
.
getDeliveryAmount
(
);
if
(
shoppingCartGoodsDto
.
getIsDiscountDelivery
()
&&
deliveryAmount
>
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
()){
if
(
shoppingCartGoodsDto
.
getIsDiscountDelivery
()
&&
deliveryAmount
>
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
()){
discountDeliveryAmount
=
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
();
discountDeliveryAmount
=
shoppingCartGoodsDto
.
getDiscountDeliveryAmount
();
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
5edf0984
...
@@ -93,6 +93,8 @@ public class ShoppingCartInfoRequestVo {
...
@@ -93,6 +93,8 @@ public class ShoppingCartInfoRequestVo {
*/
*/
private
String
channelType
;
private
String
channelType
;
private
String
receiveId
;
@Data
@Data
public
final
static
class
SendGoods
{
public
final
static
class
SendGoods
{
/**
/**
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
5edf0984
...
@@ -296,6 +296,7 @@ public class CheckOrder {
...
@@ -296,6 +296,7 @@ public class CheckOrder {
.
orderType
(
createOrderVo
.
getOrderType
())
.
orderType
(
createOrderVo
.
getOrderType
())
.
reachStoreType
(
createOrderVo
.
getReachStoreType
())
.
reachStoreType
(
createOrderVo
.
getReachStoreType
())
.
flag
(
CouponFlag
.
NO
.
getCode
())
.
flag
(
CouponFlag
.
NO
.
getCode
())
.
receiveId
(
createOrderVo
.
getReceiveId
())
.
useCustomerScore
(
createOrderVo
.
getUseCustomerScore
())
.
useCustomerScore
(
createOrderVo
.
getUseCustomerScore
())
.
buyMemberCard
(
buyMemberCard
)
.
buyMemberCard
(
buyMemberCard
)
.
menuType
(
createOrderVo
.
getMenuType
())
.
menuType
(
createOrderVo
.
getMenuType
())
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
5edf0984
...
@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -257,7 +257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>());
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>()
,
null
);
// 当商品数量被设为0时
// 当商品数量被设为0时
...
@@ -346,7 +346,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -346,7 +346,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>());
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>()
,
null
);
if
(
calculationDiscountResult
==
null
)
{
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
// return shoppingCartGoodsResponseVo;
// return shoppingCartGoodsResponseVo;
...
@@ -445,7 +445,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -445,7 +445,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
coupons
,
null
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
coupons
,
null
,
shoppingCartInfoRequestVo
.
getReceiveId
()
);
if
(
calculationDiscountResult
==
null
)
{
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
...
@@ -607,7 +607,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -607,7 +607,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
}
}
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
()
);
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
...
@@ -1410,18 +1410,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1410,18 +1410,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
getCalculationDiscountResult
(
String
menuType
private
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
getCalculationDiscountResult
(
String
menuType
,
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
String
wxappid
,
Integer
orderType
,
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
String
wxappid
,
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
){
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
){
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
null
;
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
null
;
//外卖场景下 查询门店配送信息
//外卖场景下 查询门店配送信息
if
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
().
equals
(
menuType
)){
if
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
().
equals
(
menuType
)){
//TODO 查询门店信息
Long
deliveryAmount
=
0
l
;
StoreResponseDto
storeResponseDto
=
storeService
.
getStoreInfo
(
partnerId
,
storeId
);
if
(
receiveId
!=
null
)
{
//TODO 查询门店外卖信息
//TODO 查询门店信息
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
storeService
.
getStoreDeliveryInfo
(
storeResponseDto
,
wxappid
);
StoreResponseDto
storeResponseDto
=
storeService
.
getStoreInfo
(
partnerId
,
storeId
);
//TODO 查询门店外卖信息
StoreDeliveryInfoDto
storeDeliveryInfoDto
=
storeService
.
getStoreDeliveryInfo
(
storeResponseDto
,
wxappid
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
storeDeliveryInfoDto
.
getDeliveryAmount
());
deliveryAmount
=
storeDeliveryInfoDto
.
getDeliveryAmount
();
}
else
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
}
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
);
}
else
{
}
else
{
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
);
}
}
...
...
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