Commit cbe92ed6 by ping.wu

活动互斥提示

parent ec9b3af4
......@@ -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()) &&
......
......@@ -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);
}
deliveryAmount = getNewDeliveryAmount(receiveId, partnerId, storeId, orderType);
return deliveryAmount;
}
......
......@@ -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;
}
......@@ -18,4 +18,7 @@ public class CouponResults {
private String activityName;
//是否与促销活动共享 0不同享 1同享
private Integer promotionSharing;
}
......@@ -70,4 +70,7 @@ public class Discount {
*/
private Integer priority;
//是否与促销活动共享 0不同享 1同享
private Integer promotionSharing;
}
package cn.freemud.entities.dto.calculate;
import lombok.Data;
@Data
public class ExclusiveActivity {
private Integer type;
private String name;
}
package cn.freemud.entities.dto.shoppingCart;
import lombok.Data;
@Data
public class ActivityMutexConfig {
//活动互斥 1=开启 0=关闭
private String activityMutex;
//优惠券与活动互斥 1=开启 0=关闭
private String couponactivityMutex;
}
......@@ -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;
}
}
......@@ -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);
}
......
......@@ -163,7 +163,7 @@ public class CalculationServiceImpl {
// fix npe 麦咖啡加车没有orderType,这里判断一下orderType
discountRequest.setProductChannel((null != orderType && orderType == 1) ? "saasdelivery" : "saas");
// try {
ActivityCalculationDiscountResponseDto activityCalculationDiscountResponseDto = activityClient.calculationDiscountSharing(discountRequest);
ActivityCalculationDiscountResponseDto activityCalculationDiscountResponseDto = activityClient.MCoffeeCalculationDiscountSharing(discountRequest);
// } catch (Exception ex) {
// throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN);
// }
......
......@@ -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 calculationDiscountSharing(ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto);
ActivityCalculationDiscountResponseDto MCoffeeCalculationDiscountSharing(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")
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment