增加了手机操作端
This commit is contained in:
144
server-api/app/controller/admin/WarehouseWorkbenchController.php
Normal file
144
server-api/app/controller/admin/WarehouseWorkbenchController.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\support\FulfillmentFlowService;
|
||||
use support\Request;
|
||||
|
||||
class WarehouseWorkbenchController
|
||||
{
|
||||
public function inboundLookup(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->lookupInboundByTrackingNo((string)$request->input('tracking_no', '')));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('入库匹配失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function inboundReceive(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->receiveInbound(
|
||||
(string)$request->input('tracking_no', ''),
|
||||
(string)$request->input('internal_tag_no', ''),
|
||||
$request
|
||||
), '入库完成');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('入库失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function zhongjianLookup(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->lookupZhongjianTransfer((string)$request->input('internal_tag_no', '')));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('中检流转查询失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function zhongjianOutbound(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->zhongjianOutbound((string)$request->input('internal_tag_no', ''), $request), '送检出库完成');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('送检出库失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function zhongjianInbound(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->zhongjianInbound((string)$request->input('internal_tag_no', ''), $request), '送检入库完成');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('送检入库失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function returnLookup(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->lookupReturn((string)$request->input('internal_tag_no', ''), $request));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('寄回查询失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function verifyReturnMaterialTag(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->verifyReturnMaterialTag(
|
||||
(string)$request->input('internal_tag_no', ''),
|
||||
(string)$request->input('qr_input', ''),
|
||||
$request
|
||||
), '验真吊牌已确认');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('验真吊牌确认失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmZhongjianReturn(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->confirmZhongjianReturn((string)$request->input('internal_tag_no', ''), $request), '中检报告已确认');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('中检报告确认失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function shipReturn(Request $request)
|
||||
{
|
||||
try {
|
||||
return api_success($this->service()->shipReturn(
|
||||
(string)$request->input('internal_tag_no', ''),
|
||||
(string)$request->input('express_company', ''),
|
||||
(string)$request->input('tracking_no', ''),
|
||||
$request
|
||||
), '回寄运单已登记');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return api_error($e->getMessage(), 422);
|
||||
} catch (\RuntimeException $e) {
|
||||
return api_error($e->getMessage(), $e->getCode() ?: 404);
|
||||
} catch (\Throwable $e) {
|
||||
return api_error('回寄运单登记失败', 500, ['detail' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
private function service(): FulfillmentFlowService
|
||||
{
|
||||
return new FulfillmentFlowService();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user