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 submitUpStreamStatus(OrdersSaveReqVO updateReqVO);
void changeStatus(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.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; 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 { public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> implements OrdersService {
@Lazy @Lazy
@Resource @Resource
private OrdersServiceImpl ordersService; private OrdersService ordersService;
@Resource @Resource
private OrdersMapper ordersMapper; private OrdersMapper ordersMapper;
@Resource @Resource
@ -105,7 +104,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
// 并且根据上游下单结果处理ordersDO // 并且根据上游下单结果处理ordersDO
// 最后把 处理后的ordersDO 更新存入数据库 // 最后把 处理后的ordersDO 更新存入数据库
ordersDO = handleOrderCreate(ordersDO); ordersDO = handleOrderCreate(ordersDO);
ordersService.updateOrderById(ordersDO); updateOrderById(ordersDO);
return orderId; return orderId;
} }
@ -321,7 +320,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
log.error("提交审核的订单数据:{}", JSON.toJSONString(updateObj)); log.error("提交审核的订单数据:{}", JSON.toJSONString(updateObj));
} }
log.error("更新订单前的数据:{}", JSON.toJSONString(updateObj)); log.error("更新订单前的数据:{}", JSON.toJSONString(updateObj));
ordersService.updateOrderById(updateObj); updateOrderById(updateObj);
// 异步处理 审核成功是否自动进单 // 异步处理 审核成功是否自动进单
Integer autoType = oldOrderDo.getAutoType(); Integer autoType = oldOrderDo.getAutoType();
// 联合条件 自动生产 && 审核通过 && 提交初审 // 联合条件 自动生产 && 审核通过 && 提交初审
@ -456,7 +455,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
Integer autoType = haoKaProduct.getAutoType(); Integer autoType = haoKaProduct.getAutoType();
updateObj.setAutoType(autoType); updateObj.setAutoType(autoType);
ordersService.updateOrderById(updateObj); updateOrderById(updateObj);
Long status = updateObj.getStatus(); Long status = updateObj.getStatus();
// 进入审核流程 // 进入审核流程
log.error("【审核订单开始】,订单状态:{}",status); log.error("【审核订单开始】,订单状态:{}",status);
@ -500,7 +499,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
orderOperateLogService.createOrderOperateLog(logSaveReqVO); orderOperateLogService.createOrderOperateLog(logSaveReqVO);
} }
log.error("【审核订单完成】,订单数据:{}",JSON.toJSONString(updateObj)); log.error("【审核订单完成】,订单数据:{}",JSON.toJSONString(updateObj));
ordersService.updateOrderById(updateObj); updateOrderById(updateObj);
} }
// 如果是抖音订单 则需要调用抖音接口 返回审核结果 // 如果是抖音订单 则需要调用抖音接口 返回审核结果
String source = ordersOld.getSource(); String source = ordersOld.getSource();
@ -565,7 +564,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
ordersDO.setStatus(-460L); ordersDO.setStatus(-460L);
ordersDO.setUpstreamOrderStatus(-460); ordersDO.setUpstreamOrderStatus(-460);
} }
ordersService.updateOrderById(ordersDO); updateOrderById(ordersDO);
} }
/** /**
@ -632,7 +631,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
} }
orderOperateLogService.createOrderOperateLog(logSaveReqVO); orderOperateLogService.createOrderOperateLog(logSaveReqVO);
// 更新订单 // 更新订单
ordersService.updateOrderById(ordersDO); updateOrderById(ordersDO);
return ordersDO; return ordersDO;
} }