Commit 6ac8fa28a71a8b9786319a8e4830df3e3c768d99
Committed by
Gitee
!1374 fix: 修复拼团还没成团,虚拟成团是否,这个时候核销也能核销成功
Merge pull request !1374 from puhui999/master-jdk17-3
Showing
2 changed files
with
15 additions
and
1 deletions
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/ErrorCodeConstants.java
| @@ -39,7 +39,8 @@ public interface ErrorCodeConstants { | @@ -39,7 +39,8 @@ public interface ErrorCodeConstants { | ||
| 39 | ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_011_000_034, "交易订单更新支付订单退款状态失败,原因:退款单不存在"); | 39 | ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_011_000_034, "交易订单更新支付订单退款状态失败,原因:退款单不存在"); |
| 40 | ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_035, "交易订单更新支付订单退款状态失败,原因:退款单状态不是【退款成功】"); | 40 | ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_035, "交易订单更新支付订单退款状态失败,原因:退款单状态不是【退款成功】"); |
| 41 | ErrorCode ORDER_PICK_UP_FAIL_NOT_VERIFY_USER = new ErrorCode(1_011_000_036, "交易订单自提失败,原因:你没有核销该门店订单的权限"); | 41 | ErrorCode ORDER_PICK_UP_FAIL_NOT_VERIFY_USER = new ErrorCode(1_011_000_036, "交易订单自提失败,原因:你没有核销该门店订单的权限"); |
| 42 | - ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_037, "交易订单创建失败,原因:用户积分不足"); | 42 | + ErrorCode ORDER_PICK_UP_FAIL_COMBINATION_NOT_SUCCESS = new ErrorCode(1_011_000_037, "交易订单自提失败,原因:商品拼团记录不是【成功】状态"); |
| 43 | + ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_038, "交易订单创建失败,原因:用户积分不足"); | ||
| 43 | 44 | ||
| 44 | // ========== After Sale 模块 1-011-000-100 ========== | 45 | // ========== After Sale 模块 1-011-000-100 ========== |
| 45 | ErrorCode AFTER_SALE_NOT_FOUND = new ErrorCode(1_011_000_100, "售后单不存在"); | 46 | ErrorCode AFTER_SALE_NOT_FOUND = new ErrorCode(1_011_000_100, "售后单不存在"); |
yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java
| @@ -25,6 +25,9 @@ import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; | @@ -25,6 +25,9 @@ import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; | ||
| 25 | import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; | 25 | import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; |
| 26 | import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi; | 26 | import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi; |
| 27 | import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO; | 27 | import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO; |
| 28 | +import cn.iocoder.yudao.module.promotion.api.combination.CombinationRecordApi; | ||
| 29 | +import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordRespDTO; | ||
| 30 | +import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; | ||
| 28 | import cn.iocoder.yudao.module.system.api.social.SocialClientApi; | 31 | import cn.iocoder.yudao.module.system.api.social.SocialClientApi; |
| 29 | import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; | 32 | import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; |
| 30 | import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; | 33 | import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; |
| @@ -121,6 +124,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | @@ -121,6 +124,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | ||
| 121 | public SocialClientApi socialClientApi; | 124 | public SocialClientApi socialClientApi; |
| 122 | @Resource | 125 | @Resource |
| 123 | public PayRefundApi payRefundApi; | 126 | public PayRefundApi payRefundApi; |
| 127 | + @Resource | ||
| 128 | + private CombinationRecordApi combinationRecordApi; | ||
| 124 | 129 | ||
| 125 | @Resource | 130 | @Resource |
| 126 | private TradeOrderProperties tradeOrderProperties; | 131 | private TradeOrderProperties tradeOrderProperties; |
| @@ -775,6 +780,14 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | @@ -775,6 +780,14 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | ||
| 775 | if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) { | 780 | if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) { |
| 776 | throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP); | 781 | throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP); |
| 777 | } | 782 | } |
| 783 | + // 情况一:如果是拼团订单,则校验拼团是否成功 | ||
| 784 | + if (TradeOrderTypeEnum.isCombination(order.getType())) { | ||
| 785 | + CombinationRecordRespDTO combinationRecord = combinationRecordApi.getCombinationRecordByOrderId( | ||
| 786 | + order.getUserId(), order.getId()); | ||
| 787 | + if (!CombinationRecordStatusEnum.isSuccess(combinationRecord.getStatus())) { | ||
| 788 | + throw exception(ORDER_PICK_UP_FAIL_COMBINATION_NOT_SUCCESS); | ||
| 789 | + } | ||
| 790 | + } | ||
| 778 | DeliveryPickUpStoreDO deliveryPickUpStore = pickUpStoreService.getDeliveryPickUpStore(order.getPickUpStoreId()); | 791 | DeliveryPickUpStoreDO deliveryPickUpStore = pickUpStoreService.getDeliveryPickUpStore(order.getPickUpStoreId()); |
| 779 | if (deliveryPickUpStore == null | 792 | if (deliveryPickUpStore == null |
| 780 | || !CollUtil.contains(deliveryPickUpStore.getVerifyUserIds(), userId)) { | 793 | || !CollUtil.contains(deliveryPickUpStore.getVerifyUserIds(), userId)) { |