feat(haichao): 新增聚水潭ERP集成功能
- 新增聚水潭回调接口及事件处理机制 - 添加聚水潭商品、订单、售后同步任务 - 实现聚水潭订单推送及售后状态同步 - 新增手动同步聚水潭商品功能 - 在各路由组添加聚水潭中间件支持
This commit is contained in:
@@ -39,6 +39,8 @@ use Joypack\Tencent\Map\Bundle\LocationOption;
|
||||
use app\Request;
|
||||
use crmeb\services\CacheService;
|
||||
use crmeb\services\UploadService;
|
||||
use think\facade\Log;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 公共类
|
||||
@@ -131,6 +133,22 @@ class PublicController
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
public function jstCallback(Request $request)
|
||||
{
|
||||
$data = json_decode((string)$request->getContent(), true);
|
||||
if (!is_array($data)) {
|
||||
$data = $request->param();
|
||||
}
|
||||
$actionCode = $data['action_code'] ?? ($request->param('action_code') ?: '');
|
||||
Log::info('jst.api.callback ' . $actionCode);
|
||||
if ($actionCode === 'business_sku_syn') (new \app\haichao\callback\event\JstProductEvent())->event($request);
|
||||
if ($actionCode === 'sync_shipped') (new \app\haichao\callback\event\JstOrderPostEvent())->event($request);
|
||||
if ($actionCode === 'orderPost') (new \app\haichao\callback\event\JstOrderPostEvent())->event($request);
|
||||
if ($actionCode === 'orderRefund') (new \app\haichao\callback\event\JstOrderRefundEvent())->event($request);
|
||||
if ($actionCode === 'trade_after_sale') (new \app\haichao\callback\event\JstTradeEvent())->event($request);
|
||||
return Response::create(['code' => 0, 'msg' => 'ok'], 'json');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人中心菜单
|
||||
* @param Request $request
|
||||
|
||||
Reference in New Issue
Block a user