feat : refund

This commit is contained in:
2025-03-27 10:47:31 +08:00
parent 1265bdcce9
commit f9d3511ed6
7 changed files with 128 additions and 23 deletions

View File

@@ -10,6 +10,7 @@ declare(strict_types=1);
namespace App\Service\Amqp\Refund;
use App\Constants\Common\RefundCode;
use App\Event\RefundGoodOrderFinishEvent;
use App\Lib\Log;
use App\Model\Order;
@@ -103,11 +104,23 @@ class RefundGoodOrderFinishService
$this->manageSubCateringLog();
});
if ($this->rollBackStockFlag) {
$this->sendStockMq($this->orderInfo->id,$this->orderInfo->status);
}
$this->eventDispatcher->dispatch(new RefundGoodOrderFinishEvent($this->orderInfo->id, $this->payInfo->id, $this->refundInfo->id));
}
/**
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
private function rollBackStock(): void
{
if (!$this->rollBackStockFlag) return;
//判断是不是用户行为才退库存
if ($this->refundInfo->action_admin_id != 0) return;
$this->sendStockMq($this->orderInfo->id,$this->orderInfo->status);
}
}