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
d3791d11
Commit
d3791d11
authored
Aug 28, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
28615c84
3b6ca1ff
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
68 deletions
+85
-68
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
+7
-4
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+12
-23
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/service/OrderSdkService.java
+7
-5
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMemberCouponListRequestDto.java
+10
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+15
-13
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+28
-23
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/TimeSaleCalculation.java
+1
-0
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
View file @
d3791d11
...
...
@@ -181,6 +181,9 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
@Override
public
String
paySuccessCallback
(
PaysuccessNoticeMessage
message
)
{
if
(
StringUtils
.
isEmpty
(
message
.
getTrans_id
())){
return
orderAdapter
.
newSendPayFaileMessage
();
}
//添加分布式锁,如果没有取得锁直接返回失败;整个方法执行完毕后会删掉该锁
String
paySuccessKey
=
PAY_SUCCESS_KEY
+
message
.
getTrans_id
();
if
(!
LockUtils
.
lockAfter
(
redisCache
.
getRedisTemplate
(),
paySuccessKey
)){
...
...
@@ -203,19 +206,19 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
if
(!
PayStatus
.
NOT_PAY
.
getCode
().
equals
(
orderBean
.
getPayStatus
())){
return
orderAdapter
.
sendPaySuccessNoticeMessage
();
}
/*
*
/*
* 围餐处理
*/
if
(
"meals"
.
equals
(
orderBean
.
getSource
()))
{
return
orderCommonService
.
paySuccessCallback
(
message
,
confirmOrderDto
,
orderBeans
);
}
/*
*
/*
* 微商城处理
*/
if
(
OrderSourceType
.
SAASMALL
.
getCode
().
equals
(
orderBean
.
getSource
()))
{
return
mallOrderService
.
paySuccessCallback
(
message
,
confirmOrderDto
,
orderBeans
);
}
/*
*
/*
* app订单处理
*/
if
(
OrderSourceType
.
APP
.
getCode
().
equals
(
orderBean
.
getSource
()))
{
...
...
@@ -229,7 +232,7 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
if
(
mcCafePartnerId
.
equals
(
orderBean
.
getOid
()))
{
return
mcCafeOrderService
.
paySuccessCallback
(
message
,
confirmOrderDto
,
orderBeans
);
}
/*
*
/*
* 默认点餐处理
*/
return
orderService
.
paySuccessCallback
(
message
,
confirmOrderDto
,
orderBeans
);
...
...
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
d3791d11
...
...
@@ -69,8 +69,6 @@ import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustome
import
com.freemud.api.assortment.datamanager.meal.MealCacheManager
;
import
com.freemud.application.sdk.api.constant.ResponseConstant
;
import
com.freemud.application.sdk.api.constant.ResponseResultEnum
;
import
com.freemud.application.sdk.api.couponcenter.offline.request.CouponRequest
;
import
com.freemud.application.sdk.api.couponcenter.offline.response.CouponRedeemResponse
;
import
com.freemud.application.sdk.api.couponcenter.offline.service.OfflineCouponSdkService
;
import
com.freemud.application.sdk.api.deliverycenter.response.DeliveryInfoDto
;
import
com.freemud.application.sdk.api.deliverycenter.response.DeliveryResponseDto
;
...
...
@@ -97,7 +95,6 @@ import com.freemud.application.sdk.api.paymentcenter.client.response.SVCCardAmou
import
com.freemud.application.sdk.api.paymentcenter.client.service.PaymentNewService
;
import
com.freemud.application.sdk.api.storecenter.request.GetListByCodesRequest
;
import
com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest
;
import
com.freemud.application.sdk.api.storecenter.request.vo.GetOrgTreeListRequest
;
import
com.freemud.application.sdk.api.storecenter.response.GetListByCodesResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
...
...
@@ -151,7 +148,6 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
static
cn
.
freemud
.
constant
.
OrderRefundConstant
.
ALLOW_REFUND
;
import
static
com
.
freemud
.
sdk
.
api
.
assortment
.
order
.
domain
.
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
;
@Service
@Slf4j
...
...
@@ -405,6 +401,13 @@ public class OrderServiceImpl implements Orderservice {
}
//若该订单使用了优惠券,则移除卡包,移除失败也不退款,现在支付成功个调用核销,无需调用此功能
// couponActivityService.callbackNotify(orderBean);
// 核销券码成功才能支付成功
BaseResponse
baseResponse
=
verificationCoupon
(
message
.
getTrans_id
());
if
(!
Objects
.
equals
(
ResponseResult
.
SUCCESS
.
getCode
(),
baseResponse
.
getCode
()))
{
// 核销失败
log
.
error
(
"核销券码失败transId:{},message:{}"
,
message
.
getTrans_id
(),
baseResponse
.
getMessage
());
return
newSendPayFaileMessage
();
}
// 订单失败后 发消息重试 待实现
String
takeCode
;
String
daySeq
;
...
...
@@ -562,29 +565,16 @@ public class OrderServiceImpl implements Orderservice {
message
.
setTotal_fee
(
newMessage
.
getTotalAmount
()
==
null
?
0
:
newMessage
.
getTotalAmount
());
message
.
setOpenid
(
StringUtils
.
isBlank
(
newMessage
.
getOpenId
())
?
""
:
newMessage
.
getOpenId
());
message
.
setPlatform_coupon
(
newMessage
.
getPlatformCoupon
()
==
null
?
0
:
newMessage
.
getPlatformCoupon
());
message
.
setMerchant_coupon
(
newMessage
.
get
PlatformCoupon
()
==
null
?
0
:
newMessage
.
getPlatform
Coupon
());
message
.
setMerchant_coupon
(
newMessage
.
get
MerchantCoupon
()
==
null
?
0
:
newMessage
.
getMerchant
Coupon
());
message
.
setPaid_no
(
newMessage
.
getThirdPartTradeNo
());
message
.
setEndTransId
(
newMessage
.
getEndTransId
());
message
.
setPlatformMchId
(
newMessage
.
getPlatformMchId
());
message
.
setTerminalId
(
newMessage
.
getAppId
());
message
.
setRuleId
(
newMessage
.
getRuleId
());
String
res
=
orderAdapterService
.
paySuccessCallback
(
message
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
res
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
Integer
code
=
(
Integer
)
jsonObject
.
get
(
"code"
);
if
(
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_0
,
code
)
||
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
,
code
))
{
log
.
info
(
"调用券码核销=="
+
newMessage
.
getTransId
());
verificationCoupon
(
newMessage
.
getTransId
());
log
.
info
(
"调用券码结束=="
+
newMessage
.
getTransId
());
return
newSendPaySuccessNoticeMessage
();
}
else
{
return
newSendPayFaileMessage
();
}
}
return
newSendPayFaileMessage
();
return
orderAdapterService
.
paySuccessCallback
(
message
);
}
private
String
verificationCoupon
(
String
transId
){
private
BaseResponse
verificationCoupon
(
String
transId
){
String
orderId
=
redisCache
.
getValue
(
RedisUtil
.
getPaymentTransIdOrderKey
(
transId
));
if
(
StringUtils
.
isNotBlank
(
orderId
))
{
log
.
info
(
"从缓存中获取的订单数据,trackingNo:{},transId:{},orderId:{}"
,
LogTreadLocal
.
getTrackingNo
(),
transId
,
orderId
);
...
...
@@ -592,7 +582,7 @@ public class OrderServiceImpl implements Orderservice {
}
QueryRelationOrderByIdResponseDto
queryOrderByIdResponseDto
=
getQueryRelationOrderByIdResponseDto
(
transId
);
if
(
queryOrderByIdResponseDto
.
getData
()
==
null
||
!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
,
queryOrderByIdResponseDto
.
getErrcode
()))
{
return
refundFaileMessage
(
"order query fail"
+
queryOrderByIdResponseDto
);
return
ResponseUtil
.
error
(
String
.
valueOf
(
queryOrderByIdResponseDto
.
getErrcode
()),
queryOrderByIdResponseDto
.
getErrmsg
()
);
}
OrderBean
orderBean
=
new
OrderBean
();
if
(
1
==
queryOrderByIdResponseDto
.
getData
().
size
())
{
...
...
@@ -604,8 +594,7 @@ public class OrderServiceImpl implements Orderservice {
}
}
//核销券
BaseResponse
baseResponse
=
couponActivityService
.
verificationCoupon
(
orderBean
,
CouponReqType
.
WRITEOFF
);
return
"核销券码返回结果"
+
baseResponse
.
getCode
()
+
","
+
baseResponse
.
getMessage
();
return
couponActivityService
.
verificationCoupon
(
orderBean
,
CouponReqType
.
WRITEOFF
);
}
@Override
...
...
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/service/OrderSdkService.java
View file @
d3791d11
package
com
.
freemud
.
application
.
sdk
.
api
.
ordercenter
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.freemud.application.sdk.api.base.BaseRequest
;
import
com.freemud.application.sdk.api.ordercenter.config.OrderCenterProperties
;
import
com.freemud.application.sdk.api.ordercenter.constant.InterfaceAddressConstant
;
...
...
@@ -29,9 +30,10 @@ import org.springframework.core.ParameterizedTypeReference;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.*
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
static
com
.
freemud
.
application
.
sdk
.
api
.
ordercenter
.
constant
.
InterfaceAddressConstant
.*;
...
...
@@ -618,8 +620,8 @@ public class OrderSdkService {
resp
=
null
;
}
else
{
List
<
OrderInfoReqs
>
result
;
if
(
Objects
.
equals
(
ResponseConstant
.
SUCCESS_RESPONSE_CODE
,
responseDTO
.
getCode
()))
{
result
=
JSON
.
parseArray
(
Objects
.
toString
(
responseDTO
.
getResult
(),
"[]"
),
OrderInfoReqs
.
class
);
if
(
Objects
.
equals
(
ResponseConstant
.
SUCCESS_RESPONSE_CODE
,
responseDTO
.
getCode
())
&&
responseDTO
.
getResult
()
instanceof
List
)
{
result
=
JSON
Array
.
parseArray
(
JSON
.
toJSONString
(
responseDTO
.
getResult
()
),
OrderInfoReqs
.
class
);
}
else
{
result
=
Collections
.
emptyList
();
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetMemberCouponListRequestDto.java
View file @
d3791d11
...
...
@@ -47,4 +47,14 @@ public class GetMemberCouponListRequestDto {
*/
private
Integer
pageSize
;
//以下为麦咖啡需要参数
private
String
appId
;
private
String
unionId
;
private
String
thirdPartyMemberId
;
private
String
tag
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
d3791d11
...
...
@@ -90,6 +90,11 @@ public class CartGoods {
* 购物车一行商品的数量
*/
private
Integer
qty
;
/**
* 参与活动商品数量 前端展示参数
*/
private
Integer
activityNumber
;
/**
* 购物车一行商品的名称
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
d3791d11
...
...
@@ -116,9 +116,9 @@ public class ShoppingCartMCoffeeServiceImpl {
String
spuId2
=
spuId
;
List
<
Long
>
productIds
=
new
ArrayList
<>();
//商品券校验
if
(
spuId
.
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
if
(
spuId
.
startsWith
(
CommonsConstant
.
COUPON_PREFIX
))
{
couponCode
=
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
,
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
());
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
,
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
());
goodsId
=
spuId2
;
}
productIds
.
add
(
Long
.
parseLong
(
goodsId
));
...
...
@@ -133,7 +133,7 @@ public class ShoppingCartMCoffeeServiceImpl {
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
);
setClassificationAndPrice
(
addCartGoods
,
productBeanListSpuClass
);
//查询多个商品库存信息
// Integer checkQty = this.checkSkuQty(oldCartGoodsList, addCartGoods);
...
...
@@ -159,9 +159,9 @@ public class ShoppingCartMCoffeeServiceImpl {
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
private
String
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
,
String
menuType
)
{
private
String
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
,
String
menuType
)
{
String
spuId2
;
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()),
menuType
);
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()),
menuType
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
);
if
(
checkSpqInfoResponseDto
==
null
)
{
...
...
@@ -320,9 +320,11 @@ public class ShoppingCartMCoffeeServiceImpl {
// 获取用户信息
CustomerInfoVo
assortmentCustomerInfoVo
=
getCustomerInfoVo
(
shoppingCartInfoRequestVo
.
getSessionId
());
String
userId
=
assortmentCustomerInfoVo
.
getMemberId
();
String
thirdPartyMemberID
=
assortmentCustomerInfoVo
.
getThirdPartyMemberID
();
String
unionId
=
assortmentCustomerInfoVo
.
getUnionId
();
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
//
String appId = shoppingCartInfoRequestVo.getAppId();
String
appId
=
shoppingCartInfoRequestVo
.
getAppId
();
//非商品券券号
String
couponCode
=
shoppingCartInfoRequestVo
.
getCouponCode
();
// String menuType = shoppingCartInfoRequestVo.getMenuType();
...
...
@@ -335,7 +337,7 @@ public class ShoppingCartMCoffeeServiceImpl {
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_ADD_INVAILD
);
}
// 获取购物车商品-查询用户券-券码校验可用券
availableCoupon
=
couponDiscountCalculation
.
availableCoupon
(
partnerId
,
storeId
,
userId
,
couponCode
,
orderType
,
cartGoodsList
);
availableCoupon
=
couponDiscountCalculation
.
availableCoupon
(
partnerId
,
storeId
,
userId
,
thirdPartyMemberID
,
unionId
,
appId
,
couponCode
,
orderType
,
cartGoodsList
);
return
ResponseUtil
.
success
(
availableCoupon
);
}
...
...
@@ -489,8 +491,8 @@ public class ShoppingCartMCoffeeServiceImpl {
/**
* 清除购物车商品券
*/
private
void
clearCartCouponGoods
(
String
partnerId
,
String
storeId
,
String
userId
,
String
sessionId
,
List
<
CartGoods
>
cartGoodsList
)
{
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
private
void
clearCartCouponGoods
(
String
partnerId
,
String
storeId
,
String
userId
,
String
sessionId
,
List
<
CartGoods
>
cartGoodsList
)
{
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
return
;
}
cartGoodsList
=
cartGoodsList
.
stream
().
filter
(
cartGoods
->
cartGoods
.
getCouponCode
()
==
null
).
collect
(
Collectors
.
toList
());
...
...
@@ -756,7 +758,7 @@ public class ShoppingCartMCoffeeServiceImpl {
private
List
<
CartGoods
>
checkNewCartGoods
(
List
<
CartGoods
>
newCartGoods
,
CartGoods
addCartGoods
)
{
Integer
qty
=
addCartGoods
.
getQty
()
==
null
?
0
:
addCartGoods
.
getQty
();
if
(
StringUtils
.
isNotBlank
(
addCartGoods
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotBlank
(
addCartGoods
.
getCouponCode
()))
{
newCartGoods
.
add
(
addCartGoods
);
return
newCartGoods
;
}
...
...
@@ -764,8 +766,8 @@ public class ShoppingCartMCoffeeServiceImpl {
boolean
isadd
=
true
;
if
(
CollectionUtils
.
isNotEmpty
(
newCartGoods
))
{
for
(
CartGoods
goods
:
newCartGoods
)
{
if
(
goods
.
getSkuId
().
equals
(
addCartGoods
.
getSkuId
())
&&
goods
.
getSpuId
().
equals
(
addCartGoods
.
getSpuId
())){
if
(
goods
.
getProductGroupList
()
!=
null
&&
addCartGoods
.
getProductGroupList
()
!=
null
&&
goods
.
getProductGroupList
().
size
()
==
addCartGoods
.
getProductGroupList
().
size
())
{
if
(
goods
.
getSkuId
().
equals
(
addCartGoods
.
getSkuId
())
&&
goods
.
getSpuId
().
equals
(
addCartGoods
.
getSpuId
()))
{
if
(
goods
.
getProductGroupList
()
!=
null
&&
addCartGoods
.
getProductGroupList
()
!=
null
&&
goods
.
getProductGroupList
().
size
()
==
addCartGoods
.
getProductGroupList
().
size
())
{
}
}
...
...
@@ -862,7 +864,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
public
static
CartGoods
convent2CartGoods
(
MCoffeeAddGoodsRequestVo
addShoppingCartGoodsRequestVo
,
String
goodsId
)
{
public
static
CartGoods
convent2CartGoods
(
MCoffeeAddGoodsRequestVo
addShoppingCartGoodsRequestVo
,
String
goodsId
)
{
String
spuId
=
addShoppingCartGoodsRequestVo
.
getSpuId
();
String
skuId
=
addShoppingCartGoodsRequestVo
.
getSkuId
();
// String goodsId = StringUtils.isEmpty(skuId) ? spuId : skuId;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
d3791d11
...
...
@@ -61,10 +61,10 @@ public class CouponDiscountCalculation {
private
CouponClient
mCoffeeCouponClient
;
@Autowired
private
CouponAdapter
couponAdapter
;
@Autowired
private
RedisCache
redisCache
;
@Autowired
private
CardBinClient
cardBinClient
;
//
@Autowired
//
private RedisCache redisCache;
//
@Autowired
//
private CardBinClient cardBinClient;
@Value
(
"${coupon.app.id}"
)
private
String
appid
;
...
...
@@ -136,24 +136,24 @@ public class CouponDiscountCalculation {
}
}
public
void
getCoupon
(
CouponPromotionVO
couponPromotionVO
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
List
<
CartGoods
>
cartGoodsList
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
){
// 用户选择了查询优惠券信息
if
(
couponPromotionVO
!=
null
&&
ObjectUtils
.
equals
(
CouponFlag
.
YES
.
getCode
(),
couponPromotionVO
.
getFlg
()))
{
// 构建可用不可用优惠券
ActivityClassifyCouponBean
activityClassifyCouponBean
=
availableCoupon
(
couponPromotionVO
.
getPartnerId
()
,
couponPromotionVO
.
getUserId
(),
couponPromotionVO
.
getStoreId
(),
couponPromotionVO
.
getCouponCode
(),
couponPromotionVO
.
getOrderType
(),
cartGoodsList
);
if
(
Objects
.
equals
(
activityClassifyCouponBean
,
null
))
{
// 构建一个空得订单券信息
activityClassifyCouponBean
=
new
ActivityClassifyCouponBean
();
activityClassifyCouponBean
.
setCouponNum
(
0
);
activityClassifyCouponBean
.
setDisableCouponNum
(
0
);
activityClassifyCouponBean
.
setUsableCouponNum
(
0
);
activityClassifyCouponBean
.
setDisableCoupons
(
Lists
.
newArrayList
());
activityClassifyCouponBean
.
setUsableCoupons
(
Lists
.
newArrayList
());
}
shoppingCartGoodsResponseVo
.
setAvailableCoupon
(
activityClassifyCouponBean
);
}
}
//
public void getCoupon(CouponPromotionVO couponPromotionVO, ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo){
//
// 用户选择了查询优惠券信息
//
if (couponPromotionVO != null && ObjectUtils.equals(CouponFlag.YES.getCode(), couponPromotionVO.getFlg())) {
//
// 构建可用不可用优惠券
//
ActivityClassifyCouponBean activityClassifyCouponBean = availableCoupon(couponPromotionVO.getPartnerId()
//
, couponPromotionVO.getUserId(), couponPromotionVO.getStoreId(), couponPromotionVO.getCouponCode(), couponPromotionVO.getOrderType(),cartGoodsList);
//
if (Objects.equals(activityClassifyCouponBean, null)) {
//
// 构建一个空得订单券信息
//
activityClassifyCouponBean = new ActivityClassifyCouponBean();
//
activityClassifyCouponBean.setCouponNum(0);
//
activityClassifyCouponBean.setDisableCouponNum(0);
//
activityClassifyCouponBean.setUsableCouponNum(0);
//
activityClassifyCouponBean.setDisableCoupons(Lists.newArrayList());
//
activityClassifyCouponBean.setUsableCoupons(Lists.newArrayList());
//
}
//
shoppingCartGoodsResponseVo.setAvailableCoupon(activityClassifyCouponBean);
//
}
//
}
...
...
@@ -161,7 +161,7 @@ public class CouponDiscountCalculation {
/**
* 可选优惠券
*/
public
ActivityClassifyCouponBean
availableCoupon
(
String
partnerId
,
String
storeId
,
String
userId
public
ActivityClassifyCouponBean
availableCoupon
(
String
partnerId
,
String
storeId
,
String
userId
,
String
thirdPartyMemberId
,
String
unionId
,
String
appId
,
String
couponCode
,
Integer
orderType
,
List
<
CartGoods
>
cartGoods
)
{
List
<
CartGoods
>
tmpCartGoods
=
cartGoods
.
parallelStream
().
filter
(
k
->
k
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
)).
collect
(
Collectors
.
toList
());
...
...
@@ -170,6 +170,11 @@ public class CouponDiscountCalculation {
// 获取会员服务的优惠券列表
GetMemberCouponListRequestDto
getMemberCouponListRequestDto
=
new
GetMemberCouponListRequestDto
(
partnerId
,
userId
);
getMemberCouponListRequestDto
.
setStatusFlags
(
Arrays
.
asList
(
CouponStatus
.
STATUS_0
.
getCode
()));
getMemberCouponListRequestDto
.
setAppId
(
appId
);
getMemberCouponListRequestDto
.
setThirdPartyMemberId
(
thirdPartyMemberId
);
getMemberCouponListRequestDto
.
setUnionId
(
unionId
);
//麦咖啡固定值
getMemberCouponListRequestDto
.
setTag
(
"mccafe"
);
getMemberCouponListRequestDto
.
setPageNum
(
1
);
getMemberCouponListRequestDto
.
setPageSize
(
Integer
.
MAX_VALUE
);
GetMemberCouponListResponseDto
.
Result
result
=
getMemberCouponList
(
getMemberCouponListRequestDto
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/TimeSaleCalculation.java
View file @
d3791d11
...
...
@@ -70,6 +70,7 @@ public class TimeSaleCalculation {
if
(
discounts
.
contains
(
ActivityTypeEnum
.
TYPE_2
.
getCode
())
||
discounts
.
contains
(
ActivityTypeEnum
.
TYPE_21
.
getCode
())){
cartGoods
.
setActivityType
(
ActivityTypeEnum
.
TYPE_2
.
getCode
());
}
cartGoods
.
setActivityNumber
(
goodsDiscount
.
getActualGoodsNumber
());
// 享受限时特价折扣的商品数量
Integer
specialActualGoodsNumber
=
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