Merge branch 'develop' of gitee.com:peng-ou/haoka-server into develop

This commit is contained in:
Owen 2025-03-07 09:29:16 +08:00
commit e8e97e4f6d
2 changed files with 26 additions and 8 deletions

View File

@ -81,4 +81,23 @@ public interface OrdersService extends IService<OrdersDO> {
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);
}

View File

@ -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<OrdersMapper, OrdersDO> implements OrdersService {
@Lazy
@Resource
private OrdersServiceImpl ordersService;
private OrdersService ordersService;
@Resource
private OrdersMapper ordersMapper;
@Resource
@ -105,7 +104,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
// 并且根据上游下单结果处理ordersDO
// 最后把 处理后的ordersDO 更新存入数据库
ordersDO = handleOrderCreate(ordersDO);
ordersService.updateOrderById(ordersDO);
updateOrderById(ordersDO);
return orderId;
}
@ -321,7 +320,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> 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<OrdersMapper, OrdersDO> 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<OrdersMapper, OrdersDO> 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<OrdersMapper, OrdersDO> imple
ordersDO.setStatus(-460L);
ordersDO.setUpstreamOrderStatus(-460);
}
ordersService.updateOrderById(ordersDO);
updateOrderById(ordersDO);
}
/**
@ -632,7 +631,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
}
orderOperateLogService.createOrderOperateLog(logSaveReqVO);
// 更新订单
ordersService.updateOrderById(ordersDO);
updateOrderById(ordersDO);
return ordersDO;
}