|
|
<?php
|
|
|
|
|
|
use Service\Order\OrderSendService;
|
|
|
|
|
|
class OrderSendController extends AbstractApiController {
|
|
|
private $orderSendService;
|
|
|
|
|
|
public function __construct($route) {
|
|
|
parent::__construct($route);
|
|
|
$this->orderSendService = OrderSendService::instance();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @api GET 导入模板下载
|
|
|
*/
|
|
|
public function downloadOutstorageTpl() {
|
|
|
$this->orderSendService->downloadOutstorageTpl();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @api POST 导入发货
|
|
|
* @param int isCoverOldLogistics 已出库则修改快递单号(1-是/0-否)
|
|
|
* @param File orderLogisticsTpl * 导入订单模板
|
|
|
* @param int logistics 默认快递公司
|
|
|
*/
|
|
|
public function uploadOrderOutstorage() {
|
|
|
$isCoverOldLogistics = !empty($_POST['isCoverOldLogistics']);
|
|
|
$file = CommonTool::uploadFileSafe('orderLogisticsTpl');
|
|
|
$data = $this->orderSendService->uploadOrderOutstorage($this->mallId, $file, $_POST['logistics'], $isCoverOldLogistics);
|
|
|
return $this->renderSuccess($data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @api GET 查询发货历史
|
|
|
* @param array authMallIds 店铺ID数组
|
|
|
* @param string orderStartTime 开始时间
|
|
|
* @param string orderEndTime 结束时间
|
|
|
* @param string orderSn 订单编号
|
|
|
* @param string waybillCodes 运单号
|
|
|
* @param int logisticsId 物流id
|
|
|
* @param string status 发货状态
|
|
|
* @param int onlyManualDeliveryLog 是否手动发货
|
|
|
* @param int taskId 任务ID
|
|
|
* @param int page 页码
|
|
|
* @param int pageSize 每页数量
|
|
|
*/
|
|
|
public function searchOutstorageLogList() {
|
|
|
$data = $this->orderSendService->searchOrderOutstorageHistoryList($this->mallId, $_GET);
|
|
|
return $this->renderSuccess($data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @api GET 导入发货记录
|
|
|
* @param int page 页码
|
|
|
* @param int pageSize 每页数量
|
|
|
*/
|
|
|
public function searchImportOutstorageTask() {
|
|
|
$data = $this->orderSendService->searchOrderOutstorageTaskList($this->mallId, $_GET);
|
|
|
return $this->renderSuccess($data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @api GET 批量发货进度
|
|
|
* @param int taskId * 导入发货任务ID
|
|
|
* @param string lastCheckTime 上次检查时间
|
|
|
*/
|
|
|
public function checkUploadOrderOutstorageTask() {
|
|
|
$taskId = $_GET['taskId'];
|
|
|
$lastCheckTime = $_GET['lastCheckTime'];
|
|
|
$data = $this->orderSendService->checkUploadOrderOutstorageTask($this->mallId, $taskId, $lastCheckTime);
|
|
|
return $this->renderSuccess($data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @api GET 获取正在执行的导入发货任务
|
|
|
*/
|
|
|
public function getProcessingTask() {
|
|
|
$processingTask = $this->orderSendService->getMallProcessingTask($this->mallId);
|
|
|
return $this->renderSuccess(['processingTask' => $processingTask]);
|
|
|
}
|
|
|
} |