Просмотр исходного кода

调整支付成功后跑腿订单生成代码位置

codingliang 1 год назад
Родитель
Сommit
87d1094990

+ 15 - 16
src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java

@@ -625,6 +625,21 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             // 如果是支付宝或者微信支付,用户钱包新增消费记录
             addConsumeRecordInUserMoneyDetail(order);
 
+            // 已接单状态的订单生成跑腿订单
+            if (order.getStatus() == 6) {
+                // 如果是外卖订单,则生成一个跑腿的订单
+                tbIndentService.insertIndent(order);
+
+                // 发送商家接单通知
+                MyGlobalThreadPool.execute(() -> {
+                    try {
+                        sendOrderAcceptMessage(order, goodsShop, mpPushConfig, userEntity);
+                    } catch (Exception e) {
+                        log.error("订单:{},商家接单通知发送失败,失败原因:{}", order.getOrderId(), e);
+                    }
+                });
+            }
+
             // 在锁中提交事务
             transactionManager.commit(status);
         } catch (Exception e) {
@@ -646,22 +661,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             }
         });
 
-        // 已接单状态的订单生成跑腿订单
-        if (order.getStatus() == 6) {
-            // 如果是外卖订单,则生成一个跑腿的订单
-            tbIndentService.insertIndent(order);
-
-            // 发送商家接单通知
-            MyGlobalThreadPool.execute(() -> {
-                try {
-                    sendOrderAcceptMessage(order, goodsShop, mpPushConfig, userEntity);
-                } catch (Exception e) {
-                    log.error("订单:{},商家接单通知发送失败,失败原因:{}", order.getOrderId(), e);
-                }
-            });
-
-        }
-
         // 订单已接单或者当前订单为预约订单时打印小票
         if (order.getStatus() == 6 || reservationFlag) {
             // 打印小票