Commit a1954f59 by 查志伟

会员合并后支持退历史订单

parent 8866fd31
......@@ -1922,7 +1922,12 @@ public class OrderServiceImpl implements Orderservice {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "订单信息不存在");
}
if (!memberId.equals(orderByIdResponseDto.getData().getUserId())) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "不能操作非本人的订单");
// 会员合并之后,多个渠道的会员id合并为一个,这个时候session中的memberId就可能会和历史订单中的userId不一致,导致不能退款
// 这里如果发现会员id不一致,就去查询会员合并数据,重新匹配一下
// 不要在外面查, 大部分情况不会进这个if, 不影响通常逻辑下的tps
List<String> memberIds = memberInfoManager.getMemberAllIds(partnerId, memberId);
if (! memberIds.contains(orderByIdResponseDto.getData().getUserId()))
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "不能操作非本人的订单");
}
OrderBeanV1 orderBean = orderByIdResponseDto.getData();
......@@ -1959,44 +1964,6 @@ public class OrderServiceImpl implements Orderservice {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "订单配送中,退款请联系售后!");
}
// coco 商户校验
// if (cocoPartnerId.contains(orderByIdResponseDto.getData().getCompanyId())) {
// // COCO 即时单不可取消
// if (NewOrderType.GENERAL_SELF_PICKUP.getCode().equals(queryOrderByIdResponse.getData().getNewOrderType())) {
// return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND);
// }
// // 4,6 预约单
// List<Integer> expectOrderType = Lists.newArrayList(
// NewOrderType.RESERVED_EXPRESS.getCode(),
// NewOrderType.RESERVED_SELF_PICKUP.getCode());
// long time = DateUtil.addMinutes(new Date(), 15).getTime();
//
// // 外卖单
// List<Integer> takeOrderType = Lists.newArrayList(
// NewOrderType.RESERVED_EXPRESS.getCode(),
// NewOrderType.GENERAL_EXPRESS.getCode());
// long taskCancelOrderTime = DateUtil.addMinutes(new Date(), 30).getTime();
// if (takeOrderType.contains(queryOrderByIdResponse.getData().getNewOrderType())
// && Objects.nonNull(queryOrderByIdResponse.getData().getEstimateDeliveryCompleteTime())
// && taskCancelOrderTime > queryOrderByIdResponse.getData().getEstimateDeliveryCompleteTime()) {
// return ResponseUtil.error(ResponseResult.ORDER_CANCEL_ERROR_ESTIMATE_TIME);
// }
// if (expectOrderType.contains(queryOrderByIdResponse.getData().getNewOrderType())) {
// if (Objects.nonNull(orderBean.getGmtExpect())
// && time > orderBean.getGmtExpect()) {
// return ResponseUtil.error(ResponseResult.ORDER_CANCEL_ERROR_EXPECT_TIME);
// }
// // todo coco 预约单直接退款
// BaseResponse baseResponse = partnerNoTakeOrder(orderRefundVo, orderBean, orderId, AfterSalesType.USER_CANCEL, true);
// if (baseResponse != null) {
// return baseResponse;
// }
// // 删除订单 通知活动添加商品库存
// orderQueueService.backOrdersStatusChange(orderBean.getOid(), orderBean.getStatus(), orderBean.getPayStatus());
// return ResponseUtil.success();
// }
//
// }
// fisherman 预定单前置校验-> bizType=7
if (BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(orderBean.getBizType()) == 0) {
// 预定时间 前一天都可退款
......
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