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
cbe92ed6
Commit
cbe92ed6
authored
Dec 21, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动互斥提示
parent
ec9b3af4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
131 additions
and
51 deletions
+131
-51
order-application-service/src/main/java/cn/freemud/service/CheckOrderUniversal.java
+0
-7
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/DeliveryServiceImpl.java
+0
-7
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CalculationDiscountResult.java
+6
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CouponResults.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/Discount.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/ExclusiveActivity.java
+12
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ActivityMutexConfig.java
+15
-0
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
+11
-0
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
+3
-17
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+72
-14
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ActivityClient.java
+4
-3
shopping-cart-application-service/src/main/java/cn/freemud/utils/RedisUtil.java
+1
-0
shopping-cart-application-service/src/main/resources/application-local.properties
+0
-1
No files found.
order-application-service/src/main/java/cn/freemud/service/CheckOrderUniversal.java
View file @
cbe92ed6
...
...
@@ -103,9 +103,6 @@ public abstract class CheckOrderUniversal {
@Autowired
private
ItemServiceImpl
itemService
;
// 配送费逻辑是否使用旧的
@Value
(
"${store.delivery.use.old}"
)
private
boolean
storeDeliveryUseOld
;
@Value
(
"${coco.partnerId}"
)
private
String
cocoPartnerId
;
...
...
@@ -446,11 +443,7 @@ public abstract class CheckOrderUniversal {
}
//获取门店配送信息
StoreDeliveryInfoDto
storeDeliveryInfoDto
;
if
(
storeDeliveryUseOld
)
{
storeDeliveryInfoDto
=
getStoreDeliveryInfo
(
storeResponseDto
,
config
,
appId
);
}
else
{
storeDeliveryInfoDto
=
getNewStoreDeliveryInfo
(
storeResponseDto
,
config
,
appId
,
LogThreadLocal
.
getTrackingNo
());
}
//coco自配送提前45分钟,禁止下单
if
(
cocoPartnerId
.
equals
(
createOrderVo
.
getPartnerId
())
&&
CreateOrderType
.
TAKE_OUT
.
getCode
().
equals
(
createOrderVo
.
getOrderType
())
&&
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/DeliveryServiceImpl.java
View file @
cbe92ed6
...
...
@@ -49,9 +49,6 @@ public class DeliveryServiceImpl {
@Autowired
private
DeliveryFeiginClient
deliveryFeiginClient
;
// 配送费逻辑是否使用旧的
@Value
(
"${store.delivery.use.old:true}"
)
private
boolean
storeDeliveryUseOld
;
public
Long
calculateDeliveryAmount
(
String
receiveId
,
String
partnerId
,
String
storeId
,
Integer
orderType
,
ManagerServiceBO
managerServiceBO
)
{
Long
deliveryAmount
=
0L
;
...
...
@@ -60,11 +57,7 @@ public class DeliveryServiceImpl {
if
(
StringUtils
.
isBlank
(
receiveId
)
&&
!
Objects
.
equals
(
orderType
,
CreateOrderType
.
TAKE_OUT
.
getCode
()))
{
return
deliveryAmount
;
}
if
(
storeDeliveryUseOld
)
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
managerServiceBO
).
toString
());
}
else
{
deliveryAmount
=
getNewDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
orderType
);
}
return
deliveryAmount
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CalculationDiscountResult.java
View file @
cbe92ed6
...
...
@@ -96,7 +96,7 @@ public class CalculationDiscountResult {
*/
private
Long
payCardFee
;
/**
* 月享卡2.0优惠
*
麦咖啡,
月享卡2.0优惠
*/
private
MonthCardDiscount
monthlyEnjoyCardDiscount
;
...
...
@@ -108,4 +108,9 @@ public class CalculationDiscountResult {
//是否是v3版本算价
private
Boolean
v3Promotion
=
false
;
/**
* 被互斥掉的活动集合
*/
private
List
<
ExclusiveActivity
>
exclusiveActivityList
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/CouponResults.java
View file @
cbe92ed6
...
...
@@ -18,4 +18,7 @@ public class CouponResults {
private
String
activityName
;
//是否与促销活动共享 0不同享 1同享
private
Integer
promotionSharing
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/Discount.java
View file @
cbe92ed6
...
...
@@ -70,4 +70,7 @@ public class Discount {
*/
private
Integer
priority
;
//是否与促销活动共享 0不同享 1同享
private
Integer
promotionSharing
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/calculate/ExclusiveActivity.java
0 → 100644
View file @
cbe92ed6
package
cn
.
freemud
.
entities
.
dto
.
calculate
;
import
lombok.Data
;
@Data
public
class
ExclusiveActivity
{
private
Integer
type
;
private
String
name
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ActivityMutexConfig.java
0 → 100644
View file @
cbe92ed6
package
cn
.
freemud
.
entities
.
dto
.
shoppingCart
;
import
lombok.Data
;
@Data
public
class
ActivityMutexConfig
{
//活动互斥 1=开启 0=关闭
private
String
activityMutex
;
//优惠券与活动互斥 1=开启 0=关闭
private
String
couponactivityMutex
;
}
shopping-cart-application-service/src/main/java/cn/freemud/enums/ActivityTypeEnum.java
View file @
cbe92ed6
...
...
@@ -13,6 +13,7 @@ package cn.freemud.enums;
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public
enum
ActivityTypeEnum
{
TYPE_0
(
0
,
"其他"
),
TYPE_1
(
1
,
"整单满减"
),
TYPE_11
(
11
,
"每满减"
),
TYPE_12
(
12
,
"阶梯满减"
),
...
...
@@ -97,4 +98,14 @@ public enum ActivityTypeEnum {
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
static
ActivityTypeEnum
getByCode
(
Integer
code
)
{
for
(
ActivityTypeEnum
type
:
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
return
type
;
}
}
return
ActivityTypeEnum
.
TYPE_0
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/factory/AbstractShoppingCartImpl.java
View file @
cbe92ed6
...
...
@@ -102,9 +102,6 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
private
AssortmentSdkService
assortmentSdkService
;
@Autowired
private
AssortmentCustomerInfoManager
customerInfoManager
;
// 配送费逻辑是否使用旧的
@Value
(
"${store.delivery.use.old:true}"
)
private
boolean
storeDeliveryUseOld
;
/**
* 根据sessionId获取用户信息
...
...
@@ -211,12 +208,7 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
if
(
StringUtils
.
isBlank
(
receiveId
))
{
return
deliveryAmount
;
}
if
(
storeDeliveryUseOld
)
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
shoppingCartGoodsResponseVo
.
setDeliveryFeeZeroReason
(
0
);
}
else
{
deliveryAmount
=
getNewDeliveryAmount
(
receiveId
,
partnerId
,
storeId
,
shoppingCartGoodsResponseVo
);
}
return
deliveryAmount
;
}
...
...
@@ -338,16 +330,10 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
receiveId
,
Long
deliveryAmount
){
// 获取优惠信息
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
);
}
else
{
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
null
,
null
,
null
);
if
(!
BusinessTypeEnum
.
SAAS_DELIVERY
.
getCode
().
equals
(
menuType
)){
deliveryAmount
=
null
;
}
return
calculationDiscountResult
;
return
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
isMember
,
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
(),
deliveryAmount
,
null
,
null
);
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
cbe92ed6
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
View file @
cbe92ed6
...
...
@@ -163,7 +163,7 @@ public class CalculationServiceImpl {
// fix npe 麦咖啡加车没有orderType,这里判断一下orderType
discountRequest
.
setProductChannel
((
null
!=
orderType
&&
orderType
==
1
)
?
"saasdelivery"
:
"saas"
);
// try {
ActivityCalculationDiscountResponseDto
activityCalculationDiscountResponseDto
=
activityClient
.
c
alculationDiscountSharing
(
discountRequest
);
ActivityCalculationDiscountResponseDto
activityCalculationDiscountResponseDto
=
activityClient
.
MCoffeeC
alculationDiscountSharing
(
discountRequest
);
// } catch (Exception ex) {
// throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN);
// }
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/ActivityClient.java
View file @
cbe92ed6
...
...
@@ -60,20 +60,21 @@ public interface ActivityClient {
ActivityCalculationDiscountResponseDto
calculationDiscount
(
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
);
/**
*
新版优惠均摊计算
*
麦咖啡 优惠均摊计算接口(商户不合作,废弃)
* @param activityCalculationDiscountRequestDto
* @return
*/
@Deprecated
@PostMapping
(
"/calculation/discount/sharing"
)
@IgnoreFeignLogAnnotation
(
logMessage
=
"calculationDiscountSharing"
,
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MSG
)
ActivityCalculationDiscountResponseDto
c
alculationDiscountSharing
(
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
);
ActivityCalculationDiscountResponseDto
MCoffeeC
alculationDiscountSharing
(
ActivityCalculationDiscountRequestDto
activityCalculationDiscountRequestDto
);
/**
* 促销新的算价对接
*/
@PostMapping
(
"/promotioncenter/calculateservice/discount/sharing"
)
//
@IgnoreFeignLogAnnotation(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE,messageFieldName=ResponseCodeKeyConstant.MEG)
@IgnoreFeignLogAnnotation
(
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
,
messageFieldName
=
ResponseCodeKeyConstant
.
MEG
)
ActivityCalculationDiscountResponseDto
calculationSharingDiscount
(
ActivityCalculationDiscountRequestDto
shareDiscountRequestDto
);
@PostMapping
(
"/activity/getV3Promotion"
)
...
...
shopping-cart-application-service/src/main/java/cn/freemud/utils/RedisUtil.java
View file @
cbe92ed6
...
...
@@ -7,6 +7,7 @@ public class RedisUtil {
private
final
static
String
COUPON_APP_SECRET
=
"coupon:app_secret_"
;
public
static
String
limitCart
=
"kgd:open_store_cart_limit_"
;
public
static
String
packAmountConfig
=
"kgd:order_pack_config_"
;
public
static
String
activityMutexKey
=
"kgd:order_activity_mutex_"
;
public
static
String
getEnterShopKey
(
String
userId
)
{
return
ENTER_SHOP_KEY
+
userId
;
...
...
shopping-cart-application-service/src/main/resources/application-local.properties
View file @
cbe92ed6
...
...
@@ -272,7 +272,6 @@ order.download.baseUrl = http://shared-order-es-shared-order-service-env-dev.api
order.download.appName
=
orderCenter
order.download.connectTimeOut
=
10000
saas.order.invoice.report.partnerIds
=
2399
store.delivery.use.old
=
false
#rocketmq.producer.config
...
...
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