Browse Source
Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix
Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix
* 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf: 订单优惠券使用校验、用户订单操作调整 用户订单详情 撒大苏打撒 配送费 临时提交改用global_order_id 确认订单 增值服务text 确认订单master
48 changed files with 606 additions and 499 deletions
-
6app/Constants/v3/ErrorCode.php
-
10app/Constants/v3/LogLabel.php
-
113app/Controller/TestController.php
-
149app/Controller/v3/NotifyController.php
-
25app/Controller/v3/OrderOnlineController.php
-
10app/Controller/v3/ShopCartUpdateController.php
-
4app/Controller/v3/UserAddressController.php
-
87app/JsonRpc/OrderOnlineService.php
-
8app/JsonRpc/OrderOnlineServiceInterface.php
-
83app/JsonRpc/OrderService.php
-
10app/JsonRpc/SeparateAccountsServiceInterface.php
-
28app/JsonRpc/SeparateaccountsService.php
-
2app/Middleware/Auth/UserMiddleware.php
-
3app/Model/v3/Goods.php
-
3app/Model/v3/GoodsActivity.php
-
2app/Model/v3/Order.php
-
2app/Request/v3/OrderOnlineDetailRequest.php
-
2app/Request/v3/OrderOnlineStateRequest.php
-
2app/Service/v3/Implementations/ActivityService.php
-
10app/Service/v3/Implementations/CouponRebateService.php
-
10app/Service/v3/Implementations/CouponService.php
-
24app/Service/v3/Implementations/DeliveryMoneyService.php
-
6app/Service/v3/Implementations/DeviceService.php
-
24app/Service/v3/Implementations/DistributionPriceService.php
-
4app/Service/v3/Implementations/FeiePrintService.php
-
4app/Service/v3/Implementations/GoodsActivityService.php
-
14app/Service/v3/Implementations/MiniprogramService.php
-
8app/Service/v3/Implementations/MqttService.php
-
7app/Service/v3/Implementations/OrderOfflineService.php
-
154app/Service/v3/Implementations/OrderOnlineService.php
-
59app/Service/v3/Implementations/PaymentService.php
-
29app/Service/v3/Implementations/SeparateAccountsService.php
-
38app/Service/v3/Implementations/ShopCartUpdateService.php
-
41app/Service/v3/Implementations/UserAddressService.php
-
18app/Service/v3/Implementations/UserService.php
-
8app/Service/v3/Interfaces/CouponServiceInterface.php
-
10app/Service/v3/Interfaces/DeliveryMoneyServiceInterface.php
-
2app/Service/v3/Interfaces/DistributionPriceServiceInterface.php
-
8app/Service/v3/Interfaces/MiniprogramServiceInterface.php
-
2app/Service/v3/Interfaces/OrderOfflineServiceInterface.php
-
38app/Service/v3/Interfaces/OrderOnlineServiceInterface.php
-
2app/Service/v3/Interfaces/PaymentServiceInterface.php
-
12app/Service/v3/Interfaces/SeparateAccountsServiceInterface.php
-
2app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php
-
2app/Service/v3/Interfaces/UserAddressServiceInterface.php
-
16app/Service/v3/Interfaces/UserServiceInterface.php
-
1config/autoload/wechat.php
-
3config/routes.php
@ -1,87 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
namespace App\JsonRpc; |
|
||||
|
|
||||
use App\Commons\Log; |
|
||||
use App\Constants\v3\ErrorCode; |
|
||||
use App\Exception\ErrorCodeException; |
|
||||
use App\Service\v3\Interfaces\SeparateAccountsServiceInterface; |
|
||||
use Hyperf\DbConnection\Db; |
|
||||
use Hyperf\RpcServer\Annotation\RpcService; |
|
||||
use Hyperf\Di\Annotation\Inject; |
|
||||
use App\Constants\v3\LogLabel; |
|
||||
|
|
||||
/** |
|
||||
* @RpcService(name="OrderOnlineService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="") |
|
||||
*/ |
|
||||
class OrderOnlineService implements OrderOnlineServiceInterface |
|
||||
{ |
|
||||
|
|
||||
/** |
|
||||
* @Inject |
|
||||
* @var Log |
|
||||
*/ |
|
||||
protected $log; |
|
||||
|
|
||||
/** |
|
||||
* @Inject |
|
||||
* @var \App\Service\v3\Interfaces\OrderOnlineServiceInterface |
|
||||
*/ |
|
||||
protected $orderOnlineService; |
|
||||
|
|
||||
/** |
|
||||
* @Inject |
|
||||
* @var SeparateAccountsServiceInterface |
|
||||
*/ |
|
||||
protected $separateAccountsService; |
|
||||
|
|
||||
public function onlineComplete($orderMainId, $userId) |
|
||||
{ |
|
||||
Db::beginTransaction(); |
|
||||
try { |
|
||||
|
|
||||
$this->orderOnlineService->doComplete($orderMainId, $userId); |
|
||||
$this->separateAccountsService->orderOnlineCompleted($orderMainId, $userId); |
|
||||
|
|
||||
Db::commit(); |
|
||||
return [ |
|
||||
"status" => 200, |
|
||||
"code" => 0, |
|
||||
"result" => [], |
|
||||
"message" => '调用成功' |
|
||||
]; |
|
||||
} catch (\Exception $e) { |
|
||||
|
|
||||
Db::rollBack(); |
|
||||
$this->log->event(LogLabel::ORDER_COMPLETE_LOG, ['exception' => $e->getMessage()]); |
|
||||
throw new ErrorCodeException(ErrorCode::ORDER_COMPLETE_FAIL, $e->getMessage()); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 线上订单退款 |
|
||||
* 申请退款 state = 8 |
|
||||
* 退款成功 state = 9 |
|
||||
*/ |
|
||||
public function onlineRefund($global_order_id){ |
|
||||
$result = [ |
|
||||
"status" => 200, |
|
||||
"code" => ErrorCode::ORDER_FAILURE, |
|
||||
"result" => [], |
|
||||
"message" => '' |
|
||||
]; |
|
||||
|
|
||||
$res = $this->orderOnlineService->onlineRefund($global_order_id); |
|
||||
if($res['code'] > 0){ |
|
||||
$result['result'] = $res; |
|
||||
$result['message'] = '退款失败'; |
|
||||
}else{ |
|
||||
$result['code'] = 0; |
|
||||
$result['result'] = $res; |
|
||||
$result['message'] = '退款成功'; |
|
||||
}; |
|
||||
|
|
||||
return $result; |
|
||||
} |
|
||||
} |
|
||||
@ -1,8 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
namespace App\JsonRpc; |
|
||||
|
|
||||
interface OrderOnlineServiceInterface |
|
||||
{ |
|
||||
public function onlineComplete($orderMainId, $userId); |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
|
|
||||
namespace App\JsonRpc; |
|
||||
|
|
||||
|
|
||||
interface SeparateAccountsServiceInterface |
|
||||
{ |
|
||||
public function orderOnlineCompleted($orderMainId, $userId); |
|
||||
} |
|
||||
@ -1,28 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
|
|
||||
namespace App\JsonRpc; |
|
||||
|
|
||||
use Hyperf\RpcServer\Annotation\RpcService; |
|
||||
|
|
||||
use Hyperf\Di\Annotation\Inject; |
|
||||
/** |
|
||||
* @RpcService(name="SeparateaccountsService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="") |
|
||||
* Class SeparateAccountsService |
|
||||
* @package App\JsonRpc |
|
||||
*/ |
|
||||
class SeparateaccountsService implements SeparateAccountsServiceInterface |
|
||||
{ |
|
||||
/** |
|
||||
* @Inject |
|
||||
* @var \App\Service\v3\Interfaces\SeparateAccountsServiceInterface |
|
||||
*/ |
|
||||
private $separateaccountsService; |
|
||||
|
|
||||
public function orderOnlineCompleted($orderMainId, $userId) |
|
||||
{ |
|
||||
// TODO: Implement orderOnlineCompleted() method.
|
|
||||
return $this->separateaccountsService->orderOnlineCompleted($orderMainId, $userId); |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
@ -1,24 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
namespace App\Service\v3\Implementations; |
|
||||
|
|
||||
use App\Service\v3\Interfaces\DeliveryMoneyServiceInterface; |
|
||||
|
|
||||
class DeliveryMoneyService implements DeliveryMoneyServiceInterface |
|
||||
{ |
|
||||
|
|
||||
public function do($lat, $lng) |
|
||||
{ |
|
||||
return 5.0; |
|
||||
} |
|
||||
|
|
||||
public function check() |
|
||||
{ |
|
||||
// TODO: Implement check() method.
|
|
||||
} |
|
||||
|
|
||||
public function undo() |
|
||||
{ |
|
||||
// TODO: Implement undo() method.
|
|
||||
} |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
<?php |
|
||||
|
|
||||
namespace App\Service\v3\Interfaces; |
|
||||
|
|
||||
interface DeliveryMoneyServiceInterface |
|
||||
{ |
|
||||
public function do($lat, $lng); |
|
||||
public function check(); |
|
||||
public function undo(); |
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue