feat : coupon
This commit is contained in:
62
app/Service/Amqp/Refund/PartialRefundOrderService.php
Normal file
62
app/Service/Amqp/Refund/PartialRefundOrderService.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?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\Model\OrderGood;
|
||||
use Exception;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class PartialRefundOrderService extends BaseRefundOrderService
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected int $orderType = OrderCode::ORDER_TYPE_GOOD;
|
||||
|
||||
/**
|
||||
* @var OrderGood
|
||||
*/
|
||||
#[Inject]
|
||||
protected OrderGood $orderGoodModel;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
$this->getOrderInfo();
|
||||
|
||||
$this->checkGoodOrder();
|
||||
|
||||
$this->getPayOrder();
|
||||
|
||||
$this->getRefundAmount();
|
||||
|
||||
$this->insertRefundOrder();
|
||||
|
||||
$this->refund();
|
||||
|
||||
$this->updateRefund();
|
||||
} catch (Exception $e) {
|
||||
$errArr = explode(":", $e->getMessage());
|
||||
$errMsg = $errArr[0];
|
||||
$this->updateError($errMsg);
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user