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
55ccf4da
Commit
55ccf4da
authored
May 25, 2022
by
周晓航
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'KA-储值卡增加营销规则同享配置ID1046436-zxh-20220505' into pre
parents
86dbe377
41dc72f6
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
357 additions
and
51 deletions
+357
-51
order-application-service/src/main/java/cn/freemud/entities/dto/pay/svc/BatchSvcInfoRequest.java
+36
-0
order-application-service/src/main/java/cn/freemud/entities/dto/pay/svc/CardApplyRes.java
+138
-0
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
+3
-0
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+5
-0
order-application-service/src/main/java/cn/freemud/entities/vo/order/CreateOrderPremiumExchangeActivityVo.java
+5
-0
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+50
-1
order-application-service/src/main/java/cn/freemud/service/impl/SellCouponOrderServiceImpl.java
+2
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/SvcAppClient.java
+12
-1
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/CreateOrderRequest.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/activity/DiscountSharingDto.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/ActivityCalculationDiscountRequestDto.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/PremiumExchangeRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
+4
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
+3
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
+11
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
+10
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
+4
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+35
-20
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
+7
-8
No files found.
order-application-service/src/main/java/cn/freemud/entities/dto/pay/svc/BatchSvcInfoRequest.java
0 → 100644
View file @
55ccf4da
package
cn
.
freemud
.
entities
.
dto
.
pay
.
svc
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/5/10 17:52
* @description :
*/
@Data
public
class
BatchSvcInfoRequest
{
/**
* 卡档案id
*/
private
Integer
applyId
;
/**
* 商户编号
*/
private
String
partnerId
;
/**
* 接口版本
*/
private
String
ver
;
/**
* 门店id(需要校验的门店)
*/
private
String
storeId
;
/**
* 需要校验的组织渠道Id集合
*/
private
List
<
String
>
orgIds
;
}
order-application-service/src/main/java/cn/freemud/entities/dto/pay/svc/CardApplyRes.java
0 → 100644
View file @
55ccf4da
package
cn
.
freemud
.
entities
.
dto
.
pay
.
svc
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/5/10 18:00
* @description :
*/
@Data
public
class
CardApplyRes
{
@ApiModelProperty
(
"卡档案Id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"卡档案名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"卡面信息,卡面配图链接"
)
private
String
mark
;
@ApiModelProperty
(
value
=
"规则说明"
)
private
String
ruleRemark
;
@ApiModelProperty
(
value
=
"卡档案编号"
)
private
String
thirdNo
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createUser
;
@ApiModelProperty
(
value
=
"最后操作人"
)
private
String
updateUser
;
@ApiModelProperty
(
value
=
"创建时间str"
)
private
String
createDate
;
@ApiModelProperty
(
value
=
"最后更新时间Str"
)
private
String
updateDate
;
@ApiModelProperty
(
value
=
"在售状态,默认上线,1上架,0下架"
)
private
Integer
onShelf
;
@ApiModelProperty
(
value
=
"启充状态,默认启用,1-启用,0-停用"
)
private
Integer
enableRecharge
;
@ApiModelProperty
(
value
=
"推荐状态, 默认未设置,1-推荐,0-未设置"
)
private
Integer
enablePromote
;
// /**
// * 门店列表
// */
// @ApiModelProperty("门店列表")
// private List<CardApplyStoreVo> stores;
//
// /**
// * 渠道分组列表
// */
// @ApiModelProperty("渠道分组列表")
// private List<CardApplyOrgVo> orgs;
//
// /**
// * 渠道分组列表
// */
// @ApiModelProperty("推荐地区列表")
// private List<CardApplyRegionRecommendVo> regions;
@ApiModelProperty
(
value
=
"适用门店:1-部分门店 2-渠道分组 3-全部门店"
)
private
Byte
whiteChoiceMode
;
@ApiModelProperty
(
value
=
"不适用门店:1-部分门店 2-渠道分组 3-无"
)
private
Byte
blackChoiceMode
;
@ApiModelProperty
(
value
=
"推荐模式:1-全部 2-部分渠道"
)
private
Byte
recommendMode
;
@ApiModelProperty
(
value
=
"不推荐模式:1-全部 2-部分渠道"
)
private
Byte
notRecommendMode
;
@ApiModelProperty
(
value
=
"适用范围,全门店通用或仅限上海地区门店使用等"
)
private
String
applyScope
;
@ApiModelProperty
(
value
=
"0:线上卡档案, 1:线下卡档案"
)
private
Integer
cardApplyType
;
@ApiModelProperty
(
value
=
"储值卡活动标签图片地址"
)
private
String
promotionLabelImg
;
@ApiModelProperty
(
value
=
"储值卡活动标签宣传语"
)
private
String
promotionLabelDesc
;
/**
*/
@ApiModelProperty
(
"是否开启线下充值(设为仅线下充值后,用户只能到门店充值,在小程序无法充值) 1-是 0-否,默认为0"
)
private
Byte
enableOfflineRecharge
;
@ApiModelProperty
(
"有效期"
)
private
Integer
effectDuration
;
/**
* 复用card表中的cardType字段
*/
@ApiModelProperty
(
"卡类型:0礼品卡,3储值卡"
)
private
Integer
applyType
;
@ApiModelProperty
(
"有效期类型 0|永久有效 1|固定时长 2|固定日期"
)
private
Integer
effectType
;
@ApiModelProperty
(
"固定时长有效期时间单位 6|年 5|月 4|日 3|时 2|分 1|秒"
)
private
Integer
timeUnit
;
@ApiModelProperty
(
value
=
"同步到哪个三方:1:银商,null默认不同步"
)
private
Integer
syncThirdParty
;
@ApiModelProperty
(
"渠道和门店黑白名单校验,true通过,false未通过"
)
private
Boolean
whiteBlackVerify
;
@ApiModelProperty
(
value
=
"是否设置获取成长值 1-是 0-否"
)
private
Integer
enableGrowth
;
@ApiModelProperty
(
value
=
"是否设置获取积分配置 1-是 0-否"
)
private
Integer
enableScore
;
@ApiModelProperty
(
value
=
"卡档案子类型 1:普通, 2:抖音"
)
private
Integer
cardApplySubType
;
@ApiModelProperty
(
value
=
"是否开启转赠 1-开启 0-关闭"
)
private
Integer
enableTransfer
;
@ApiModelProperty
(
value
=
"单人当天冲值次数限制"
)
private
Integer
dayChargeTimes
;
@ApiModelProperty
(
value
=
"单人最大冲值次数限制"
)
private
Integer
maxChargeTimes
;
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
;
}
order-application-service/src/main/java/cn/freemud/entities/vo/CreateOrderVo.java
View file @
55ccf4da
...
...
@@ -325,4 +325,7 @@ public class CreateOrderVo {
*/
private
String
contactsName
;
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
}
order-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
55ccf4da
...
...
@@ -12,6 +12,7 @@
*/
package
cn
.
freemud
.
entities
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -26,6 +27,10 @@ import java.util.List;
@Data
@Builder
public
class
ShoppingCartInfoRequestVo
{
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
/**
* 链路号
*/
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/order/CreateOrderPremiumExchangeActivityVo.java
View file @
55ccf4da
package
cn
.
freemud
.
entities
.
vo
.
order
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.Valid
;
...
...
@@ -13,6 +14,10 @@ public class CreateOrderPremiumExchangeActivityVo {
private
String
activityCode
;
@NotNull
(
message
=
"activityName 不能为空"
)
private
String
activityName
;
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
/**
* 加价购sku商品信息
*/
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
55ccf4da
...
...
@@ -26,6 +26,8 @@ import cn.freemud.entities.dto.order.UnifiedPayResponseDto;
import
cn.freemud.entities.dto.pay.PayOrderDto
;
import
cn.freemud.entities.dto.pay.PayProductDto
;
import
cn.freemud.entities.dto.pay.UnifiedOrderRequestDto
;
import
cn.freemud.entities.dto.pay.svc.BatchSvcInfoRequest
;
import
cn.freemud.entities.dto.pay.svc.CardApplyRes
;
import
cn.freemud.entities.dto.shoppingCart.GetShoppingCartGoodsApportionDto
;
import
cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
;
import
cn.freemud.entities.dto.store.*
;
...
...
@@ -41,6 +43,7 @@ import cn.freemud.service.adapter.OrderCheckAdapter;
import
cn.freemud.service.thirdparty.CustomerPropertyClient
;
import
cn.freemud.service.thirdparty.ShoppingCartClient
;
import
cn.freemud.service.thirdparty.StoreBaseApiClient
;
import
cn.freemud.service.thirdparty.SvcAppClient
;
import
cn.freemud.utils.AppLogUtil
;
import
cn.freemud.utils.DateUtils
;
import
cn.freemud.utils.ResponseUtil
;
...
...
@@ -116,6 +119,9 @@ public class CheckOrder {
@Autowired
private
StoreBaseApiClient
storeBaseApiClient
;
@Autowired
private
SvcAppClient
svcAppClient
;
// 【华莱士】【订单C端记录不分账的卡面编号】不让走分账,卡面编号--11840,11845,11846,11853,11854,11855,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11906
@Value
(
"${card.pay.unDistribution.applyId:}"
)
private
List
<
Integer
>
unDistributions
;
...
...
@@ -197,11 +203,51 @@ public class CheckOrder {
// createOrderVo.setUnDistribution(1);
// }
// }
// 获取储值卡是否配置了优惠同享等
createOrderVo
.
setEnableSharing
(
this
.
commonCheckSVCEnableSharing
(
memberCardCode
,
cardCodes
,
createOrderVo
.
getPartnerId
()));
createOrderVo
.
setUserId
(
userLoginInfoDto
.
getMemberId
());
return
userLoginInfoDto
;
}
public
void
checkMemberSvcCard
(
String
partnerId
,
String
memberId
,
SellCouponCreateOrderVo
requestVo
)
{
/**
*
* @param memberCardCode
* @param cardCodes
* @param partnerId
* @return 是否与营销活动共享 1-是 0-否
*/
public
Integer
commonCheckSVCEnableSharing
(
List
<
GetSvcInfoByMemberIdResponseVo
>
memberCardCode
,
Set
<
String
>
cardCodes
,
String
partnerId
){
Integer
enableSharing
=
1
;
if
(
CollectionUtils
.
isNotEmpty
(
memberCardCode
)
&&
CollectionUtils
.
isNotEmpty
(
cardCodes
))
{
List
<
BatchSvcInfoRequest
>
requestList
=
new
ArrayList
<>();
memberCardCode
.
stream
().
filter
(
c
->
cardCodes
.
contains
(
c
.
getCardCode
())).
forEach
(
cardInfo
->
{
BatchSvcInfoRequest
request
=
new
BatchSvcInfoRequest
();
request
.
setApplyId
(
cardInfo
.
getApplyId
());
request
.
setPartnerId
(
partnerId
);
request
.
setVer
(
"1"
);
requestList
.
add
(
request
);
});
cn
.
freemud
.
base
.
entity
.
BaseResponse
<
List
<
CardApplyRes
>>
response
=
svcAppClient
.
multiInfo
(
requestList
);
if
(
response
!=
null
&&
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
response
.
getCode
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
response
.
getResult
()))
{
CardApplyRes
cardApplyRes1
=
response
.
getResult
().
stream
().
filter
(
cardApplyRes
->
cardApplyRes
.
getEnableSharing
().
compareTo
(
0
)
==
0
).
findFirst
().
orElse
(
null
);
if
(
Objects
.
nonNull
(
cardApplyRes1
))
{
enableSharing
=
cardApplyRes1
.
getEnableSharing
();
}
}
}
}
return
enableSharing
;
}
/**
*
* @param partnerId
* @param memberId
* @param requestVo
* @return 是否与营销活动共享 1-是 0-否
*/
public
Integer
checkMemberSvcCard
(
String
partnerId
,
String
memberId
,
SellCouponCreateOrderVo
requestVo
)
{
if
(
StringUtils
.
isNotBlank
(
requestVo
.
getCardCode
()))
{
//校验会员svc卡信息
List
<
GetSvcInfoByMemberIdResponseVo
>
memberCardCode
=
checkCardCode
(
partnerId
,
memberId
,
Sets
.
newHashSet
(
requestVo
.
getCardCode
()));
...
...
@@ -212,7 +258,9 @@ public class CheckOrder {
// requestVo.setUnDistribution(1);
// }
// }
return
this
.
commonCheckSVCEnableSharing
(
memberCardCode
,
Collections
.
singleton
(
requestVo
.
getCardCode
()),
partnerId
);
}
return
1
;
}
...
...
@@ -705,6 +753,7 @@ public class CheckOrder {
.
bizType
(
createOrderVo
.
getBizType
())
.
build
();
shoppingCartInfoRequestVo
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
shoppingCartInfoRequestVo
.
setEnableSharing
(
createOrderVo
.
getEnableSharing
());
// 如果使用优惠券或者商品券,校验 couponCode
// if (StringUtils.isNotBlank(createOrderVo.getCouponCode())) {
// // 校验couponCode
...
...
order-application-service/src/main/java/cn/freemud/service/impl/SellCouponOrderServiceImpl.java
View file @
55ccf4da
...
...
@@ -311,7 +311,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
// 查询用户信息
AssortmentCustomerInfoVo
userLoginInfoDto
=
checkOrder
.
checkOrderByMemberNew
(
requestVo
.
getSessionId
());
// 如果用户适用SVC 卡支付,则校验svc卡,
checkOrder
.
checkMemberSvcCard
(
userLoginInfoDto
.
getPartnerId
(),
userLoginInfoDto
.
getMemberId
(),
requestVo
);
Integer
enableSharing
=
checkOrder
.
checkMemberSvcCard
(
userLoginInfoDto
.
getPartnerId
(),
userLoginInfoDto
.
getMemberId
(),
requestVo
);
String
trackingNo
=
LogThreadLocal
.
getTrackingNo
();
String
partnerId
=
userLoginInfoDto
.
getPartnerId
();
String
storeId
=
requestVo
.
getShopId
();
...
...
@@ -376,6 +376,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
}
CreateOrderRequest
createOrderRequest
=
(
CreateOrderRequest
)
createOrderRequestResponse
.
getResult
();
createOrderRequest
.
setEnableSharing
(
enableSharing
);
//标准化平台虚拟商品特价活动计算,不包含蜜雪APP买虚拟商品
List
<
SubtractStockVO
>
stockBeanDtos
=
calculationDiscount
(
partnerId
,
storeId
,
userLoginInfoDto
.
getMemberId
(),
productInfosDto
.
getData
().
getProducts
().
get
(
0
),
createOrderRequest
);
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/SvcAppClient.java
View file @
55ccf4da
...
...
@@ -2,13 +2,18 @@ package cn.freemud.service.thirdparty;
import
com.freemud.application.sdk.api.ordercenter.annotation.LogIgnoreFeign
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.entities.dto.pay.svc.BatchSvcInfoRequest
;
import
cn.freemud.entities.dto.pay.svc.CardApplyRes
;
import
cn.freemud.entities.dto.pay.svc.SVCCardAmountRequestDto
;
import
cn.freemud.entities.dto.pay.svc.SVCCardAmountResponseDto
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"fm-svc-app"
,
url
=
"${saas.svc.app.feign.url:}"
)
import
java.util.List
;
@FeignClient
(
name
=
"fm-svc-app"
,
url
=
"${saas.svc.app.feign.url:}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
SvcAppClient
{
...
...
@@ -17,4 +22,10 @@ public interface SvcAppClient {
@LogIgnoreFeign
(
logMessage
=
"batchQueryCardAmount"
)
BaseResponse
<
SVCCardAmountResponseDto
>
batchQueryCardAmount
(
SVCCardAmountRequestDto
svcComPayRequestDto
);
//批量查询卡配置规则
@PostMapping
(
value
=
"/svc/cardapply/multi-info"
)
@LogIgnoreFeign
(
logMessage
=
"/svc/cardapply/multi-info"
)
BaseResponse
<
List
<
CardApplyRes
>>
multiInfo
(
@RequestBody
List
<
BatchSvcInfoRequest
>
requestList
);
}
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/create/CreateOrderRequest.java
View file @
55ccf4da
...
...
@@ -15,6 +15,7 @@ package com.freemud.application.sdk.api.ordercenter.request.create;
import
com.freemud.application.sdk.api.ordercenter.enums.OrderClientType
;
import
com.freemud.application.sdk.api.ordercenter.request.BaseRequest
;
import
com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -23,6 +24,12 @@ import java.util.List;
@Data
public
class
CreateOrderRequest
extends
BaseRequest
{
/**
* 该字段内部查询得出结果, 不可由前端传递
*/
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
;
//订单编号
private
String
orderCode
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/activity/DiscountSharingDto.java
View file @
55ccf4da
package
cn
.
freemud
.
entities
.
dto
.
activity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
...
...
@@ -18,4 +19,10 @@ import lombok.Data;
public
class
DiscountSharingDto
{
//当前请求是否自动勾选优惠券
private
Boolean
autoCoupon
;
/**
* 储值卡需求: 使用的储值卡是否与 促销活动同享
*/
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/ActivityCalculationDiscountRequestDto.java
View file @
55ccf4da
...
...
@@ -97,6 +97,9 @@ public class ActivityCalculationDiscountRequestDto {
//当前请求是否自动勾选优惠券
private
Boolean
autoCoupon
;
//指定参与的活动类型
private
List
<
Integer
>
activityTypes
;
@Data
public
static
class
CalculationDiscountCoupon
{
/**
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/PremiumExchangeRequestVo.java
View file @
55ccf4da
...
...
@@ -53,6 +53,13 @@ public class PremiumExchangeRequestVo {
private
Integer
bizType
;
/**
* 储值卡需求: 使用的储值卡是否与 促销活动同享
*/
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
/**
* 优惠券code列表
*/
private
List
<
couponCode
>
couponCodes
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
55ccf4da
...
...
@@ -12,6 +12,7 @@
*/
package
cn
.
freemud
.
entities
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -155,6 +156,12 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo {
*/
private
Integer
isOrderReq
=
0
;
/**
* 储值卡需求: 使用的储值卡是否与 促销活动同享
*/
@ApiModelProperty
(
value
=
"是否与营销活动共享 1-是 0-否"
)
private
Integer
enableSharing
=
1
;
@Data
public
final
static
class
SendGoods
{
/**
...
...
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
View file @
55ccf4da
...
...
@@ -30,6 +30,7 @@ public enum ActivityTypeEnum {
TYPE_23
(
23
,
"超值加购"
),
TYPE_27
(
27
,
"促销会员价"
),
TYPE_28
(
28
,
"积分商品活动"
),
TYPE_29
(
29
,
"商品活动"
),
/**
* 优惠券
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
View file @
55ccf4da
...
...
@@ -7,6 +7,7 @@ import cn.freemud.constant.ShoppingCartConstant;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryResponseDto
;
import
cn.freemud.entities.dto.activity.DiscountSharingDto
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountRequestDto
;
import
cn.freemud.entities.dto.calculate.CalculationDiscountResult
;
import
cn.freemud.entities.dto.calculate.Discount
;
...
...
@@ -336,15 +337,15 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
public
CalculationDiscountResult
getCalculationDiscountResult
(
String
menuType
,
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
String
wxappid
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
,
Long
deliveryAmount
,
long
nightDistributionFee
){
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
,
Long
deliveryAmount
,
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
){
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
null
;
//外卖场景下 查询门店配送信息
if
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
().
equals
(
menuType
)){
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
,
null
,
null
,
nightDistributionFee
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
,
null
,
null
,
nightDistributionFee
,
discountSharingDto
);
}
else
{
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
,
null
,
null
,
0L
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
,
null
,
null
,
0L
,
discountSharingDto
);
}
return
calculationDiscountResult
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
View file @
55ccf4da
...
...
@@ -10,6 +10,7 @@ import cn.freemud.entities.dto.GetMemberInfoResponseVo;
import
cn.freemud.entities.dto.GoodsBeanDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryResponseDto
;
import
cn.freemud.entities.dto.activity.DiscountSharingDto
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountRequestDto
;
import
cn.freemud.entities.dto.calculate.CalculationDiscountResult
;
import
cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
;
...
...
@@ -99,7 +100,8 @@ public interface ShoppingCartNewService {
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
);
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
);
List
<
CartGoods
>
updateCartGoodsLegal
(
CartGoods
cartGoods
,
String
userId
,
ShoppingCartGoodsBaseResponseVo
shoppingCartGoodsResponseVo
,
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
List
<
CartGoods
>
oldAllCartGoodsList
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
View file @
55ccf4da
...
...
@@ -8,6 +8,7 @@ import cn.freemud.constant.ResponseCodeConstant;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.DiscountSharingDto
;
import
cn.freemud.entities.dto.calculate.*
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountRequestDto
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
;
...
...
@@ -200,7 +201,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
currentUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
currentUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
new
DiscountSharingDto
()
);
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
currentUserId
,
appId
,
addShoppingCartGoodsRequestVo
.
getOrderType
());
...
...
@@ -392,7 +393,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
);
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
new
DiscountSharingDto
()
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
}
...
...
@@ -521,9 +522,10 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
}
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
);
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
null
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
null
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
discountSharingDto
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
...
...
@@ -737,7 +739,9 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
);
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()),
discountSharingDto
);
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
...
...
@@ -791,7 +795,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
}
@Override
public
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accoutFlag
,
long
nightDistributionFee
)
{
public
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accoutFlag
,
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
)
{
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
=
getActivityCalculationDiscountRequestDto
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
>
calculationDiscountGoodsList
=
new
ArrayList
<>();
// 校验后有效的商品券map
...
...
@@ -1265,7 +1269,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
);
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
crateUserId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
currentUserInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
new
DiscountSharingDto
()
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMallServiceImpl.java
View file @
55ccf4da
...
...
@@ -193,9 +193,9 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
Long
deliveryAmount
=
0L
;
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
addShoppingCartGoodsRequestVo
.
getOrderType
());
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
CalculationDiscountResult
discountResult
=
null
;
discountResult
=
sharingDiscountService
.
getCalculationSharingDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
<>(),
null
,
deliveryAmount
,
null
,
null
,
accountType
,
new
DiscountSharingDto
()
,
0L
);
discountResult
=
sharingDiscountService
.
getCalculationSharingDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
<>(),
null
,
deliveryAmount
,
null
,
null
,
accountType
,
discountSharingDto
,
0L
);
sharingCartService
.
distribute
(
discountResult
,
allCartGoodsList
,
shoppingCartGoodsResponseVo
,
null
,
null
,
null
,
activityQueryDto
,
menuType
,
deliveryAmount
,
ShoppingCartConstant
.
ADD_AND_UPDATE
,
partnerId
,
null
,
userId
,
storeId
,
0L
);
buildShoppingCartGoodsResponse
(
shoppingCartGoodsResponseVo
,
discountResult
,
null
,
partnerId
);
...
...
@@ -423,7 +423,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
Long
deliveryAmount
=
deliveryFeeInfo
.
getDeliveryAmount
();
shoppingCartGoodsResponseVo
.
setCostType
(
deliveryFeeInfo
.
getCostType
());
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
);
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
...
...
@@ -438,6 +438,8 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
sendGoods
.
add
(
sd
);
}
}
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
CalculationDiscountResult
calculationSharingDiscountResult
=
sharingDiscountService
.
getCalculationSharingDiscountResult
(
menuType
,
partnerId
,
storeId
...
...
@@ -449,7 +451,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
,
coupons
,
sendGoods
,
deliveryAmount
,
null
,
null
,
accountFlag
,
new
DiscountSharingDto
()
,
0L
);
,
null
,
null
,
accountFlag
,
discountSharingDto
,
0L
);
sharingCartService
.
distribute
(
calculationSharingDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
...
...
@@ -595,7 +597,8 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
new
ArrayList
<>();
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
buildCoupons
(
coupons
,
shoppingCartInfoRequestVo
.
getCouponCodes
());
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
CalculationDiscountResult
discountResult
=
sharingDiscountService
.
getCalculationSharingDiscountResult
(
menuType
,
partnerId
,
storeId
...
...
@@ -607,7 +610,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
,
coupons
,
shoppingCartInfoRequestVo
.
getSendGoods
()
,
deliveryAmount
,
shoppingCartInfoRequestVo
,
null
,
accountFlag
,
new
DiscountSharingDto
()
,
0L
);
,
shoppingCartInfoRequestVo
,
null
,
accountFlag
,
discountSharingDto
,
0L
);
// 活动校验
calculationSharingValidatorService
.
validator
(
discountResult
...
...
@@ -640,7 +643,7 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
@Override
public
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
)
{
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
)
{
return
null
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
View file @
55ccf4da
...
...
@@ -6,6 +6,7 @@ import cn.freemud.base.entity.BaseResponse;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.entities.dto.CouponProductDto
;
import
cn.freemud.entities.dto.activity.ActivityQueryDto
;
import
cn.freemud.entities.dto.activity.DiscountSharingDto
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountRequestDto
;
import
cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
;
import
cn.freemud.entities.dto.calculate.CalculationDiscountResult
;
...
...
@@ -434,7 +435,8 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
return
;
}
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
BusinessTypeEnum
.
SAAS_MALL
.
getCode
(),
0L
,
null
,
null
,
0L
);
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
BusinessTypeEnum
.
SAAS_MALL
.
getCode
(),
0L
,
null
,
null
,
0L
,
discountSharingDto
);
if
(
calculationDiscountResult
==
null
)
{
return
;
}
...
...
@@ -563,7 +565,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
@Override
public
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
)
{
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
,
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
)
{
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
=
getActivityCalculationDiscountRequestDto
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
>
calculationDiscountGoodsList
=
new
ArrayList
<>();
cartGoodsList
=
cartGoodsList
.
stream
().
filter
(
t
->
!
isWeightProduct
(
t
)).
collect
(
Collectors
.
toList
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
55ccf4da
...
...
@@ -392,7 +392,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//
}
else
{
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
allCartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
new
DiscountSharingDto
()
);
if
(
calculationDiscountResult
!=
null
&&
CollectionUtils
.
isNotEmpty
(
calculationDiscountResult
.
getSendGoods
())){
sendGoodsQtyCheck
(
productsCount
,
appId
,
partnerId
,
userId
,
storeId
,
tableNumber
,
oldCartGoodsList
,
shoppingCartBaseService
,
calculationDiscountResult
.
getSendGoods
(),
bizType
);
}
...
...
@@ -517,6 +517,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
updateShoppingCartGoodsQtyRequestVo
.
getOrderType
());
activityQueryDto
.
setBizType
(
bizType
);
// 根据商户门店判断是否走新促销
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
CalculationDiscountResult
discountResult
=
null
;
discountResult
=
sharingDiscountService
.
getCalculationSharingDiscountResult
(
menuType
...
...
@@ -530,7 +531,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
new
ArrayList
()
//券
,
null
//加价购商品
,
deliveryAmount
,
null
,
bizType
,
accountFlag
,
new
DiscountSharingDto
()
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
,
null
,
bizType
,
accountFlag
,
discountSharingDto
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
//校验加购数量
if
(
discountResult
!=
null
)
{
sendGoodsQtyCheckForUpdate
(
cartGoodsList
,
oldQty
,
appId
,
partnerId
,
userId
,
storeId
,
cartGoodsUid
,
""
,
shoppingCartBaseService
,
discountResult
.
getSendGoods
(),
bizType
);
...
...
@@ -556,7 +557,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
buildShoppingCartGoodsResponse
(
shoppingCartGoodsResponseVo
,
discountResult
,
null
,
partnerId
);
}
else
{
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
(),
new
ArrayList
<>(),
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
discountSharingDto
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
}
...
...
@@ -733,6 +734,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
CouponPromotionVO
couponPromotionVO
=
couponAdapter
.
getCouponPromotionVO
(
shoppingCartInfoRequestVo
,
userLoginInfoDto
);
// fisherman 作用: 调用可选优惠券 计算 配送券是否可用
couponPromotionVO
.
setDeliveryAmount
(
deliveryAmount
);
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
ArrayList
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
couponCode
))
{
...
...
@@ -768,7 +771,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
sendGoods
,
deliveryAmount
,
null
,
bizType
,
accountFlag
,
new
DiscountSharingDto
()
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
,
bizType
,
accountFlag
,
discountSharingDto
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
sharingCartService
.
distribute
(
calculationSharingDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
...
...
@@ -810,7 +813,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息 调用促销
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
null
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
bizType
,
accountFlag
,
nightDistributionFee
);
cartGoodsList
,
coupons
,
null
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
bizType
,
accountFlag
,
nightDistributionFee
,
discountSharingDto
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
}
...
...
@@ -1012,23 +1015,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
@Override
public
BaseResponse
getGoodsListCheck
(
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
)
{
List
<
String
>
cardCodes
=
new
ArrayLis
t
<>();
Set
<
String
>
cardCodesSet
=
new
HashSe
t
<>();
if
(
CollectionUtils
.
isNotEmpty
(
shoppingCartInfoRequestVo
.
getCardCodes
())){
cardCodes
.
addAll
(
shoppingCartInfoRequestVo
.
getCardCodes
());
cardCodes
Set
.
addAll
(
shoppingCartInfoRequestVo
.
getCardCodes
());
}
else
if
(
StringUtils
.
isNotBlank
(
shoppingCartInfoRequestVo
.
getCardCode
())){
cardCodes
.
add
(
shoppingCartInfoRequestVo
.
getCardCode
());
cardCodes
Set
.
add
(
shoppingCartInfoRequestVo
.
getCardCode
());
}
if
(
CollectionUtils
.
isEmpty
(
cardCodes
))
{
if
(
CollectionUtils
.
isEmpty
(
cardCodes
Set
))
{
return
ResponseUtil
.
error
(
ResponseResult
.
PARAMETER_MISSING
);
}
//打包带走外卖
if
(
CollectionUtils
.
isNotEmpty
(
cardCodes
)
&&
Objects
.
equals
(
shoppingCartInfoRequestVo
.
getOrderType
(),
2
)
if
(
CollectionUtils
.
isNotEmpty
(
cardCodes
Set
)
&&
Objects
.
equals
(
shoppingCartInfoRequestVo
.
getOrderType
(),
2
)
&&
StringUtils
.
isBlank
(
shoppingCartInfoRequestVo
.
getReceiveId
()))
{
return
ResponseUtil
.
error
(
ResponseResult
.
PARAMETER_MISSING
);
}
String
partnerId
=
shoppingCartInfoRequestVo
.
getPartnerId
();
String
storeId
=
shoppingCartInfoRequestVo
.
getShopId
();
List
<
String
>
cardCodes
=
cardCodesSet
.
stream
().
collect
(
toList
());
shoppingCartInfoRequestVo
.
setCardCodes
(
cardCodes
);
// 是否走重构
if
(
SDKCommonBaseContextWare
.
getBean
(
ShoppingCartNewServiceImpl
.
class
).
newShoppingCartGray
(
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
()))
{
Map
requestMap
=
mapperFacade
.
map
(
shoppingCartInfoRequestVo
,
Map
.
class
);
...
...
@@ -1208,6 +1213,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
CouponPromotionVO
couponPromotionVO
=
couponAdapter
.
getCouponPromotionVO
(
shoppingCartInfoRequestVo
,
userLoginInfoDto
);
Long
deliveryAmount
=
calculateDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
userLoginInfoDto
.
getWxAppid
(),
shoppingCartGoodsResponseVo
,
shoppingCartInfoRequestVo
.
getOrderType
());
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
shoppingCartInfoRequestVo
.
getEnableSharing
());
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
// 当couponCodes不为空时,需参与价格计算,同时排除单券入参
...
...
@@ -1230,7 +1237,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
coupons
,
shoppingCartInfoRequestVo
.
getSendGoods
()
,
deliveryAmount
,
shoppingCartInfoRequestVo
,
bizType
,
accountFlag
,
new
DiscountSharingDto
()
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
,
shoppingCartInfoRequestVo
,
bizType
,
accountFlag
,
discountSharingDto
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
// 活动校验
calculationSharingValidatorService
.
validator
(
discountResult
...
...
@@ -1277,7 +1284,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
userLoginInfoDto
.
getWxAppid
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getReceiveId
(),
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
discountSharingDto
);
//临时方案
packgeAdditional
(
shoppingCartInfoRequestVo
,
premiumExchangeActivity
);
// 促销活动的优惠金额计算
...
...
@@ -1567,8 +1574,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
Long
distributionFee
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
)
{
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
)
{
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
=
getActivityCalculationDiscountRequestDto
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountGoods
>
calculationDiscountGoodsList
=
new
ArrayList
<>();
...
...
@@ -1696,6 +1703,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
else
if
(
Objects
.
equals
(
orderType
,
CreateOrderType
.
TAKE_OUT
.
getCode
()))
{
activityCalculationDiscountRequestDto
.
setProductChannel
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
());
}
if
(
Objects
.
nonNull
(
discountSharingDto
))
{
if
(
Objects
.
nonNull
(
discountSharingDto
.
getEnableSharing
())
&&
discountSharingDto
.
getEnableSharing
().
compareTo
(
0
)
==
0
)
{
// 储值卡算计, 剔除互斥活动 只能参加活动类型为29
activityCalculationDiscountRequestDto
.
setActivityTypes
(
Collections
.
singletonList
(
ActivityTypeEnum
.
TYPE_29
.
getCode
()));
}
}
ActivityCalculationDiscountResponseDto
activityCalculationDiscountResponseDto
=
activityClient
.
calculationDiscount
(
activityCalculationDiscountRequestDto
);
// 返回成功
if
(
activityCalculationDiscountResponseDto
!=
null
&&
StringUtils
.
equals
(
activityCalculationDiscountResponseDto
.
getStatusCode
(),
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
))
{
...
...
@@ -2713,15 +2726,15 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private
CalculationDiscountResult
getCalculationDiscountResult
(
String
menuType
,
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
String
wxappid
,
Integer
orderType
,
boolean
isMember
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
,
Long
deliveryAmount
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
)
{
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
,
Long
deliveryAmount
,
Integer
bizType
,
Integer
accountFlag
,
long
nightDistributionFee
,
DiscountSharingDto
discountSharingDto
)
{
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
null
;
//外卖场景下 查询门店配送信息
if
(
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
().
equals
(
menuType
))
{
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
,
bizType
,
accountFlag
,
nightDistributionFee
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
,
bizType
,
accountFlag
,
nightDistributionFee
,
discountSharingDto
);
}
else
{
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
,
bizType
,
accountFlag
,
0L
);
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
,
bizType
,
accountFlag
,
0L
,
discountSharingDto
);
}
return
calculationDiscountResult
;
...
...
@@ -3129,6 +3142,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
PremiumExchangeResponseVo
premiumExchangeResponseVo
=
new
PremiumExchangeResponseVo
();
premiumExchangeResponseVo
.
setResultCode
(
ActivityResultCodeEnum
.
NON_PARTICIPATE
.
getCode
());
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
request
.
getSessionId
(),
null
,
shoppingCartBaseService
,
bizType
);
DiscountSharingDto
discountSharingDto
=
new
DiscountSharingDto
();
discountSharingDto
.
setEnableSharing
(
request
.
getEnableSharing
());
if
(
grayPush
(
partnerId
,
storeId
,
"2"
))
{
// 当couponCode不为空时,需参与价格计算
ArrayList
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
new
ArrayList
<>();
...
...
@@ -3161,7 +3176,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
,
coupons
//券
,
null
//加价购商品
,
0L
,
null
,
bizType
,
accountFlag
,
new
DiscountSharingDto
()
,
0L
);
,
null
,
bizType
,
accountFlag
,
discountSharingDto
,
0L
);
premiumExchangeResponseVo
=
activityAdapter
.
convert2PremiumExchangeSharing
(
discountResult
);
}
else
{
...
...
@@ -3186,7 +3201,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
assortmentCustomerInfoVo
.
getWxAppId
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
coupons
,
null
,
null
,
0L
,
bizType
,
accountFlag
,
0L
);
,
accountFlag
,
0L
,
discountSharingDto
);
premiumExchangeResponseVo
=
activityAdapter
.
convert2PremiumExchange
(
calculationDiscountResult
);
}
...
...
@@ -3359,7 +3374,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
else
{
// 获取优惠信息
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
assortmentCustomerInfoVo
.
getWxAppId
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
<>(),
null
,
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
()));
CalculationDiscountResult
calculationDiscountResult
=
getCalculationDiscountResult
(
menuType
,
partnerId
,
storeId
,
userId
,
appId
,
assortmentCustomerInfoVo
.
getWxAppId
(),
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
cartGoodsList
,
new
ArrayList
<>(),
null
,
null
,
deliveryAmount
,
bizType
,
accountFlag
,
this
.
getNightDistributionFee
(
shoppingCartGoodsResponseVo
.
getDeliveryAmountList
())
,
new
DiscountSharingDto
()
);
couponAvailableCartInfo
=
activityAdapter
.
convert2CouponAvailableCartInfo
(
partnerId
,
storeId
,
calculationDiscountResult
,
orgCodes
);
}
return
ResponseUtil
.
success
(
couponAvailableCartInfo
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingDiscountService.java
View file @
55ccf4da
...
...
@@ -8,10 +8,7 @@ import cn.freemud.entities.dto.calculate.*;
import
cn.freemud.entities.dto.shoppingCart.SendPoint
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ShoppingCartInfoRequestVo
;
import
cn.freemud.enums.ActivityChannelEnum
;
import
cn.freemud.enums.CreateOrderType
;
import
cn.freemud.enums.GoodsTypeEnum
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.*
;
import
cn.freemud.interceptor.BizServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.CommonService
;
...
...
@@ -31,10 +28,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
//import cn.freemud.service.thirdparty.CalculationClient;
...
...
@@ -237,6 +231,11 @@ public class CalculationSharingDiscountService {
activeService
.
buildChooseGoodsService
(
calculationSharingDiscountRequestDto
,
shoppingCartInfoRequestVo
==
null
?
null
:
shoppingCartInfoRequestVo
.
getChooseGoods
());
if
(
sharingDto
!=
null
){
calculationSharingDiscountRequestDto
.
setAutoCoupon
(
sharingDto
.
getAutoCoupon
());
if
(
Objects
.
nonNull
(
sharingDto
.
getEnableSharing
())
&&
sharingDto
.
getEnableSharing
().
compareTo
(
0
)
==
0
)
{
// 储值卡算计, 剔除互斥活动 只能参加活动类型为29
calculationSharingDiscountRequestDto
.
setActivityTypes
(
Collections
.
singletonList
(
ActivityTypeEnum
.
TYPE_29
.
getCode
()));
}
}
//算价
ActivityCalculationDiscountResponseDto
sharingDiscountResponseDto
=
activityClient
.
calculationSharingDiscount
(
calculationSharingDiscountRequestDto
);
...
...
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