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
ffa8e2bf
Commit
ffa8e2bf
authored
Jun 10, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 订单调用购物车接口 codes的传参
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
85b2fc29
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
49 deletions
+69
-49
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/promotion/GetCalculationDiscountBO.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
+25
-10
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
+18
-23
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+20
-16
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/entities/bo/promotion/GetCalculationDiscountBO.java
View file @
ffa8e2bf
...
@@ -96,6 +96,11 @@ public class GetCalculationDiscountBO {
...
@@ -96,6 +96,11 @@ public class GetCalculationDiscountBO {
* 下标
* 下标
*/
*/
private
Integer
useIndex
;
private
Integer
useIndex
;
/**
* 优惠券类型
*/
private
Integer
couponType
;
}
}
@Data
@Data
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
View file @
ffa8e2bf
...
@@ -268,6 +268,7 @@ public class PlatformApportionService extends AbstractApportionService {
...
@@ -268,6 +268,7 @@ public class PlatformApportionService extends AbstractApportionService {
coupon
.
setCode
(
cp
.
getCouponCode
());
coupon
.
setCode
(
cp
.
getCouponCode
());
coupon
.
setActivityCode
(
cp
.
getActivityCode
());
coupon
.
setActivityCode
(
cp
.
getActivityCode
());
coupon
.
setUseIndex
(
cp
.
getIndex
()
==
null
?
x
+
oldCoupons
.
size
():
cp
.
getIndex
()
+
oldCoupons
.
size
());
coupon
.
setUseIndex
(
cp
.
getIndex
()
==
null
?
x
+
oldCoupons
.
size
():
cp
.
getIndex
()
+
oldCoupons
.
size
());
coupon
.
setCouponType
(
cp
.
getCouponType
());
oldCoupons
.
add
(
coupon
);
oldCoupons
.
add
(
coupon
);
}
}
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
View file @
ffa8e2bf
...
@@ -7,7 +7,6 @@ import cn.freemud.base.entity.BaseResponse;
...
@@ -7,7 +7,6 @@ import cn.freemud.base.entity.BaseResponse;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.activity.ActivityDiscountsDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
;
import
cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.entities.vo.*
;
...
@@ -23,7 +22,6 @@ import cn.freemud.service.thirdparty.SvcComPayClient;
...
@@ -23,7 +22,6 @@ import cn.freemud.service.thirdparty.SvcComPayClient;
import
cn.freemud.utils.PropertyConvertUtil
;
import
cn.freemud.utils.PropertyConvertUtil
;
import
cn.freemud.utils.RedisLock
;
import
cn.freemud.utils.RedisLock
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
import
com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
;
...
@@ -33,7 +31,6 @@ import com.freemud.application.sdk.api.paymentcenter.client.request.SVCCardAmoun
...
@@ -33,7 +31,6 @@ import com.freemud.application.sdk.api.paymentcenter.client.request.SVCCardAmoun
import
com.freemud.application.sdk.api.paymentcenter.client.response.SVCCardAmountResponse
;
import
com.freemud.application.sdk.api.paymentcenter.client.response.SVCCardAmountResponse
;
import
com.freemud.application.sdk.api.paymentcenter.client.service.PaymentNewService
;
import
com.freemud.application.sdk.api.paymentcenter.client.service.PaymentNewService
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
//import com.freemud.card.sdk.log.ErrorLog;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.domain.CollageMemberState
;
import
com.freemud.sdk.api.assortment.shoppingcart.domain.CollageMemberState
;
import
com.freemud.sdk.api.assortment.shoppingcart.domain.CollageOrderDto
;
import
com.freemud.sdk.api.assortment.shoppingcart.domain.CollageOrderDto
;
...
@@ -55,6 +52,8 @@ import java.util.stream.Collectors;
...
@@ -55,6 +52,8 @@ import java.util.stream.Collectors;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
//import com.freemud.card.sdk.log.ErrorLog;
/**
/**
* All rights Reserved, Designed By www.freemud.cn
* All rights Reserved, Designed By www.freemud.cn
*
*
...
@@ -635,8 +634,17 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
...
@@ -635,8 +634,17 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
couponCode
=
shoppingCartInfoRequestVo
.
getCouponCode
();
List
<
ShoppingCartInfoRequestVo
.
couponCode
>
couponCodes
=
shoppingCartInfoRequestVo
.
getCouponCodes
();
String
activityCode
=
shoppingCartInfoRequestVo
.
getActivityCode
();
if
(!
CollectionUtils
.
isEmpty
(
couponCodes
))
{
ShoppingCartInfoRequestVo
.
couponCode
otherCouponCode
=
couponCodes
.
stream
()
.
filter
(
couponCode
->
!
couponCode
.
getCouponType
().
equals
(
CouponTypeEnum
.
TYPE_5
.
getCode
()))
.
findFirst
().
orElse
(
null
);
if
(
otherCouponCode
!=
null
)
{
// 由于对下面逻辑 不是很清楚 并且修改了 优惠券传参规则 所以直接设置一遍 防止出错
shoppingCartInfoRequestVo
.
setCouponCode
(
otherCouponCode
.
getCouponCode
());
shoppingCartInfoRequestVo
.
setActivityCode
(
otherCouponCode
.
getActivityCode
());
}
}
String
tableNumber
=
assortmentCustomerInfoVo
.
getTableNumber
();
String
tableNumber
=
assortmentCustomerInfoVo
.
getTableNumber
();
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
...
@@ -681,12 +689,19 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
...
@@ -681,12 +689,19 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
// 当couponCode不为空时,需参与价格计算
// 当couponCode不为空时,需参与价格计算
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
// 配送券也加入
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
if
(!
CollectionUtils
.
isEmpty
(
couponCodes
))
{
coupon
.
setCode
(
couponCode
);
// 包含 couponCode 就重新设置
coupon
.
setActivityCode
(
activityCode
);
couponCodes
.
forEach
(
shoppingCouponCode
->
{
coupons
.
add
(
coupon
);
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
shoppingCouponCode
.
getCouponCode
());
coupon
.
setActivityCode
(
shoppingCouponCode
.
getActivityCode
());
coupon
.
setCouponType
(
shoppingCouponCode
.
getCouponType
());
coupons
.
add
(
coupon
);
});
}
}
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
processSendGoods
(
sendGoodsList
,
partnerId
,
storeId
,
shoppingCartInfoRequestVo
.
getMenuType
()
,
shoppingCartBaseService
);
processSendGoods
(
sendGoodsList
,
partnerId
,
storeId
,
shoppingCartInfoRequestVo
.
getMenuType
()
,
shoppingCartBaseService
);
}
else
{
}
else
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
View file @
ffa8e2bf
...
@@ -29,26 +29,26 @@ import cn.freemud.entities.ecology.VirtualStoreRequest;
...
@@ -29,26 +29,26 @@ import cn.freemud.entities.ecology.VirtualStoreRequest;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.*
;
import
cn.freemud.service.BuriedPointService
;
import
cn.freemud.service.ItemService
;
import
cn.freemud.service.ShoppingCartNewService
;
import
cn.freemud.service.impl.calculate.*
;
import
cn.freemud.service.impl.calculate.*
;
import
cn.freemud.service.shoppingCart.ShoppingCartRelationFactory
;
import
cn.freemud.service.shoppingCart.ShoppingCartRelationFactory
;
import
cn.freemud.service.shoppingCart.ShoppingCartRelationService
;
import
cn.freemud.service.shoppingCart.ShoppingCartRelationService
;
import
cn.freemud.service.thirdparty.*
;
import
cn.freemud.service.thirdparty.CustomerApplicationClient
;
import
cn.freemud.service.thirdparty.DeliveryFeiginClient
;
import
cn.freemud.service.thirdparty.EcologyAdminApplicationClient
;
import
cn.freemud.service.thirdparty.StockClient
;
import
cn.freemud.utils.PromotionFactory
;
import
cn.freemud.utils.PromotionFactory
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerStoreDeliveryConfig
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest
;
import
com.freemud.application.sdk.api.membercenter.response.QueryReceiveAddressResponse
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest
;
import
com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest
;
...
@@ -60,7 +60,6 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -60,7 +60,6 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.omg.PortableInterceptor.INACTIVE
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -528,8 +527,17 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
...
@@ -528,8 +527,17 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
couponCode
=
shoppingCartInfoRequestVo
.
getCouponCode
();
List
<
ShoppingCartInfoRequestVo
.
couponCode
>
couponCodes
=
shoppingCartInfoRequestVo
.
getCouponCodes
();
String
activityCode
=
shoppingCartInfoRequestVo
.
getActivityCode
();
if
(!
CollectionUtils
.
isEmpty
(
couponCodes
))
{
ShoppingCartInfoRequestVo
.
couponCode
otherCouponCode
=
couponCodes
.
stream
()
.
filter
(
couponCode
->
!
couponCode
.
getCouponType
().
equals
(
CouponTypeEnum
.
TYPE_5
.
getCode
()))
.
findFirst
().
orElse
(
null
);
if
(
otherCouponCode
!=
null
)
{
// 由于对下面逻辑 不是很清楚 并且修改了 优惠券传参规则 所以直接设置一遍 防止出错
shoppingCartInfoRequestVo
.
setCouponCode
(
otherCouponCode
.
getCouponCode
());
shoppingCartInfoRequestVo
.
setActivityCode
(
otherCouponCode
.
getActivityCode
());
}
}
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
=
shoppingCartInfoRequestVo
.
getSendGoods
();
...
@@ -558,12 +566,6 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
...
@@ -558,12 +566,6 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
assortmentCustomerInfoVo
.
getSessionId
(),
""
,
this
.
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
assortmentCustomerInfoVo
.
getSessionId
(),
""
,
this
.
shoppingCartBaseService
);
}
}
ArrayList
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
ArrayList
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
couponCode
);
coupon
.
setActivityCode
(
activityCode
);
coupons
.
add
(
coupon
);
}
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
...
@@ -574,13 +576,6 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
...
@@ -574,13 +576,6 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
CouponPromotionVO
couponPromotionVO
=
couponAdapter
.
getCouponPromotionVO
(
shoppingCartInfoRequestVo
,
userLoginInfoDto
);
CouponPromotionVO
couponPromotionVO
=
couponAdapter
.
getCouponPromotionVO
(
shoppingCartInfoRequestVo
,
userLoginInfoDto
);
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
// 当couponCode不为空时,需参与价格计算
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
couponCode
);
coupon
.
setActivityCode
(
activityCode
);
coupons
.
add
(
coupon
);
}
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
ffa8e2bf
...
@@ -82,7 +82,6 @@ import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseServi
...
@@ -82,7 +82,6 @@ import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseServi
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
javafx.util.Pair
;
import
javafx.util.Pair
;
import
lombok.extern.slf4j.Slf4j
;
import
ma.glasnost.orika.MapperFacade
;
import
ma.glasnost.orika.MapperFacade
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.ObjectUtils
;
...
@@ -988,8 +987,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -988,8 +987,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
appId
=
StringUtils
.
isEmpty
(
shoppingCartInfoRequestVo
.
getAppId
())?
userLoginInfoDto
.
getWxAppid
():
shoppingCartInfoRequestVo
.
getAppId
();
String
couponCode
=
shoppingCartInfoRequestVo
.
getCouponCode
();
List
<
ShoppingCartInfoRequestVo
.
couponCode
>
couponCodes
=
shoppingCartInfoRequestVo
.
getCouponCodes
();
String
activityCode
=
shoppingCartInfoRequestVo
.
getActivityCode
();
if
(!
CollectionUtils
.
isEmpty
(
couponCodes
))
{
ShoppingCartInfoRequestVo
.
couponCode
otherCouponCode
=
couponCodes
.
stream
()
.
filter
(
couponCode
->
!
couponCode
.
getCouponType
().
equals
(
CouponTypeEnum
.
TYPE_5
.
getCode
()))
.
findFirst
().
orElse
(
null
);
if
(
otherCouponCode
!=
null
)
{
// 由于对下面逻辑 不是很清楚 并且修改了 优惠券传参规则 所以直接设置一遍 防止出错
shoppingCartInfoRequestVo
.
setCouponCode
(
otherCouponCode
.
getCouponCode
());
shoppingCartInfoRequestVo
.
setActivityCode
(
otherCouponCode
.
getActivityCode
());
}
}
String
tableNumber
=
assortmentCustomerInfoVo
.
getTableNumber
();
String
tableNumber
=
assortmentCustomerInfoVo
.
getTableNumber
();
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
String
menuType
=
shoppingCartInfoRequestVo
.
getMenuType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
Integer
orderType
=
shoppingCartInfoRequestVo
.
getOrderType
();
...
@@ -1056,13 +1064,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1056,13 +1064,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
,
shoppingCartInfoRequestVo
.
getOrderType
());
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
,
shoppingCartInfoRequestVo
.
getOrderType
());
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
List
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
List
<
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
// 当couponCode不为空时,需参与价格计算
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
CalculationSharingDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
couponCode
);
coupon
.
setActivityCode
(
activityCode
);
coupons
.
add
(
coupon
);
}
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
...
@@ -1106,13 +1107,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1106,13 +1107,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
else
{
else
{
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
// 当couponCode不为空时,需参与价格计算
if
(!
CollectionUtils
.
isEmpty
(
couponCodes
))
{
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
couponCodes
.
forEach
(
shoppingCouponCode
->
{
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
coupon
=
new
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
();
coupon
.
setCode
(
couponCode
);
coupon
.
setCode
(
shoppingCouponCode
.
getCouponCode
());
coupon
.
setActivityCode
(
activityCode
);
coupon
.
setActivityCode
(
shoppingCouponCode
.
getActivityCode
());
coupons
.
add
(
coupon
);
coupon
.
setCouponType
(
shoppingCouponCode
.
getCouponType
());
coupons
.
add
(
coupon
);
});
}
}
// 获取优惠信息
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
);
//临时方案
//临时方案
...
...
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