diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersService.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersService.java index 1a7bf1dd97..7e4e21b326 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersService.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersService.java @@ -81,4 +81,23 @@ public interface OrdersService extends IService { void submitUpStreamStatus(OrdersSaveReqVO updateReqVO); void changeStatus(OrdersSaveReqVO updateReqVO); + + /** + * 异步执行 + * @param ordersDO + */ + void asyncSubmitAuditOrders(OrdersDO ordersDO); + + /** + * 异步执行 + * @param ordersDO + */ + void asyncAuditOrders(OrdersDO ordersDO); + + /** + * 异步执行 + * @param oldOrderDo + * @param updateObj + */ + void syncDouDian(OrdersDO oldOrderDo, OrdersDO updateObj); } diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java index b99a97e043..d425b127a4 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orders/OrdersServiceImpl.java @@ -34,7 +34,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; -import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; @@ -67,7 +66,7 @@ import static cn.iocoder.yudao.module.haoka.enums.ErrorCodeConstants.*; public class OrdersServiceImpl extends ServiceImpl implements OrdersService { @Lazy @Resource - private OrdersServiceImpl ordersService; + private OrdersService ordersService; @Resource private OrdersMapper ordersMapper; @Resource @@ -105,7 +104,7 @@ public class OrdersServiceImpl extends ServiceImpl imple // 并且根据上游下单结果处理ordersDO // 最后把 处理后的ordersDO 更新存入数据库 ordersDO = handleOrderCreate(ordersDO); - ordersService.updateOrderById(ordersDO); + updateOrderById(ordersDO); return orderId; } @@ -321,7 +320,7 @@ public class OrdersServiceImpl extends ServiceImpl imple log.error("提交审核的订单数据:{}", JSON.toJSONString(updateObj)); } log.error("更新订单前的数据:{}", JSON.toJSONString(updateObj)); - ordersService.updateOrderById(updateObj); + updateOrderById(updateObj); // 异步处理 审核成功是否自动进单 Integer autoType = oldOrderDo.getAutoType(); // 联合条件: 自动生产 && 审核通过 && 提交初审 @@ -456,7 +455,7 @@ public class OrdersServiceImpl extends ServiceImpl imple Integer autoType = haoKaProduct.getAutoType(); updateObj.setAutoType(autoType); - ordersService.updateOrderById(updateObj); + updateOrderById(updateObj); Long status = updateObj.getStatus(); // 进入审核流程 log.error("【审核订单开始】,订单状态:{}",status); @@ -500,7 +499,7 @@ public class OrdersServiceImpl extends ServiceImpl imple orderOperateLogService.createOrderOperateLog(logSaveReqVO); } log.error("【审核订单完成】,订单数据:{}",JSON.toJSONString(updateObj)); - ordersService.updateOrderById(updateObj); + updateOrderById(updateObj); } // 如果是抖音订单 则需要调用抖音接口 返回审核结果 String source = ordersOld.getSource(); @@ -565,7 +564,7 @@ public class OrdersServiceImpl extends ServiceImpl imple ordersDO.setStatus(-460L); ordersDO.setUpstreamOrderStatus(-460); } - ordersService.updateOrderById(ordersDO); + updateOrderById(ordersDO); } /** @@ -632,7 +631,7 @@ public class OrdersServiceImpl extends ServiceImpl imple } orderOperateLogService.createOrderOperateLog(logSaveReqVO); // 更新订单 - ordersService.updateOrderById(ordersDO); + updateOrderById(ordersDO); return ordersDO; }