feat : spu

This commit is contained in:
2025-03-25 15:54:34 +08:00
parent e25e6cc94b
commit 377f780ab5
12 changed files with 619 additions and 41 deletions

View File

@@ -0,0 +1,63 @@
<?php
/**
* This service file is part of item.
*
* @author ctexthuang
* @contact ctexthuang@qq.com
*/
declare(strict_types=1);
namespace App\Service\Amqp\Refund;
use App\Constants\Common\OrderCode;
use App\Service\ServiceTrait\Api\CateringTrait;
use App\Service\ServiceTrait\Api\CouponTrait;
use App\Service\ServiceTrait\Api\OrderTrait;
use App\Service\ServiceTrait\Api\RefundOrderTrait;
use Hyperf\DbConnection\Db;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class RefundGoodOrderFinishService
{
use RefundOrderTrait;
use CateringTrait;
use CouponTrait;
use OrderTrait;
/**
* @var string
*/
public string $orderSno;
/**
* @var int
*/
public int $payType;
/**
* @var int
*/
public int $orderType;
/**
* @return void
*/
public function handle(): void
{
$this->checkRefundOrder();
Db::transaction(function (){
$this->manageRefundOrder();
$this->manageOrderByRefund();
$this->manageSubCateringLog();
if ($this->orderInfo->coupin_id > 0) $this->rollbackCoupon(OrderCode::ORDER_TYPE_GOOD,$this->orderInfo);
});
// $this->sendStockMq($this->orderInfo->id,$this->orderInfo->status);
}
}