mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-28 21:40:50 +00:00
fix(订单取消): 实物取消监听器幂等改查扩展表
中台在事件触发前已标记 canceled,幂等检查改查 normal 扩展表状态(同卡密口径),禁查中台 status_code
This commit is contained in:
parent
9c106bf692
commit
3a93ef5d91
@ -17,6 +17,7 @@ use app\services\order\OrderCenterServices;
|
||||
use app\services\order\OrderLifecycleServices;
|
||||
use crmeb\trade\order\type\OrderTypeAdapterInterface;
|
||||
use crmeb\trade\order\type\OrderTypeRegistry;
|
||||
use modules\product\normal\dao\NormalOrderDao;
|
||||
use modules\product\normal\handler\NormalOrderAdapter;
|
||||
|
||||
/**
|
||||
@ -33,13 +34,14 @@ class OrderCancelListener
|
||||
return;
|
||||
}
|
||||
|
||||
// 确认 normal 类型 + 幂等
|
||||
$centerDao = app(OrderCenterDao::class);
|
||||
$meta = $centerDao->get(['order_no' => $orderNo], ['source_type', 'status_code']);
|
||||
// 确认 normal 类型
|
||||
$meta = app(OrderCenterDao::class)->get(['order_no' => $orderNo], ['source_type']);
|
||||
if (!$meta || ($meta['source_type'] ?? '') !== NormalOrderAdapter::getSourceType()) {
|
||||
return;
|
||||
}
|
||||
if ($meta['status_code'] === 'canceled') {
|
||||
// 中台在事件触发前已标记 canceled,幂等必须检查扩展表(同卡密口径)
|
||||
$source = app(NormalOrderDao::class)->search([], false)->where('order_no', $orderNo)->find();
|
||||
if (!$source || $source['status'] === NormalOrderAdapter::EXT_STATUS_CANCELED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user