Commit da11faba by 周晓航

Merge branch 'KA-2.0.41-爱马哥预订单开发-zxh' into qa

# Conflicts:
#	assortment-ordercenter-sdk/pom.xml
#	order-application-service/pom.xml
#	order-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
#	order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
#	ordercenter-sdk/pom.xml
#	pom.xml
#	shopping-cart-application-service/pom.xml
parents 486a0260 4b8f15f6
...@@ -21,6 +21,7 @@ import com.freemud.application.sdk.api.promotioncenter.request.promotion.Activit ...@@ -21,6 +21,7 @@ import com.freemud.application.sdk.api.promotioncenter.request.promotion.Activit
import com.freemud.application.sdk.api.stockapi.domain.ProductStocksVO; import com.freemud.application.sdk.api.stockapi.domain.ProductStocksVO;
import com.freemud.application.sdk.api.stockapi.request.UpdateStocksRequest; import com.freemud.application.sdk.api.stockapi.request.UpdateStocksRequest;
import com.freemud.application.sdk.api.util.DateUtil; import com.freemud.application.sdk.api.util.DateUtil;
import com.freemud.sdk.api.assortment.order.constant.CommonConstant;
import com.freemud.sdk.api.assortment.order.domain.OrderStatesVO; import com.freemud.sdk.api.assortment.order.domain.OrderStatesVO;
import com.freemud.sdk.api.assortment.order.domain.ResponseCodeConstant; import com.freemud.sdk.api.assortment.order.domain.ResponseCodeConstant;
import com.freemud.sdk.api.assortment.order.entities.OrderEditInfo; import com.freemud.sdk.api.assortment.order.entities.OrderEditInfo;
...@@ -217,8 +218,15 @@ public class OrderSdkAdapter { ...@@ -217,8 +218,15 @@ public class OrderSdkAdapter {
} else { } else {
request.setOrderClient(StringUtils.isEmpty(requestVO.getSource()) ? OrderClientType.SAAS.getIndex() : getNewOrderClient(requestVO.getSource())); request.setOrderClient(StringUtils.isEmpty(requestVO.getSource()) ? OrderClientType.SAAS.getIndex() : getNewOrderClient(requestVO.getSource()));
} }
//订单业务类型 1:普通订单 2:虚拟订单 // fisherman->预定单场景 bizType = 7 other:普通订单
request.setBizType(1); Integer bizType = requestVO.getBizType();
// 双重判断,防止前端乱传参搞事情
if (Objects.nonNull(bizType) && BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(bizType) == 0) {
request.setBizType(BizTypeEnum.ADVANCE_ORDER.getBizType());
} else {
// 20210730之前 默认设置为1
request.setBizType(CommonConstant.INTEGER_ONE);
}
request.setNote(requestVO.getRemark()); request.setNote(requestVO.getRemark());
request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect())); request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect()));
request.setBarCounter(requestVO.getBarCounter()); request.setBarCounter(requestVO.getBarCounter());
...@@ -1332,9 +1340,25 @@ public class OrderSdkAdapter { ...@@ -1332,9 +1340,25 @@ public class OrderSdkAdapter {
// 买一赠一寄件信息 // 买一赠一寄件信息
data.setOrderSendCouponRespList(orderInfoReqs.getOrderSendCouponRespList()); data.setOrderSendCouponRespList(orderInfoReqs.getOrderSendCouponRespList());
// 设置 额外拓展字段信息
OrderExtended orderExtended = this.getOrderExtendedObj(orderInfoReqs.getOrderExtended());
data.setOrderExtended(orderExtended);
return data; return data;
} }
private OrderExtended getOrderExtendedObj(OrderExtendedReq orderExtended){
if (Objects.isNull(orderExtended)) {
return null;
}
return OrderExtended.builder().orderClientGroup(orderExtended.getOrderClientGroup())
.orderClientGroupCode(orderExtended.getOrderClientGroupCode())
.storeNameEn(orderExtended.getStoreNameEn())
.spellGroupCode(orderExtended.getSpellGroupCode())
.userPhone(orderExtended.getUserPhone())
.sendWord(orderExtended.getSendWord())
.build();
}
/** /**
* 混合支付转换 * 混合支付转换
* *
...@@ -1374,6 +1398,7 @@ public class OrderSdkAdapter { ...@@ -1374,6 +1398,7 @@ public class OrderSdkAdapter {
dataBean.setCount(queryOrderForUserResp.getTotal()); dataBean.setCount(queryOrderForUserResp.getTotal());
List<QueryOrdersResponse.DataBean.OrderBean> orders = new ArrayList<>(); List<QueryOrdersResponse.DataBean.OrderBean> orders = new ArrayList<>();
for (OrderInfoReqs orderInfoReqs : queryOrderForUserResp.getItemList()) { for (OrderInfoReqs orderInfoReqs : queryOrderForUserResp.getItemList()) {
// fisherman 需要开放 private OrderExtendedReq orderExtended 用于订单页面数据展示
QueryOrdersResponse.DataBean.OrderBean data = convent2NEWOrderInfo(orderInfoReqs); QueryOrdersResponse.DataBean.OrderBean data = convent2NEWOrderInfo(orderInfoReqs);
orders.add(data); orders.add(data);
} }
......
...@@ -16,4 +16,6 @@ public class CommonConstant { ...@@ -16,4 +16,6 @@ public class CommonConstant {
* 4:星期四 * 4:星期四
*/ */
public static List<Integer> weekDay = Arrays.asList(2, 4); public static List<Integer> weekDay = Arrays.asList(2, 4);
public static Integer INTEGER_ONE = 1;
} }
...@@ -12,6 +12,11 @@ import java.util.List; ...@@ -12,6 +12,11 @@ import java.util.List;
@Data @Data
public class BaseCreateOrderRequest extends BaseConfig { public class BaseCreateOrderRequest extends BaseConfig {
/**
* 爱马哥蛋糕预定
* 预定单需求, bizType= 7 其他的场景默认传递null
*/
private Integer bizType;
/** /**
* 商户ID 必填 * 商户ID 必填
......
package com.freemud.sdk.api.assortment.order.response.order;
import lombok.Builder;
import lombok.Data;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2021/8/2 下午2:26
* @description : OrderBean 反馈 拓展字段信息
*
*/
@Data
@Builder
public class OrderExtended {
/**
* 渠道分组
*/
private String orderClientGroup;
/**
* 渠道分组编号
*/
private String orderClientGroupCode;
/**
* 订单门店英文名称
*/
private String storeNameEn;
/**
* 团号
*/
private String spellGroupCode;
/**
* 预定单的 您的电话
*/
private String userPhone;
/**
* 预定单 蛋糕寄语(额外祝福语)
*/
private String sendWord;
}
...@@ -14,8 +14,6 @@ package com.freemud.sdk.api.assortment.order.response.order; ...@@ -14,8 +14,6 @@ package com.freemud.sdk.api.assortment.order.response.order;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.*; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.*;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderCostResp; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderCostResp;
import io.swagger.annotations.ApiModelProperty;
import com.rabbitmq.tools.json.JSONUtil;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringBuilder;
...@@ -446,6 +444,8 @@ public class QueryOrdersResponse { ...@@ -446,6 +444,8 @@ public class QueryOrdersResponse {
*/ */
private String spellGroupActivityCode; private String spellGroupActivityCode;
private OrderExtended orderExtended;
@NoArgsConstructor @NoArgsConstructor
@Data @Data
public static class AddDeliveryInfo { public static class AddDeliveryInfo {
......
...@@ -137,7 +137,6 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService { ...@@ -137,7 +137,6 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
@Override @Override
public CreateOrderResponse createOrderFlow(CreateOrderRequest config) { public CreateOrderResponse createOrderFlow(CreateOrderRequest config) {
com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest request = orderSdkAdapter.convent2NEWCreateOrderRequest(config.getBaseCreateOrderRequest()); com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest request = orderSdkAdapter.convent2NEWCreateOrderRequest(config.getBaseCreateOrderRequest());
// AssortOrderLogUtil.info("fisherman 请求基础服务,最终构建 04",config!=null?JSON.toJSONString(config):null);
com.freemud.application.sdk.api.ordercenter.response.BaseResponse<OrderInfoReqs> order = orderSdkService.createOrder(request, config.getTrackingNo()); com.freemud.application.sdk.api.ordercenter.response.BaseResponse<OrderInfoReqs> order = orderSdkService.createOrder(request, config.getTrackingNo());
CreateOrderResponse createOrderResponse = orderSdkAdapter.convent2NEWOrderInfoReqs(order); CreateOrderResponse createOrderResponse = orderSdkAdapter.convent2NEWOrderInfoReqs(order);
if (!RESPONSE_SUCCESS.equals(createOrderResponse.getErrcode()) if (!RESPONSE_SUCCESS.equals(createOrderResponse.getErrcode())
......
...@@ -19,6 +19,10 @@ public class RedisKeyConstant { ...@@ -19,6 +19,10 @@ public class RedisKeyConstant {
*/ */
public final static String SAAS_SHOPPINGCART_KEY_PREFIX = "saas:user:info:cart:goods:"; public final static String SAAS_SHOPPINGCART_KEY_PREFIX = "saas:user:info:cart:goods:";
/** /**
* 用户购物车在redis的key前缀 爱马哥蛋糕预定
*/
public final static String SAAS_SHOPPINGCART_AIMAGE_KEY_PREFIX = "saas:user:info:advance:cart:goods:";
/**
* 用户购物车在redis的key前缀 * 用户购物车在redis的key前缀
*/ */
public final static String SAAS_SHOPPINGCART_SENDGOODS_KEY_PREFIX = "saas:user:info:cart:sendgoods:"; public final static String SAAS_SHOPPINGCART_SENDGOODS_KEY_PREFIX = "saas:user:info:cart:sendgoods:";
......
...@@ -43,4 +43,9 @@ public class CartParamDto { ...@@ -43,4 +43,9 @@ public class CartParamDto {
private Integer couponType; private Integer couponType;
private int buyType; private int buyType;
/**
* 业务类型 7-预定单 爱马哥蛋糕预定场景使用(2.0.41迭代 1032929)
*/
private Integer bizType;
} }
package cn.freemud.enums; package com.freemud.sdk.api.assortment.shoppingcart.enums;
/** /**
...@@ -19,6 +19,11 @@ public enum BizTypeEnum { ...@@ -19,6 +19,11 @@ public enum BizTypeEnum {
MEMBERS(3, "会员订单"), MEMBERS(3, "会员订单"),
INTEGRAL_MALL(4, "积分商城订单"), INTEGRAL_MALL(4, "积分商城订单"),
SVC(5, "储值卡订单"), SVC(5, "储值卡订单"),
SALE_COUPON(6, "卖券订单"),
/**
* 增对 爱马哥的蛋糕预定出的需求,
*/
ADVANCE_ORDER(7, "预订单"),
LGS_SELF_HELP_PARKING(97, "农工商停车自助积分订单"), LGS_SELF_HELP_PARKING(97, "农工商停车自助积分订单"),
LGS_MANUAL_RECORD_PARKING(98, "农工商停车手工录单"), LGS_MANUAL_RECORD_PARKING(98, "农工商停车手工录单"),
LGS_PARKING(99, "农工商停车订单"); LGS_PARKING(99, "农工商停车订单");
...@@ -32,8 +37,8 @@ public enum BizTypeEnum { ...@@ -32,8 +37,8 @@ public enum BizTypeEnum {
this.desc = desc; this.desc = desc;
} }
public static cn.freemud.enums.BizTypeEnum getByCode(Integer code) { public static BizTypeEnum getByCode(Integer code) {
for (cn.freemud.enums.BizTypeEnum bizTypeEnum : values()) { for (BizTypeEnum bizTypeEnum : values()) {
if (bizTypeEnum.getBizType().equals(code)) { if (bizTypeEnum.getBizType().equals(code)) {
return bizTypeEnum; return bizTypeEnum;
} }
......
...@@ -3,41 +3,27 @@ package com.freemud.sdk.api.assortment.shoppingcart.service.impl; ...@@ -3,41 +3,27 @@ package com.freemud.sdk.api.assortment.shoppingcart.service.impl;
import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Level;
import cn.freemud.base.entity.BaseResponse; import cn.freemud.base.entity.BaseResponse;
import cn.freemud.redis.RedisCache; import cn.freemud.redis.RedisCache;
import com.alibaba.fastjson.JSON; import com.freemud.application.sdk.api.couponcenter.online.domain.ActiveDetailVO;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.couponcenter.enums.CouponTypeEnum;
import com.freemud.application.sdk.api.couponcenter.online.domain.*;
import com.freemud.application.sdk.api.couponcenter.online.request.ActiveBatchQueryRequest; import com.freemud.application.sdk.api.couponcenter.online.request.ActiveBatchQueryRequest;
import com.freemud.application.sdk.api.couponcenter.online.request.CouponDetailRequest;
import com.freemud.application.sdk.api.couponcenter.online.request.PartnerRequest;
import com.freemud.application.sdk.api.couponcenter.online.response.CouponDetailResponse;
import com.freemud.application.sdk.api.couponcenter.online.service.FMActiveSdkService; import com.freemud.application.sdk.api.couponcenter.online.service.FMActiveSdkService;
import com.freemud.application.sdk.api.couponcenter.online.service.OnlineCouponSdkService; import com.freemud.application.sdk.api.couponcenter.online.service.OnlineCouponSdkService;
import com.freemud.application.sdk.api.productcenter.constant.ResponseConstant;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO; import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.application.sdk.api.productcenter.domain.ProductInfosDTO;
import com.freemud.application.sdk.api.productcenter.request.menu.GetMenuCategoryByIdsRequest;
import com.freemud.application.sdk.api.productcenter.request.product.GetProductRequest;
import com.freemud.application.sdk.api.productcenter.response.menu.GetMenuCategoryByIdsResponse;
import com.freemud.application.sdk.api.productcenter.response.menu.GetMenuCategoryInfoResponse;
import com.freemud.application.sdk.api.productcenter.response.product.GetProductInfosResponse;
import com.freemud.application.sdk.api.productcenter.service.MenuService; import com.freemud.application.sdk.api.productcenter.service.MenuService;
import com.freemud.application.sdk.api.productcenter.service.ProductService; import com.freemud.application.sdk.api.productcenter.service.ProductService;
import com.freemud.sdk.api.assortment.shoppingcart.adapter.ShoppingCartAdapter; import com.freemud.sdk.api.assortment.shoppingcart.adapter.ShoppingCartAdapter;
import com.freemud.sdk.api.assortment.shoppingcart.constant.*; import com.freemud.sdk.api.assortment.shoppingcart.constant.ActivityChannelEnum;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant;
import com.freemud.sdk.api.assortment.shoppingcart.constant.RedisKeyConstant;
import com.freemud.sdk.api.assortment.shoppingcart.constant.VersionUtils;
import com.freemud.sdk.api.assortment.shoppingcart.domain.*; import com.freemud.sdk.api.assortment.shoppingcart.domain.*;
import com.freemud.sdk.api.assortment.shoppingcart.enums.BizTypeEnum;
import com.freemud.sdk.api.assortment.shoppingcart.enums.SaveCouponType; import com.freemud.sdk.api.assortment.shoppingcart.enums.SaveCouponType;
import com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest;
import com.freemud.sdk.api.assortment.shoppingcart.request.GetProductInfoRequest;
import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService; import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService;
import com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil; import com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil;
import com.freemud.sdk.api.assortment.shoppingcart.util.DateTimeUtils;
import com.freemud.sdk.api.assortment.shoppingcart.util.PropertyConvertUtil; import com.freemud.sdk.api.assortment.shoppingcart.util.PropertyConvertUtil;
import com.freemud.sdk.api.assortment.shoppingcart.util.ShoppingSdkLogUtil; import com.freemud.sdk.api.assortment.shoppingcart.util.ShoppingSdkLogUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.BoundHashOperations; import org.springframework.data.redis.core.BoundHashOperations;
...@@ -45,7 +31,6 @@ import org.springframework.data.redis.core.BoundValueOperations; ...@@ -45,7 +31,6 @@ import org.springframework.data.redis.core.BoundValueOperations;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
...@@ -428,6 +413,9 @@ public class ShoppingCartBaseServiceImpl implements ShoppingCartBaseService { ...@@ -428,6 +413,9 @@ public class ShoppingCartBaseServiceImpl implements ShoppingCartBaseService {
* @return * @return
*/ */
private String getShoppingCartGoodsKey(CartParamDto cartParamDto) { private String getShoppingCartGoodsKey(CartParamDto cartParamDto) {
if(Objects.equals(cartParamDto.getBizType(), BizTypeEnum.ADVANCE_ORDER.getBizType())){
return RedisKeyConstant.SAAS_SHOPPINGCART_AIMAGE_KEY_PREFIX + cartParamDto.getPartnerId() + "_" + cartParamDto.getStoreId() + "_" + cartParamDto.getUserId();
}
return RedisKeyConstant.SAAS_SHOPPINGCART_KEY_PREFIX + cartParamDto.getPartnerId() + "_" + cartParamDto.getStoreId() + "_" + cartParamDto.getUserId(); return RedisKeyConstant.SAAS_SHOPPINGCART_KEY_PREFIX + cartParamDto.getPartnerId() + "_" + cartParamDto.getStoreId() + "_" + cartParamDto.getUserId();
} }
......
...@@ -75,6 +75,7 @@ import com.freemud.sdk.api.assortment.order.request.payment.CombPayRequest; ...@@ -75,6 +75,7 @@ import com.freemud.sdk.api.assortment.order.request.payment.CombPayRequest;
import com.freemud.sdk.api.assortment.order.request.payment.PayPlatformVO; import com.freemud.sdk.api.assortment.order.request.payment.PayPlatformVO;
import com.freemud.sdk.api.assortment.order.request.payment.ProductVO; import com.freemud.sdk.api.assortment.order.request.payment.ProductVO;
import com.freemud.sdk.api.assortment.order.response.order.CreateOrderFlowResponse; import com.freemud.sdk.api.assortment.order.response.order.CreateOrderFlowResponse;
import com.freemud.sdk.api.assortment.order.response.order.OrderExtended;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrderByIdResponse; import com.freemud.sdk.api.assortment.order.response.order.QueryOrderByIdResponse;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse; import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import com.freemud.sdk.api.assortment.order.response.payment.OrderPayResponse; import com.freemud.sdk.api.assortment.order.response.payment.OrderPayResponse;
...@@ -679,6 +680,7 @@ public class OrderAdapter { ...@@ -679,6 +680,7 @@ public class OrderAdapter {
// log.debug("getCreateOrderDto sessionId:{},createOrderVo:{}",createOrderVo.getSessionId(),JSON.toJSONString(createOrderVo)); // log.debug("getCreateOrderDto sessionId:{},createOrderVo:{}",createOrderVo.getSessionId(),JSON.toJSONString(createOrderVo));
Integer orderType; Integer orderType;
String receiveAddress = createOrderVo.getStoreAddress(); String receiveAddress = createOrderVo.getStoreAddress();
// fisherman -> 爱马哥 orderType落库的类型处理
if (Objects.equals(createOrderVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode())) { if (Objects.equals(createOrderVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode())) {
orderType = OrderType.TAKE_OUT.getCode(); orderType = OrderType.TAKE_OUT.getCode();
receiveAddress = (userDeliveryInfoDto != null ? userDeliveryInfoDto.getReceiveOfficeName() + "," + userDeliveryInfoDto.getReceiveAddress() : ""); receiveAddress = (userDeliveryInfoDto != null ? userDeliveryInfoDto.getReceiveOfficeName() + "," + userDeliveryInfoDto.getReceiveAddress() : "");
...@@ -715,6 +717,8 @@ public class OrderAdapter { ...@@ -715,6 +717,8 @@ public class OrderAdapter {
createOrderDto.setLongitude(longitude); createOrderDto.setLongitude(longitude);
createOrderDto.setOrderType(convent2OrderTypeEnum(orderType)); createOrderDto.setOrderType(convent2OrderTypeEnum(orderType));
createOrderDto.setPayType(QueryPayType.ONLINE_PAY); createOrderDto.setPayType(QueryPayType.ONLINE_PAY);
// 爱马哥蛋糕预定 预定单需求, bizType= 7 其他的场景默认传递null(到基础服务默认设置为1)
createOrderDto.setBizType(createOrderVo.getBizType());
//电子风味卡 //电子风味卡
if (Objects.nonNull(createOrderVo.getUnionPayCard())) { if (Objects.nonNull(createOrderVo.getUnionPayCard())) {
createOrderDto.setPayChannel(PayChannelType.USVCP.getEbcode()); createOrderDto.setPayChannel(PayChannelType.USVCP.getEbcode());
...@@ -1524,9 +1528,15 @@ public class OrderAdapter { ...@@ -1524,9 +1528,15 @@ public class OrderAdapter {
responseVo.setExpressNo(ordersBean.getExpressNo()); responseVo.setExpressNo(ordersBean.getExpressNo());
responseVo.setAutoReviceTime(null == orderExtInfoDto ? null : orderExtInfoDto.getAutoReceiveTime()); responseVo.setAutoReviceTime(null == orderExtInfoDto ? null : orderExtInfoDto.getAutoReceiveTime());
responseVo.setAfterSalesOrderResp(ordersBean.getAfterSalesOrderResp()); responseVo.setAfterSalesOrderResp(ordersBean.getAfterSalesOrderResp());
// bizType = 7 预定单的 额外信息返回
OrderExtended orderExtended = ordersBean.getOrderExtended();
if (Objects.nonNull(orderExtended)) {
responseVo.setUserPhone(orderExtended.getUserPhone());
responseVo.setSendWord(orderExtended.getSendWord());
}
list.add(responseVo); list.add(responseVo);
}); });
AppLogUtil.infoLog("fisherman orderBean:", JSON.toJSONString(ordersBeans), JSON.toJSONString(list));
return list; return list;
} }
......
...@@ -34,4 +34,9 @@ public class NewShoppingCartClearDto { ...@@ -34,4 +34,9 @@ public class NewShoppingCartClearDto {
*/ */
private String channelType; private String channelType;
/**
* 爱马哥蛋糕预定
* 预定单需求, bizType= 7 其他的场景默认传递null
*/
private Integer bizType;
} }
...@@ -38,6 +38,10 @@ public class BusinessInfoDto { ...@@ -38,6 +38,10 @@ public class BusinessInfoDto {
private Integer deliveryProcessingAfterMinute; private Integer deliveryProcessingAfterMinute;
private Integer deliveryProcessingBeforeMinute; private Integer deliveryProcessingBeforeMinute;
private Integer orderProgressBarStatus; private Integer orderProgressBarStatus;
/**
* 是否开启 预定单功能 1开 0关
*/
private Integer preOrderSwitch;
private ExpandFields expandFields; private ExpandFields expandFields;
......
...@@ -43,6 +43,12 @@ public class CreateOrderVo { ...@@ -43,6 +43,12 @@ public class CreateOrderVo {
private String thirdShopId; private String thirdShopId;
/** /**
* 爱马哥蛋糕预定
* 预定单需求, bizType= 7 其他的场景默认传递null
*/
private Integer bizType;
/**
* 就餐人数 * 就餐人数
*/ */
private Integer peopleNumber; private Integer peopleNumber;
...@@ -264,6 +270,17 @@ public class CreateOrderVo { ...@@ -264,6 +270,17 @@ public class CreateOrderVo {
private String monthlyCardCode; private String monthlyCardCode;
/** /**
* 预定单的 您的电话
*/
private String userPhone;
/**
* 预定单 蛋糕寄语(额外祝福语) 最多20个字
*/
private String sendWord;
/**
* 是否使用电子风味卡,如果不为空则为使用 * 是否使用电子风味卡,如果不为空则为使用
*/ */
@Valid @Valid
......
...@@ -625,6 +625,15 @@ public class QueryOrderResponseVo { ...@@ -625,6 +625,15 @@ public class QueryOrderResponseVo {
private AfterSalesOrderResp afterSalesOrderResp; private AfterSalesOrderResp afterSalesOrderResp;
/**
* 预定单的 您的电话
*/
private String userPhone;
/**
* 预定单 蛋糕寄语(额外祝福语)
*/
private String sendWord;
/** /**
* 用户申请退款原因 1=退款退货 2=只退款不退货 * 用户申请退款原因 1=退款退货 2=只退款不退货
......
...@@ -27,6 +27,13 @@ import java.util.List; ...@@ -27,6 +27,13 @@ import java.util.List;
@Builder @Builder
public class ShoppingCartInfoRequestVo { public class ShoppingCartInfoRequestVo {
/**
* 爱马哥蛋糕预定
* 预定单需求, bizType= 7 其他的场景默认传递null
*/
private Integer bizType;
private String version; private String version;
/** /**
......
...@@ -71,6 +71,8 @@ public enum ResponseResult { ...@@ -71,6 +71,8 @@ public enum ResponseResult {
STORE_DDELIVERY_METHOD("43021", "获取门店外卖配送方式异常",""), STORE_DDELIVERY_METHOD("43021", "获取门店外卖配送方式异常",""),
STORE_QUERYEXPECTARRIVETIME("43022", "获取门店计算预计送达时间失败",""), STORE_QUERYEXPECTARRIVETIME("43022", "获取门店计算预计送达时间失败",""),
STORE_DATE_ERROR("43023", "门店数据错误",""), STORE_DATE_ERROR("43023", "门店数据错误",""),
STORE_ITEM_NOT_ADVANCE("43024", "门店未开启预约单配置",""),
/** /**
* 购物车状态码 * 购物车状态码
*/ */
......
...@@ -25,6 +25,13 @@ public class OrderCheckAdapter { ...@@ -25,6 +25,13 @@ public class OrderCheckAdapter {
* @throws ServiceException 抛出异常校验异常数据 * @throws ServiceException 抛出异常校验异常数据
*/ */
public static void check(CreateOrderVo vo, StoreResponse storeResponse) throws ServiceException { public static void check(CreateOrderVo vo, StoreResponse storeResponse) throws ServiceException {
// fisherman-ka 预定单的校验 未完成 --> 这里移动了位置
// if (Objects.nonNull(vo.getBizType())
// && BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(vo.getBizType()) == 0) {
// // 伪代码 判断 门店是否开启了 预定单服务
// // 开启了预定单服务, 不走下面的检验
// // 没开启 抛出异常
// }
//非预约单的过滤 //非预约单的过滤
if (Objects.isNull(vo.getOrderType()) || if (Objects.isNull(vo.getOrderType()) ||
(!Objects.equals(vo.getTakeMealFlag(), "1"))) { (!Objects.equals(vo.getTakeMealFlag(), "1"))) {
......
...@@ -3,7 +3,6 @@ package cn.freemud.service.impl; ...@@ -3,7 +3,6 @@ package cn.freemud.service.impl;
import cn.freemud.adapter.OrderAdapter; import cn.freemud.adapter.OrderAdapter;
import cn.freemud.base.entity.BaseResponse; import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ResponseCodeConstant; import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.ConfirmOrderDto; import cn.freemud.entities.dto.ConfirmOrderDto;
import cn.freemud.entities.dto.QueryOrdersResponseDto; import cn.freemud.entities.dto.QueryOrdersResponseDto;
import cn.freemud.entities.dto.coupon.InvalidCouponsRequestDto; import cn.freemud.entities.dto.coupon.InvalidCouponsRequestDto;
...@@ -29,6 +28,7 @@ import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare; ...@@ -29,6 +28,7 @@ import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.constant.ResponseResultEnum; import com.freemud.application.sdk.api.constant.ResponseResultEnum;
import com.freemud.application.sdk.api.log.LogThreadLocal; import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.ordercenter.enums.AfterSalesType; import com.freemud.application.sdk.api.ordercenter.enums.AfterSalesType;
import com.freemud.application.sdk.api.ordercenter.enums.BizTypeEnum;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType; import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto; import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest; import com.freemud.application.sdk.api.ordercenter.request.create.CreateOrderRequest;
...@@ -63,7 +63,6 @@ import org.springframework.stereotype.Service; ...@@ -63,7 +63,6 @@ import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
......
...@@ -42,6 +42,7 @@ import cn.freemud.entities.dto.shoppingCart.NewShoppingCartClearDto; ...@@ -42,6 +42,7 @@ import cn.freemud.entities.dto.shoppingCart.NewShoppingCartClearDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*; import cn.freemud.entities.vo.*;
import cn.freemud.enums.*; import cn.freemud.enums.*;
import cn.freemud.enums.OrderType;
import cn.freemud.interceptor.ServiceException; import cn.freemud.interceptor.ServiceException;
import cn.freemud.management.entities.dto.request.BatchOrderRefundV2Request; import cn.freemud.management.entities.dto.request.BatchOrderRefundV2Request;
import cn.freemud.management.entities.dto.response.activity.GroupWorkRefundResponse; import cn.freemud.management.entities.dto.response.activity.GroupWorkRefundResponse;
...@@ -78,11 +79,9 @@ import com.freemud.application.sdk.api.constant.ResponseResultEnum; ...@@ -78,11 +79,9 @@ import com.freemud.application.sdk.api.constant.ResponseResultEnum;
import com.freemud.application.sdk.api.couponcenter.offline.service.OfflineCouponSdkService; import com.freemud.application.sdk.api.couponcenter.offline.service.OfflineCouponSdkService;
import com.freemud.application.sdk.api.log.ErrorLog; import com.freemud.application.sdk.api.log.ErrorLog;
import com.freemud.application.sdk.api.log.LogThreadLocal; import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.ordercenter.common.OrderAndShoppingCommonRedisKey;
import com.freemud.application.sdk.api.ordercenter.entities.PayItem; import com.freemud.application.sdk.api.ordercenter.entities.PayItem;
import com.freemud.application.sdk.api.ordercenter.enums.AfterSalesType; import com.freemud.application.sdk.api.ordercenter.enums.*;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.application.sdk.api.ordercenter.enums.PayChannelType;
import com.freemud.application.sdk.api.ordercenter.enums.RefundModeEnum;
import com.freemud.application.sdk.api.ordercenter.request.*; import com.freemud.application.sdk.api.ordercenter.request.*;
import com.freemud.application.sdk.api.ordercenter.request.carpark.ParkingOrderCreateReq; import com.freemud.application.sdk.api.ordercenter.request.carpark.ParkingOrderCreateReq;
import com.freemud.application.sdk.api.ordercenter.response.BaseDownLoadResponse; import com.freemud.application.sdk.api.ordercenter.response.BaseDownLoadResponse;
...@@ -519,7 +518,9 @@ public class OrderServiceImpl implements Orderservice { ...@@ -519,7 +518,9 @@ public class OrderServiceImpl implements Orderservice {
var1.setMealCodeRule(getMealCodeRule(wxappid)); var1.setMealCodeRule(getMealCodeRule(wxappid));
if (StringUtils.isNotBlank(payCode)) { if (StringUtils.isNotBlank(payCode)) {
var1.setPayChannel(payCode); var1.setPayChannel(payCode);
var1.setPayChannelName(PayChannel.getByCode(payCode).getDesc()); //fisherman 看着会出现NPE 就给修改了下
PayChannel byCode = PayChannel.getByCode(payCode);
var1.setPayChannelName(Objects.isNull(byCode) ? null : byCode.getDesc());
} }
if (orderBean.getGmtExpect() != null && orderBean.getGmtExpect() != 0) { if (orderBean.getGmtExpect() != null && orderBean.getGmtExpect() != 0) {
var1.setExpectTime(DateUtil.convert2String(new Date(orderBean.getGmtExpect()), DateUtil.FORMAT_YYYY_MM_DD_HHMMSS)); var1.setExpectTime(DateUtil.convert2String(new Date(orderBean.getGmtExpect()), DateUtil.FORMAT_YYYY_MM_DD_HHMMSS));
...@@ -567,7 +568,27 @@ public class OrderServiceImpl implements Orderservice { ...@@ -567,7 +568,27 @@ public class OrderServiceImpl implements Orderservice {
newShoppingCartClearDto.setAppId(wxappid); newShoppingCartClearDto.setAppId(wxappid);
newShoppingCartClearDto.setSessionId(sessionId); newShoppingCartClearDto.setSessionId(sessionId);
newShoppingCartClearDto.setOperationType(1); newShoppingCartClearDto.setOperationType(1);
// fisherman 清楚 爱马哥蛋糕预定 类型购物车 bizType = 7
newShoppingCartClearDto.setBizType(orderBean.getBizType());
shoppingCartClient.clearShoppingCart(newShoppingCartClearDto); shoppingCartClient.clearShoppingCart(newShoppingCartClearDto);
/**
主要 根据 ShoppingCartNewServiceImpl 次要 ShoppingCartMallServiceImpl
这里不处理商城
根据sessionId 判断是否是 围餐 , 标准点餐
看看围餐 是不是也可以 直接处理
*/
AssortmentCustomerInfoVo userLoginInfoDto = customerInfoManager.getCustomerInfoByObject(sessionId);
if (Objects.nonNull(userLoginInfoDto)) {
String iappId = userLoginInfoDto.getIappId();
if (IappIdType.WC_XCX.getCode().equals(iappId)) {
// 围餐依然调用接口处理
shoppingCartClient.clearShoppingCart(newShoppingCartClearDto);
}else {
// saas订单, 直接订单服务清空购物车
redisCache.delete(OrderAndShoppingCommonRedisKey.getShoppingCartGoodsKey(partnerId,storeId,userId, orderBean.getBizType()));
}
}
} }
if (StringUtils.isNotBlank(daySeq) && orderExtInfoDto != null && !OrderType.TAKE_OUT.getCode().equals(orderBean.getType())) { if (StringUtils.isNotBlank(daySeq) && orderExtInfoDto != null && !OrderType.TAKE_OUT.getCode().equals(orderBean.getType())) {
...@@ -1888,6 +1909,15 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1888,6 +1909,15 @@ public class OrderServiceImpl implements Orderservice {
} }
} }
// fisherman 预定单前置校验-> bizType=7
if (BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(orderBean.getBizType()) == 0) {
// 预定时间 前一天都可退款
BaseResponse baseResponse = this.checkAdvanceOrder(orderBean.getGmtExpect());
if (Objects.nonNull(baseResponse)) {
return baseResponse;
}
}
/** /**
* 已接单,制作完成,配送中,未接单,用户可申请退款 * 已接单,制作完成,配送中,未接单,用户可申请退款
* *
...@@ -2010,6 +2040,23 @@ public class OrderServiceImpl implements Orderservice { ...@@ -2010,6 +2040,23 @@ public class OrderServiceImpl implements Orderservice {
return ResponseUtil.success(); return ResponseUtil.success();
} }
/**
*
* @param gmtExpect 预约时间
* @return
*/
private BaseResponse checkAdvanceOrder(Long gmtExpect) {
if (Objects.isNull(gmtExpect)) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "预期送达时间为空,请联系售后");
}
// 只有在 预约时间当天不可取消订单
Date expectDate = DateUtil.convert2Date(new Date(gmtExpect), DateUtil.FORMAT_YMD);
if (new Date().after(expectDate)) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "预约时间当天不可退款");
}
return null;
}
/** /**
* 商家未接单,取消订单逻辑处理 1.调用支付退款 2.根据支付退款返回状态组装订单取消参数,调用订单取消接口 * 商家未接单,取消订单逻辑处理 1.调用支付退款 2.根据支付退款返回状态组装订单取消参数,调用订单取消接口
...@@ -2536,6 +2583,9 @@ public class OrderServiceImpl implements Orderservice { ...@@ -2536,6 +2583,9 @@ public class OrderServiceImpl implements Orderservice {
AssortmentCustomerInfoVo userLoginInfoDto) { AssortmentCustomerInfoVo userLoginInfoDto) {
CreateOrderOperateDto response = new CreateOrderOperateDto(); CreateOrderOperateDto response = new CreateOrderOperateDto();
OrderExtendedReq orderExtendedReq = orderAdapter.saveStoreInfo(storeResponseDto); OrderExtendedReq orderExtendedReq = orderAdapter.saveStoreInfo(storeResponseDto);
// fisherman 爱马哥蛋糕 预定 额外字段存储
orderExtendedReq.setUserPhone(createOrderVo.getUserPhone());
orderExtendedReq.setSendWord(createOrderVo.getSendWord());
OrderClientType orderClient = OrderClientType.SAAS; OrderClientType orderClient = OrderClientType.SAAS;
String appId = userLoginInfoDto.getWxAppId(); String appId = userLoginInfoDto.getWxAppId();
if ("2".equals(userLoginInfoDto.getChannel())) { if ("2".equals(userLoginInfoDto.getChannel())) {
......
package com.freemud.application.sdk.api.ordercenter.common;
import com.freemud.application.sdk.api.ordercenter.enums.BizTypeEnum;
import java.util.Objects;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2021/8/2 下午8:06
* @description : 订单和 购物车 共同使用方法
*/
public abstract class OrderAndShoppingCommonRedisKey {
/**
* 用户购物车在redis的key前缀 爱马哥蛋糕预定
*/
private final static String SAAS_SHOPPINGCART_AIMAGE_KEY_PREFIX = "saas:user:info:advance:cart:goods:";
/**
* 用户购物车在redis的key前缀
*/
private final static String SAAS_SHOPPINGCART_KEY_PREFIX = "saas:user:info:cart:goods:";
/**
* 获取记录购物车信息的key
*
* @param partnerId
* @param storeId
* @param userId
* @return
*/
public static String getShoppingCartGoodsKey(String partnerId, String storeId, String userId,Integer bizType) {
if(Objects.equals(BizTypeEnum.ADVANCE_ORDER.getBizType(),bizType)){
return SAAS_SHOPPINGCART_AIMAGE_KEY_PREFIX + partnerId + "_" + storeId + "_" + userId;
}
return SAAS_SHOPPINGCART_KEY_PREFIX + partnerId + "_" + storeId + "_" + userId;
}
}
package com.freemud.application.sdk.api.ordercenter.enums;
/**
* @author wanghanghang
* @title: QueryHeardServiceImpl
* @projectName order_group
* @description: 订单BizType枚举类
* @date 2021/7/15下午10:50
*/
public enum BizTypeEnum {
//字段6代表卖券订单。
//蜜雪APP和平台通用。
//后续使用此字段需注意。名称APP_COUPON取得有些误导,由于有地方使用,暂时不更改
APP_COUPON(6, "卖券订单"),
ORDINARY(1, "普通订单"),
VIRTUAL(2, "虚拟订单"),
MEMBERS(3, "会员订单"),
INTEGRAL_MALL(4, "积分商城订单"),
SVC(5, "储值卡订单"),
SALE_COUPON(6, "卖券订单"),
/**
* 增对 爱马哥的蛋糕预定出的需求,
*/
ADVANCE_ORDER(7, "预订单"),
LGS_SELF_HELP_PARKING(97, "农工商停车自助积分订单"),
LGS_MANUAL_RECORD_PARKING(98, "农工商停车手工录单"),
LGS_PARKING(99, "农工商停车订单");
private Integer bizType;
private String desc;
BizTypeEnum(Integer bizType, String desc) {
this.bizType = bizType;
this.desc = desc;
}
public static BizTypeEnum getByCode(Integer code) {
for (BizTypeEnum bizTypeEnum : values()) {
if (bizTypeEnum.getBizType().equals(code)) {
return bizTypeEnum;
}
}
return null;
}
public Integer getBizType() {
return bizType;
}
public void setBizType(Integer bizType) {
this.bizType = bizType;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
\ No newline at end of file
...@@ -36,4 +36,13 @@ public class OrderExtendedReq { ...@@ -36,4 +36,13 @@ public class OrderExtendedReq {
* 团号 * 团号
*/ */
private String spellGroupCode; private String spellGroupCode;
/**
* 预定单的 您的电话
*/
private String userPhone;
/**
* 预定单 蛋糕寄语(额外祝福语)
*/
private String sendWord;
} }
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
package cn.freemud.constant; package cn.freemud.constant;
import com.freemud.application.sdk.api.ordercenter.common.OrderAndShoppingCommonRedisKey;
public class RedisKeyConstant { public class RedisKeyConstant {
/** /**
* userInfoMap的redisKey前缀 * userInfoMap的redisKey前缀
...@@ -23,10 +25,18 @@ public class RedisKeyConstant { ...@@ -23,10 +25,18 @@ public class RedisKeyConstant {
*/ */
public final static String SAAS_VERIFICATION_CODE_KEY_PREFIX = "saas:userSmsCode:mobile_"; public final static String SAAS_VERIFICATION_CODE_KEY_PREFIX = "saas:userSmsCode:mobile_";
/** /**
* 用户购物车在redis的key前缀 * 用户购物车在redis的key前缀 弃用
* @see OrderAndShoppingCommonRedisKey
*/ */
@Deprecated
public final static String SAAS_SHOPPINGCART_KEY_PREFIX = "saas:user:info:cart:goods:"; public final static String SAAS_SHOPPINGCART_KEY_PREFIX = "saas:user:info:cart:goods:";
/** /**
* 用户购物车在redis的key前缀 爱马哥蛋糕预定 弃用
* @see OrderAndShoppingCommonRedisKey
*/
@Deprecated
public final static String SAAS_SHOPPINGCART_AIMAGE_KEY_PREFIX = "saas:user:info:advance:cart:goods:";
/**
* 用户购物车总价在redis的key前缀 * 用户购物车总价在redis的key前缀
*/ */
public final static String SAAS_SHOPPINGCART_AMOUNT_PREFIX = "saas:user:info:cart:amount:goods:"; public final static String SAAS_SHOPPINGCART_AMOUNT_PREFIX = "saas:user:info:cart:amount:goods:";
......
...@@ -115,7 +115,7 @@ public class DistributeAdapter { ...@@ -115,7 +115,7 @@ public class DistributeAdapter {
List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode()); List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode());
if (CollectionUtils.isNotEmpty(uuidList)){ if (CollectionUtils.isNotEmpty(uuidList)){
List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList()); List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList());
assortmentSdkService.setShoppingCart(bo.getPartnerId(), bo.getShopId(), bo.getUserId(), newCartList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(bo.getPartnerId(), bo.getShopId(), bo.getUserId(), newCartList, null, null, this.shoppingCartBaseService,null);
cartGoodsList = newCartList; cartGoodsList = newCartList;
CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId); CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId);
commonSetMessageBO.setChanged(true); commonSetMessageBO.setChanged(true);
......
...@@ -219,7 +219,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -219,7 +219,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
// 获取购物车信息 // 获取购物车信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService); List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService,null);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
allCartGoodsList = new ArrayList<>(); allCartGoodsList = new ArrayList<>();
} }
......
...@@ -207,7 +207,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -207,7 +207,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
// 获取购物车信息 // 获取购物车信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService); List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService,null);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD); throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD);
} }
...@@ -345,7 +345,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe ...@@ -345,7 +345,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext(); ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext();
assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(), assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(),
addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService); addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService,null);
calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods()); calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods());
calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged()); calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged());
......
...@@ -211,7 +211,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -211,7 +211,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
// 获取购物车信息 // 获取购物车信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService); List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(baseRequestBO.getPartnerId(), baseRequestBO.getShopId(), userInfo.getUserId(), baseRequestBO.getSessionId(), null, shoppingCartBaseService,null);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
allCartGoodsList = new ArrayList<>(); allCartGoodsList = new ArrayList<>();
} else { } else {
...@@ -309,7 +309,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService { ...@@ -309,7 +309,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext(); ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext();
assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(), assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(),
addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService); addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService,null);
calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods()); calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods());
calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged()); calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged());
......
...@@ -198,7 +198,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -198,7 +198,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
// 先验证商品是否存在 // 先验证商品是否存在
CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk(baseRequestBO.getPartnerId(), userInfo.getUserId(), baseRequestBO.getShopId(), CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk(baseRequestBO.getPartnerId(), userInfo.getUserId(), baseRequestBO.getShopId(),
baseRequestBO.getCartGoodsUid(), "", shoppingCartBaseService); baseRequestBO.getCartGoodsUid(), "", shoppingCartBaseService,null);
if (cartGoods == null) { if (cartGoods == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR); throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
} }
...@@ -284,7 +284,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -284,7 +284,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
// 更新购物车信息 // 更新购物车信息
List<CartGoods> cartGoodsList = assortmentSdkService.updateGoodsQtyBySdk(baseRequestDTO.getPartnerId(), checkBussinessRulesBO.getUserId(), List<CartGoods> cartGoodsList = assortmentSdkService.updateGoodsQtyBySdk(baseRequestDTO.getPartnerId(), checkBussinessRulesBO.getUserId(),
baseRequestDTO.getShopId(), cartGoods.getCartGoodsUid(), cartGoods.getQty()<0?0:cartGoods.getQty(), "", shoppingCartBaseService); baseRequestDTO.getShopId(), cartGoods.getCartGoodsUid(), cartGoods.getQty()<0?0:cartGoods.getQty(), "", shoppingCartBaseService,null);
CheckCartRequest checkCartRequest = shoppingBaseService.checkShoppingCart(cartGoodsList, null, cartContext); CheckCartRequest checkCartRequest = shoppingBaseService.checkShoppingCart(cartGoodsList, null, cartContext);
...@@ -306,7 +306,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer ...@@ -306,7 +306,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext(); ShoppingCartContext cartContext = addGoodsToShoppingCartBO.getShoppingCartContext();
assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(), assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), cartContext.getUserId(),
addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService); addGoodsToShoppingCartBO.getCartGoods(), baseRequestDTO.getSessionId(), "", shoppingCartBaseService,null);
calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods()); calCostBO.setCartGoods(addGoodsToShoppingCartBO.getCartGoods());
calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged()); calCostBO.setChanged(addGoodsToShoppingCartBO.getChanged());
......
...@@ -43,7 +43,7 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService { ...@@ -43,7 +43,7 @@ public class ShoppingBaseServiceImpl implements ShoppingCartService {
}); });
// 重新set购物车信息到缓存中 // 重新set购物车信息到缓存中
assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(), assortmentSdkService.setShoppingCart(cartContext.getPartnerId(), cartContext.getShopId(),
cartContext.getUserId(), nowCartGoodsList, cartContext.getSessionId(), cartContext.getTableNumber(), this.shoppingCartBaseService); cartContext.getUserId(), nowCartGoodsList, cartContext.getSessionId(), cartContext.getTableNumber(), this.shoppingCartBaseService,null);
cartGoodsList.clear(); cartGoodsList.clear();
cartGoodsList.addAll(nowCartGoodsList); cartGoodsList.addAll(nowCartGoodsList);
return nowCartGoodsList; return nowCartGoodsList;
......
...@@ -30,4 +30,9 @@ public class BaseRequestVo { ...@@ -30,4 +30,9 @@ public class BaseRequestVo {
* 渠道类型 OrderChannelType * 渠道类型 OrderChannelType
*/ */
private String channelType; private String channelType;
/**
* 业务类型 7-预定单 爱马哥蛋糕预定场景使用(2.0.41迭代 1032929)
*/
private Integer bizType;
} }
...@@ -48,6 +48,11 @@ public class PremiumExchangeRequestVo { ...@@ -48,6 +48,11 @@ public class PremiumExchangeRequestVo {
private String menuType; private String menuType;
/** /**
* 业务类型 7-预定单 爱马哥蛋糕预定场景使用(2.0.41迭代 1032929)
*/
private Integer bizType;
/**
* 优惠券code列表 * 优惠券code列表
*/ */
private List<couponCode> couponCodes; private List<couponCode> couponCodes;
......
...@@ -38,4 +38,9 @@ public class CouponAvailableRequestVo { ...@@ -38,4 +38,9 @@ public class CouponAvailableRequestVo {
@ApiModelProperty(value = "收货地址id",notes = "svc卡支付外卖订单必传") @ApiModelProperty(value = "收货地址id",notes = "svc卡支付外卖订单必传")
private String receiveId; private String receiveId;
/**
* 业务类型 7-预定单 爱马哥蛋糕预定场景使用(2.0.41迭代 1032929)
*/
private Integer bizType;
} }
\ No newline at end of file
...@@ -340,9 +340,9 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService ...@@ -340,9 +340,9 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
//外卖场景下 查询门店配送信息 //外卖场景下 查询门店配送信息
if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){ if(BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)){
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType,isMember, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),deliveryAmount); calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType,isMember, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),deliveryAmount,null);
}else{ }else{
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType,isMember, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),null); calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType,isMember, cartGoodsList, coupons, sendGoodsList,BusinessTypeEnum.getByType(menuType).getCode(),null,null);
} }
return calculationDiscountResult; return calculationDiscountResult;
......
...@@ -21,6 +21,6 @@ public interface ShoppingCartNewBaseService { ...@@ -21,6 +21,6 @@ public interface ShoppingCartNewBaseService {
List<CartGoods> add(String partnerId, String storeId, String useId, CartGoods cartGoods); List<CartGoods> add(String partnerId, String storeId, String useId, CartGoods cartGoods);
void clear(String partnerId, String storeId, String useId); void clear(String partnerId, String storeId, String useId,Integer bizType);
} }
...@@ -97,7 +97,7 @@ public interface ShoppingCartNewService { ...@@ -97,7 +97,7 @@ public interface ShoppingCartNewService {
boolean isMember, boolean isMember,
List<CartGoods> cartGoodsList, List<CartGoods> cartGoodsList,
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons,
List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList,String menuType,Long distributionFee); List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList,String menuType,Long distributionFee,Integer bizType);
List<CartGoods> updateCartGoodsLegal(CartGoods cartGoods, String userId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo, AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo, List<CartGoods> oldAllCartGoodsList); List<CartGoods> updateCartGoodsLegal(CartGoods cartGoods, String userId, ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo, AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo, List<CartGoods> oldAllCartGoodsList);
......
...@@ -71,11 +71,12 @@ public class AssortmentSdkService { ...@@ -71,11 +71,12 @@ public class AssortmentSdkService {
* @param cartGoodsUid * @param cartGoodsUid
* @return * @return
*/ */
public CartGoods getCartGoodsBySdk(String partnerId, String userId, String storeId, String cartGoodsUid, String tableNumber, ShoppingCartBaseService shoppingCartService) { public CartGoods getCartGoodsBySdk(String partnerId, String userId, String storeId, String cartGoodsUid, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, userId); com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, userId);
cartParamDto.setCartGoodsUid(cartGoodsUid); cartParamDto.setCartGoodsUid(cartGoodsUid);
cartParamDto.setTableNumber(tableNumber); cartParamDto.setTableNumber(tableNumber);
cartParamDto.setUserId(userId); cartParamDto.setUserId(userId);
cartParamDto.setBizType(bizType);
BaseResponse<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods> baseResponse = shoppingCartService.getCartGoods(cartParamDto, LogThreadLocal.getTrackingNo()); BaseResponse<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods> baseResponse = shoppingCartService.getCartGoods(cartParamDto, LogThreadLocal.getTrackingNo());
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || baseResponse.getResult() == null) { if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || baseResponse.getResult() == null) {
return null; return null;
...@@ -94,9 +95,9 @@ public class AssortmentSdkService { ...@@ -94,9 +95,9 @@ public class AssortmentSdkService {
* @param qty * @param qty
* @return * @return
*/ */
public List<CartGoods> updateGoodsQtyBySdk(String partnerId, String userId, String storeId, String cartGoodsUid, Integer qty, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> updateGoodsQtyBySdk(String partnerId, String userId, String storeId, String cartGoodsUid, Integer qty, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
int buyType = 0 ; int buyType = 0 ;
return updateNowBuyGoodsQtyBySdk(buyType,partnerId, userId, storeId, cartGoodsUid, qty, tableNumber, shoppingCartService); return updateNowBuyGoodsQtyBySdk(buyType,partnerId, userId, storeId, cartGoodsUid, qty, tableNumber, shoppingCartService,bizType);
} }
/** /**
...@@ -107,9 +108,9 @@ public class AssortmentSdkService { ...@@ -107,9 +108,9 @@ public class AssortmentSdkService {
* @param useId * @param useId
* @return * @return
*/ */
public List<CartGoods> getShoppingCart(String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> getShoppingCart(String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
int buyType = 0 ; int buyType = 0 ;
return getNowBuyShoppingCart( buyType, partnerId, storeId, useId, sessionId, tableNumber, shoppingCartService); return getNowBuyShoppingCart( buyType, partnerId, storeId, useId, sessionId, tableNumber, shoppingCartService,bizType);
} }
public List<CartGoods> getShoppingCartSendGoods(String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> getShoppingCartSendGoods(String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) {
...@@ -125,9 +126,10 @@ public class AssortmentSdkService { ...@@ -125,9 +126,10 @@ public class AssortmentSdkService {
* @param useId * @param useId
* @return * @return
*/ */
public List<CartGoods> getShoppingCartForCoupon(String partnerId, String storeId, String useId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> getShoppingCartForCoupon(String partnerId, String storeId, String useId, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId); com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId);
cartParamDto.setTableNumber(tableNumber); cartParamDto.setTableNumber(tableNumber);
cartParamDto.setBizType(bizType);
// 根据不同点餐类型获取不同购物车实例 // 根据不同点餐类型获取不同购物车实例
BaseResponse<List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods>> baseResponse = shoppingCartService.getCartGoodsList(cartParamDto, LogThreadLocal.getTrackingNo()); BaseResponse<List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods>> baseResponse = shoppingCartService.getCartGoodsList(cartParamDto, LogThreadLocal.getTrackingNo());
if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) { if (baseResponse == null || !ResponseResult.SUCCESS.getCode().equals(baseResponse.getCode()) || CollectionUtils.isEmpty(baseResponse.getResult())) {
...@@ -165,9 +167,9 @@ public class AssortmentSdkService { ...@@ -165,9 +167,9 @@ public class AssortmentSdkService {
* @param useId * @param useId
* @return * @return
*/ */
public List<CartGoods> setShoppingCart(String partnerId, String storeId, String useId, List<CartGoods> cartGoodsList, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> setShoppingCart(String partnerId, String storeId, String useId, List<CartGoods> cartGoodsList, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
int buyType = 0; int buyType = 0;
return setNowBuyShoppingCart(buyType,partnerId, storeId, useId , cartGoodsList, sessionId, tableNumber, shoppingCartService); return setNowBuyShoppingCart(buyType,partnerId, storeId, useId , cartGoodsList, sessionId, tableNumber, shoppingCartService,bizType);
} }
...@@ -184,11 +186,12 @@ public class AssortmentSdkService { ...@@ -184,11 +186,12 @@ public class AssortmentSdkService {
* @param useId * @param useId
* @return * @return
*/ */
public List<CartGoods> setNowBuyShoppingCart(int buyType,String partnerId, String storeId, String useId, List<CartGoods> cartGoodsList, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> setNowBuyShoppingCart(int buyType,String partnerId, String storeId, String useId, List<CartGoods> cartGoodsList, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId); com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId);
cartParamDto.setSessionId(sessionId); cartParamDto.setSessionId(sessionId);
cartParamDto.setTableNumber(tableNumber); cartParamDto.setTableNumber(tableNumber);
cartParamDto.setUserId(useId); cartParamDto.setUserId(useId);
cartParamDto.setBizType(bizType);
//立即购买==1 ,设置新的缓存key //立即购买==1 ,设置新的缓存key
if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) { if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) {
cartParamDto.setBuyType(buyType); cartParamDto.setBuyType(buyType);
...@@ -345,11 +348,12 @@ public class AssortmentSdkService { ...@@ -345,11 +348,12 @@ public class AssortmentSdkService {
* @param buyType 购买类型 * @param buyType 购买类型
* @return * @return
*/ */
public List<CartGoods> getNowBuyShoppingCart(int buyType,String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> getNowBuyShoppingCart(int buyType,String partnerId, String storeId, String useId, String sessionId, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId); com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, useId);
cartParamDto.setSessionId(sessionId); cartParamDto.setSessionId(sessionId);
cartParamDto.setTableNumber(tableNumber); cartParamDto.setTableNumber(tableNumber);
cartParamDto.setUserId(useId); cartParamDto.setUserId(useId);
cartParamDto.setBizType(bizType);
if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) { if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) {
cartParamDto.setBuyType(buyType); cartParamDto.setBuyType(buyType);
} }
...@@ -387,12 +391,13 @@ public class AssortmentSdkService { ...@@ -387,12 +391,13 @@ public class AssortmentSdkService {
* @param qty * @param qty
* @return * @return
*/ */
public List<CartGoods> updateNowBuyGoodsQtyBySdk(int buyType,String partnerId, String userId, String storeId, String cartGoodsUid, Integer qty, String tableNumber, ShoppingCartBaseService shoppingCartService) { public List<CartGoods> updateNowBuyGoodsQtyBySdk(int buyType,String partnerId, String userId, String storeId, String cartGoodsUid, Integer qty, String tableNumber, ShoppingCartBaseService shoppingCartService,Integer bizType) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, userId); com.freemud.sdk.api.assortment.shoppingcart.domain.CartParamDto cartParamDto = getCartParamDto(partnerId, storeId, userId);
cartParamDto.setCartGoodsUid(cartGoodsUid); cartParamDto.setCartGoodsUid(cartGoodsUid);
cartParamDto.setQty(qty); cartParamDto.setQty(qty);
cartParamDto.setTableNumber(tableNumber); cartParamDto.setTableNumber(tableNumber);
cartParamDto.setUserId(userId); cartParamDto.setUserId(userId);
cartParamDto.setBizType(bizType);
//立即购买==1 ,设置新的缓存key //立即购买==1 ,设置新的缓存key
if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) { if(buyType == ShoppingCartConstant.NOW_BUY_TYPE) {
cartParamDto.setBuyType(buyType); cartParamDto.setBuyType(buyType);
......
...@@ -126,7 +126,7 @@ public class CouponPromotionService implements IPromotionService { ...@@ -126,7 +126,7 @@ public class CouponPromotionService implements IPromotionService {
List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode()); List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode());
if (CollectionUtils.isNotEmpty(uuidList)){ if (CollectionUtils.isNotEmpty(uuidList)){
List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList()); List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList());
assortmentSdkService.setShoppingCart(activityQueryDto.getPartnerId(), activityQueryDto.getStoreId(), userLoginInfoDto.getMemberId(), newCartList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(activityQueryDto.getPartnerId(), activityQueryDto.getStoreId(), userLoginInfoDto.getMemberId(), newCartList, null, null, this.shoppingCartBaseService,null);
cartGoodsList = newCartList; cartGoodsList = newCartList;
CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId); CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId);
shoppingCartGoodsResponseVo.setChanged(true); shoppingCartGoodsResponseVo.setChanged(true);
......
...@@ -1331,7 +1331,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -1331,7 +1331,7 @@ public class CouponServiceImpl implements CouponService {
List<String> uuidList = spqIdToCartUuid.get(couponCode); List<String> uuidList = spqIdToCartUuid.get(couponCode);
if (CollectionUtils.isNotEmpty(uuidList)){ if (CollectionUtils.isNotEmpty(uuidList)){
List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList()); List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList());
assortmentSdkService.setShoppingCart(couponPromotionVO.getPartnerId(), couponPromotionVO.getStoreId(), couponPromotionVO.getUserId(), newCartList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(couponPromotionVO.getPartnerId(), couponPromotionVO.getStoreId(), couponPromotionVO.getUserId(), newCartList, null, null, this.shoppingCartBaseService,null);
throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage()); throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage());
} }
} else { } else {
...@@ -1341,7 +1341,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -1341,7 +1341,7 @@ public class CouponServiceImpl implements CouponService {
List<String> uuidList = spqIdToCartUuid.get(memberCouponCode); List<String> uuidList = spqIdToCartUuid.get(memberCouponCode);
if (CollectionUtils.isNotEmpty(uuidList)){ if (CollectionUtils.isNotEmpty(uuidList)){
List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList()); List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList());
assortmentSdkService.setShoppingCart(couponPromotionVO.getPartnerId(), couponPromotionVO.getStoreId(), couponPromotionVO.getUserId(), newCartList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(couponPromotionVO.getPartnerId(), couponPromotionVO.getStoreId(), couponPromotionVO.getUserId(), newCartList, null, null, this.shoppingCartBaseService,null);
throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage()); throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage());
} }
} }
......
...@@ -6,10 +6,8 @@ import cn.freemud.base.entity.BaseResponse; ...@@ -6,10 +6,8 @@ import cn.freemud.base.entity.BaseResponse;
import cn.freemud.constant.ResponseCodeConstant; import cn.freemud.constant.ResponseCodeConstant;
import cn.freemud.entities.dto.ActivityCalculationDiscountRequestDto; import cn.freemud.entities.dto.ActivityCalculationDiscountRequestDto;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto; import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.UserLoginInfoDto;
import cn.freemud.entities.dto.activity.ActivityQueryDto; import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.dto.user.GetSessionUserInfoDto;
import cn.freemud.entities.vo.*; import cn.freemud.entities.vo.*;
import cn.freemud.enums.ActivityChannelEnum; import cn.freemud.enums.ActivityChannelEnum;
import cn.freemud.enums.ProductType; import cn.freemud.enums.ProductType;
...@@ -21,7 +19,10 @@ import cn.freemud.service.CommonService; ...@@ -21,7 +19,10 @@ import cn.freemud.service.CommonService;
import cn.freemud.service.ShoppingCartNewService; import cn.freemud.service.ShoppingCartNewService;
import cn.freemud.service.thirdparty.ActivityClient; import cn.freemud.service.thirdparty.ActivityClient;
import cn.freemud.service.thirdparty.CustomerApplicationClient; import cn.freemud.service.thirdparty.CustomerApplicationClient;
import cn.freemud.utils.*; import cn.freemud.utils.PromotionFactory;
import cn.freemud.utils.PropertyConvertUtil;
import cn.freemud.utils.RedisLock;
import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -32,7 +33,6 @@ import com.freemud.api.assortment.datamanager.meal.MealCacheManager; ...@@ -32,7 +33,6 @@ import com.freemud.api.assortment.datamanager.meal.MealCacheManager;
import com.freemud.api.assortment.datamanager.meal.dto.MealNumberDto; import com.freemud.api.assortment.datamanager.meal.dto.MealNumberDto;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare; import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.log.ErrorLog; import com.freemud.application.sdk.api.log.ErrorLog;
//import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.log.LogThreadLocal; import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO; import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant; import com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant;
...@@ -51,6 +51,8 @@ import org.springframework.util.CollectionUtils; ...@@ -51,6 +51,8 @@ import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
//import com.freemud.application.sdk.api.log.LogThreadLocal;
/** /**
* All rights Reserved, Designed By www.freemud.com * All rights Reserved, Designed By www.freemud.com
* *
...@@ -134,7 +136,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -134,7 +136,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
} }
//缓存中获取购物车商品信息 //缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, requestVo.getSessionId(), tableNumber, mealCartBaseService); List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, requestVo.getSessionId(), tableNumber, mealCartBaseService,null);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
allCartGoodsList = new ArrayList<>(); allCartGoodsList = new ArrayList<>();
} }
...@@ -195,7 +197,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -195,7 +197,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
} }
try { try {
CartGoods goods = assortmentSdkService.getCartGoodsBySdk(customerInfo.getPartnerId(), customerInfo.getMemberId(), CartGoods goods = assortmentSdkService.getCartGoodsBySdk(customerInfo.getPartnerId(), customerInfo.getMemberId(),
customerInfo.getStoreId(), requestVo.getCartGoodsUid(), customerInfo.getTableNumber(), this.mealCartBaseService); customerInfo.getStoreId(), requestVo.getCartGoodsUid(), customerInfo.getTableNumber(), this.mealCartBaseService,null);
if (goods == null) { if (goods == null) {
doUnlock(requestVo.getCartGoodsUid()); doUnlock(requestVo.getCartGoodsUid());
buildMealResponse(requestVo.getOrderType(), customerInfo, userCartsMap, responseVo); buildMealResponse(requestVo.getOrderType(), customerInfo, userCartsMap, responseVo);
...@@ -203,7 +205,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -203,7 +205,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
} }
// 更新购物车中数量 // 更新购物车中数量
assortmentSdkService.updateGoodsQtyBySdk(customerInfo.getPartnerId(), customerInfo.getMemberId(), assortmentSdkService.updateGoodsQtyBySdk(customerInfo.getPartnerId(), customerInfo.getMemberId(),
customerInfo.getStoreId(), requestVo.getCartGoodsUid(), requestVo.getQty(), customerInfo.getTableNumber(), this.mealCartBaseService); customerInfo.getStoreId(), requestVo.getCartGoodsUid(), requestVo.getQty(), customerInfo.getTableNumber(), this.mealCartBaseService,null);
} catch (Exception e) { } catch (Exception e) {
ErrorLog.errorConvertJson(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(), "updateGoodsQty:" + e.getMessage(), e); ErrorLog.errorConvertJson(SDKCommonBaseContextWare.getAppName(), LogThreadLocal.getTrackingNo(), getClass(), "updateGoodsQty:" + e.getMessage(), e);
return ResponseUtil.error(ResponseResult.SHOPPING_CART_VERSION_ERROR, "购物车商品有变动,请手动刷新再修改"); return ResponseUtil.error(ResponseResult.SHOPPING_CART_VERSION_ERROR, "购物车商品有变动,请手动刷新再修改");
...@@ -263,7 +265,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -263,7 +265,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
return; return;
} }
//sessionId为空时,查询所有的 //sessionId为空时,查询所有的
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(customerInfo.getPartnerId(), customerInfo.getStoreId(), "", "", customerInfo.getTableNumber(), this.mealCartBaseService); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(customerInfo.getPartnerId(), customerInfo.getStoreId(), "", "", customerInfo.getTableNumber(), this.mealCartBaseService,null);
if (CollectionUtils.isEmpty(cartGoodsList)) { if (CollectionUtils.isEmpty(cartGoodsList)) {
return; return;
} }
...@@ -424,7 +426,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -424,7 +426,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
if (CollectionUtils.isEmpty(cartGoodsList)) { if (CollectionUtils.isEmpty(cartGoodsList)) {
return; return;
} }
ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, new ArrayList<>(), new ArrayList<>(), BusinessTypeEnum.SAAS_MALL.getCode(), 0L); ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, new ArrayList<>(), new ArrayList<>(), BusinessTypeEnum.SAAS_MALL.getCode(), 0L,null);
if(calculationDiscountResult == null) { if(calculationDiscountResult == null) {
return; return;
} }
...@@ -515,7 +517,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -515,7 +517,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
return check; return check;
} }
//sessionId为空时,查询所有的 //sessionId为空时,查询所有的
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(customerInfo.getPartnerId(), customerInfo.getStoreId(), customerInfo.getMemberId(), "", customerInfo.getTableNumber(), this.mealCartBaseService); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(customerInfo.getPartnerId(), customerInfo.getStoreId(), customerInfo.getMemberId(), "", customerInfo.getTableNumber(), this.mealCartBaseService,null);
if (CollectionUtils.isEmpty(cartGoodsList)) { if (CollectionUtils.isEmpty(cartGoodsList)) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_INVAILD, result); return ResponseUtil.error(ResponseResult.SHOPPING_CART_ADD_INVAILD, result);
} }
...@@ -553,7 +555,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -553,7 +555,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
@Override @Override
public ActivityCalculationDiscountResponseDto.CalculationDiscountResult getActivityCalculationDiscountResponse(String partnerId, String storeId, String userId, String appId, Integer orderType, boolean isMember, public ActivityCalculationDiscountResponseDto.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) { List<CartGoods> cartGoodsList, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons, List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList,String menuType,Long distributionFee,Integer bizType) {
ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto = getActivityCalculationDiscountRequestDto(partnerId, storeId, userId, appId, orderType); ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto = getActivityCalculationDiscountRequestDto(partnerId, storeId, userId, appId, orderType);
List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList = new ArrayList<>(); List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList = new ArrayList<>();
cartGoodsList = cartGoodsList.stream().filter(t -> !isWeightProduct(t)).collect(Collectors.toList()); cartGoodsList = cartGoodsList.stream().filter(t -> !isWeightProduct(t)).collect(Collectors.toList());
......
...@@ -16,6 +16,8 @@ import cn.freemud.constant.RedisKeyConstant; ...@@ -16,6 +16,8 @@ import cn.freemud.constant.RedisKeyConstant;
import cn.freemud.entities.vo.CartGoods; import cn.freemud.entities.vo.CartGoods;
import cn.freemud.service.ShoppingCartNewBaseService; import cn.freemud.service.ShoppingCartNewBaseService;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare; import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.ordercenter.common.OrderAndShoppingCommonRedisKey;
import com.freemud.application.sdk.api.ordercenter.enums.BizTypeEnum;
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl; import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.BoundHashOperations; import org.springframework.data.redis.core.BoundHashOperations;
...@@ -24,6 +26,7 @@ import org.springframework.stereotype.Service; ...@@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Objects;
@Service @Service
public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseService { public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseService {
...@@ -39,18 +42,20 @@ public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseServic ...@@ -39,18 +42,20 @@ public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseServic
public List<CartGoods> add(String partnerId, String storeId, String userId, CartGoods cartGoods) { public List<CartGoods> add(String partnerId, String storeId, String userId, CartGoods cartGoods) {
BoundHashOperations<String, String, CartGoods> operations = this.getShoppingCartGoodsZSetOperations(partnerId, storeId, userId); BoundHashOperations<String, String, CartGoods> operations = this.getShoppingCartGoodsZSetOperations(partnerId, storeId, userId);
operations.put(cartGoods.getCartGoodsUid(), cartGoods); operations.put(cartGoods.getCartGoodsUid(), cartGoods);
return assortmentSdkService.getShoppingCart(partnerId, storeId, userId,null,null, SDKCommonBaseContextWare.getBean(ShoppingCartBaseServiceImpl.class)); return assortmentSdkService.getShoppingCart(partnerId, storeId, userId,null,null, SDKCommonBaseContextWare.getBean(ShoppingCartBaseServiceImpl.class),null);
} }
@Override @Override
public void clear(String partnerId, String storeId, String userId) { public void clear(String partnerId, String storeId, String userId,Integer bizType) {
redisTemplate.delete(this.getShoppingCartGoodsKey(partnerId, storeId, userId)); // fisherman 提供 订单 & 购物车 公共方法
// redisTemplate.delete(this.getShoppingCartGoodsKey(partnerId, storeId, userId,bizType));
redisTemplate.delete(OrderAndShoppingCommonRedisKey.getShoppingCartGoodsKey(partnerId,storeId,userId, bizType));
//redisTemplate.delete(this.getShoppingCartGoodsAmountKey(partnerId, storeId, userId)); //redisTemplate.delete(this.getShoppingCartGoodsAmountKey(partnerId, storeId, userId));
} }
private BoundHashOperations getShoppingCartGoodsZSetOperations(String partnerId, String storeId, String userId) { private BoundHashOperations getShoppingCartGoodsZSetOperations(String partnerId, String storeId, String userId) {
String key = this.getShoppingCartGoodsKey(partnerId, storeId, userId); String key = this.getShoppingCartGoodsKey(partnerId, storeId, userId,null);
return redisTemplate.boundHashOps(key); return redisTemplate.boundHashOps(key);
} }
...@@ -62,8 +67,8 @@ public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseServic ...@@ -62,8 +67,8 @@ public class ShoppingCartNewBaseServiceImpl implements ShoppingCartNewBaseServic
* @param userId * @param userId
* @return * @return
*/ */
private String getShoppingCartGoodsKey(String partnerId, String storeId, String userId) { private String getShoppingCartGoodsKey(String partnerId, String storeId, String userId,Integer bizType) {
return RedisKeyConstant.SAAS_SHOPPINGCART_KEY_PREFIX + partnerId + "_" + storeId + "_" + userId; return OrderAndShoppingCommonRedisKey.getShoppingCartGoodsKey(partnerId,storeId,userId, bizType);
} }
/** /**
......
...@@ -68,7 +68,8 @@ public class CalculationSharingCartService { ...@@ -68,7 +68,8 @@ public class CalculationSharingCartService {
, String partnerId , String partnerId
, Integer flag , Integer flag
, String userId , String userId
, String storeId) { , String storeId
, Integer bizType) {
/** /**
* 用促销价格初始化购物车行记录成交价 * 用促销价格初始化购物车行记录成交价
...@@ -85,7 +86,7 @@ public class CalculationSharingCartService { ...@@ -85,7 +86,7 @@ public class CalculationSharingCartService {
/** /**
* 可用券及券折扣 * 可用券及券折扣
*/ */
promotionSharingService.updateShoppingCartGoodsDiscount(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO,shoppingCartInfoRequestVo, userId, partnerId, storeId, activityQueryDto.getOrderType()); promotionSharingService.updateShoppingCartGoodsDiscount(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO,shoppingCartInfoRequestVo, userId, partnerId, storeId, activityQueryDto.getOrderType(),bizType);
/** /**
* 满减处理 * 满减处理
......
...@@ -85,7 +85,7 @@ public class CalculationSharingDiscountService { ...@@ -85,7 +85,7 @@ public class CalculationSharingDiscountService {
, List<CalculationSharingDiscountRequestDto.CalculationDiscountCoupon> coupons , List<CalculationSharingDiscountRequestDto.CalculationDiscountCoupon> coupons
, List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList , List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList
, Long deliveryAmount , Long deliveryAmount
, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) { , ShoppingCartInfoRequestVo shoppingCartInfoRequestVo,Integer bizType) {
CalculationSharingDiscountRequestDto calculationSharingDiscountRequestDto = this.commonSharingDto(partnerId, storeId, userId, appId, orderType); CalculationSharingDiscountRequestDto calculationSharingDiscountRequestDto = this.commonSharingDto(partnerId, storeId, userId, appId, orderType);
...@@ -115,7 +115,7 @@ public class CalculationSharingDiscountService { ...@@ -115,7 +115,7 @@ public class CalculationSharingDiscountService {
} }
if (null == checkSpqInfo) { if (null == checkSpqInfo) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService,bizType);
//跑业务异常 商品券不存 //跑业务异常 商品券不存
} else { } else {
if(useCoupon){ if(useCoupon){
...@@ -156,7 +156,7 @@ public class CalculationSharingDiscountService { ...@@ -156,7 +156,7 @@ public class CalculationSharingDiscountService {
if (GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
if (CollectionUtils.isEmpty(cartGoods.getProductGroupList()) && CollectionUtils.isEmpty(cartGoods.getProductComboList())) { if (CollectionUtils.isEmpty(cartGoods.getProductGroupList()) && CollectionUtils.isEmpty(cartGoods.getProductComboList())) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService,null);
throw new ServiceException(ResponseResult.SHOPPING_CART_NO_MEAL); throw new ServiceException(ResponseResult.SHOPPING_CART_NO_MEAL);
} }
} }
......
...@@ -48,7 +48,7 @@ public class CouponSharingService { ...@@ -48,7 +48,7 @@ public class CouponSharingService {
, List<CartGoods> cartGoodsList , List<CartGoods> cartGoodsList
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo , ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo
, CouponPromotionVO couponPromotionVO , CouponPromotionVO couponPromotionVO
,ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, String userId, String partnerId, String storeId, Integer orderType) { ,ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, String userId, String partnerId, String storeId, Integer orderType,Integer bizType) {
// 用户选择了查询优惠券信息 // 用户选择了查询优惠券信息
if (couponPromotionVO != null && !ObjectUtils.equals(AvailableCouponQueryFlagEnum.NO.getCode(), couponPromotionVO.getAvailableCouponQueryFlag())) { if (couponPromotionVO != null && !ObjectUtils.equals(AvailableCouponQueryFlagEnum.NO.getCode(), couponPromotionVO.getAvailableCouponQueryFlag())) {
List<CartGoods> tmpCartGoods = cartGoodsList.parallelStream().filter(k -> (StringUtils.isNotBlank(k.getCouponCode()) || k.getCartGoodsUid() List<CartGoods> tmpCartGoods = cartGoodsList.parallelStream().filter(k -> (StringUtils.isNotBlank(k.getCouponCode()) || k.getCartGoodsUid()
...@@ -118,7 +118,7 @@ public class CouponSharingService { ...@@ -118,7 +118,7 @@ public class CouponSharingService {
List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode()); List<String> uuidList = spqIdToCartUuid.get(sqpInfo.getCouponCode());
if (CollectionUtils.isNotEmpty(uuidList)){ if (CollectionUtils.isNotEmpty(uuidList)){
List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList()); List<CartGoods> newCartList = cartGoodsList.stream().filter(p -> !uuidList.contains(p.getCartGoodsUid())).collect(Collectors.toList());
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, newCartList, null, null, this.shoppingCartBaseService); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, newCartList, null, null, this.shoppingCartBaseService,bizType);
cartGoodsList = newCartList; cartGoodsList = newCartList;
CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId); CheckSpqInfoResponseDto checkSpqInfoResponseDto = validCouponMap.get(spqId);
shoppingCartGoodsResponseVo.setChanged(true); shoppingCartGoodsResponseVo.setChanged(true);
......
...@@ -66,7 +66,7 @@ public class AssortmentSdkServiceTest { ...@@ -66,7 +66,7 @@ public class AssortmentSdkServiceTest {
String storeId = "1000189"; String storeId = "1000189";
String useId = "115547751030883080"; String useId = "115547751030883080";
List<CartGoods> result = assortmentSdkService.setShoppingCart(partnerId, storeId, useId, cartGoodsList,"","",shoppingCartBaseService); List<CartGoods> result = assortmentSdkService.setShoppingCart(partnerId, storeId, useId, cartGoodsList,"","",shoppingCartBaseService,null);
System.out.println(JSONObject.toJSONString(result)); System.out.println(JSONObject.toJSONString(result));
} }
...@@ -76,7 +76,7 @@ public class AssortmentSdkServiceTest { ...@@ -76,7 +76,7 @@ public class AssortmentSdkServiceTest {
String storeId = "1000189"; String storeId = "1000189";
String useId = "115547751030883080"; String useId = "115547751030883080";
List<CartGoods> result = assortmentSdkService.getShoppingCart(partnerId, storeId, useId,"","",shoppingCartBaseService); List<CartGoods> result = assortmentSdkService.getShoppingCart(partnerId, storeId, useId,"","",shoppingCartBaseService,null);
System.out.println(JSONObject.toJSONString(result)); System.out.println(JSONObject.toJSONString(result));
} }
......
...@@ -76,19 +76,19 @@ public class ShoppingCartNewBaseServiceTest { ...@@ -76,19 +76,19 @@ public class ShoppingCartNewBaseServiceTest {
@Test @Test
public void updateGoodsQty() { public void updateGoodsQty() {
List<CartGoods> list = assortmentSdkService.updateGoodsQtyBySdk("1864", "1011", "123", "4srwtergew", 1, "", this.shoppingCartBaseService); List<CartGoods> list = assortmentSdkService.updateGoodsQtyBySdk("1864", "1011", "123", "4srwtergew", 1, "", this.shoppingCartBaseService,null);
assertTrue(CollectionUtils.isNotEmpty(list)); assertTrue(CollectionUtils.isNotEmpty(list));
} }
@Test @Test
public void getCartGoods() { public void getCartGoods() {
CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk("1864", "1011", "123", "142sfdrasr", "", this.shoppingCartBaseService); CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk("1864", "1011", "123", "142sfdrasr", "", this.shoppingCartBaseService,null);
assertFalse(Objects.equals(cartGoods, null)); assertFalse(Objects.equals(cartGoods, null));
} }
@Test @Test
public void clearTest() { public void clearTest() {
shoppingCartNewBaseService.clear("1864", "1011", "123"); shoppingCartNewBaseService.clear("1864", "1011", "123",null);
} }
} }
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