Commit 4e9e2986 by 周晓航

预约单 按照正常订单的消息推送流程走

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 9daae3d2
......@@ -223,13 +223,11 @@ public class OrderSdkAdapter {
// 双重判断,防止前端乱传参搞事情
if (Objects.nonNull(bizType) && BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(bizType) == 0) {
request.setBizType(BizTypeEnum.ADVANCE_ORDER.getBizType());
// 按照正常单走后续推送消息通知流程
request.setOrderType(1);
} else {
// 20210730之前 默认设置为1
request.setBizType(CommonConstant.INTEGER_ONE);
request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect()));
}
request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect(),request.getBizType()));
request.setNote(requestVO.getRemark());
request.setBarCounter(requestVO.getBarCounter());
......@@ -367,7 +365,7 @@ public class OrderSdkAdapter {
//订单业务类型 1:普通订单 2:虚拟订单
request.setBizType(1);
request.setNote(requestVO.getRemark());
request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect()));
request.setOrderType(getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect(),request.getBizType()));
request.setBarCounter(requestVO.getBarCounter());
//商品信息转换
......@@ -478,7 +476,7 @@ public class OrderSdkAdapter {
createOrderRequest.setBizType(orderInfo.getBizType());
createOrderRequest.setIsParent(orderInfo.getIsParent());
createOrderRequest.setNote(orderInfo.getRemark());
createOrderRequest.setOrderType(getNewOrderType(orderInfo.getOrderType(), orderInfo.getGmtExpect()));
createOrderRequest.setOrderType(getNewOrderType(orderInfo.getOrderType(), orderInfo.getGmtExpect(),createOrderRequest.getBizType()));
createOrderRequest.setBarCounter(orderInfo.getBarCounter());
//商品信息转换
......@@ -1564,10 +1562,32 @@ public class OrderSdkAdapter {
/**
* 老订单类型转换新订单类型
*/
public Integer getNewOrderType(QueryOrderType orderType, Long gmtExpect) {
public Integer getNewOrderType(QueryOrderType orderType, Long gmtExpect,Integer bizType) {
//订单服务订单类型 1=外卖 4=自提,5=堂食
//外卖平台订单类型 1=常规堂食,2=预约堂食,3=常规外送,4=预约外送,5=常规自取,6=预约自取
boolean isAdvance = bizType != null && bizType.compareTo(BizTypeEnum.ADVANCE_ORDER.getBizType()) == 0;
Integer type = 0;
// 预定单 是额外的逻辑 --> 需要走实时单
if (isAdvance) {
switch (orderType) {
case TAKE_OUT:
type = 3;
break;
case COLLECT_GOODS:
type = 5;
break;
case EAT_IN:
type = 1;
break;
case MALL:
type = 3;
break;
default:
break;
}
return type;
}
switch (orderType) {
case TAKE_OUT:
if (gmtExpect == null || gmtExpect == 0L) {
......@@ -2675,7 +2695,7 @@ public class OrderSdkAdapter {
public GroupCreateOrderRequest conventGroupCreateOrderRequest(AssortmentGroupCreateOrderRequest requestVO) {
GroupCreateOrderRequest request = new GroupCreateOrderRequest();
//围餐不存在预约时间
request.setOrderType(requestVO.getOrderType() == null ? 1 : getNewOrderType(requestVO.getOrderType(), null));
request.setOrderType(requestVO.getOrderType() == null ? 1 : getNewOrderType(requestVO.getOrderType(), null, null));
request.setPartnerId(requestVO.getCompanyId());
request.setStoreId(requestVO.getShopId());
request.setOrderClient(requestVO.getOrderClient());
......
......@@ -452,7 +452,7 @@ public class SaasMallOrderService extends UniversalOrderService {
//订单业务类型 1:普通订单 2:虚拟订单
request.setBizType(1);
request.setNote(requestVO.getRemark());
request.setOrderType(orderSdkAdapter.getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect()));
request.setOrderType(orderSdkAdapter.getNewOrderType(requestVO.getOrderType(), requestVO.getGmtExpect(),null));
request.setBarCounter(requestVO.getBarCounter());
//订单market类型
......
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