You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pdd-order-api/app/libs/controller/order/class.OrderPrintController.php

194 lines
7.4 KiB
PHP

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
use Service\Order\OrderMergeService;
use Service\Order\OrderPrintService;
use Service\Order\OrderService;
class OrderPrintController extends AbstractApiController {
private $orderPrintService;
private $orderService;
private $orderMergeService;
public function __construct($route) {
parent::__construct($route);
$this->orderService = OrderService::instance();
$this->orderPrintService = OrderPrintService::instance();
$this->orderMergeService = OrderMergeService::instance();
}
/**
* @api GET 搜索订单列表
* @param string orderPrintTab * tab标签(见字典orderPrintTab)
* @param int[] authMallIds 授权店铺ID数组
* @param string searchTimeType 搜索时间类型orderStartTime下单时间,confirmTime成团时间
* @param string orderStartTime 起始时间
* @param string orderEndTime 结束时间
* @param string goodsSearchType 商品搜索类型goodsInclude/goodsExclude/warehouseAndShelves/goodsShort
* @param string goodsId 商品ID
* @param string goodsName 商品标题
* @param string warehouse 市场
* @param string shelves 档口
* @param string[] skuIds SKU
* @param string skuKeyword sku关键词
* @param string goodsKeyword 商品关键词
* @param string goodsShorts 商品简称
* @param int itemTotalFilterType 商品數量见字典itemTotalFilterType
* @param string orderSn 订单号
* @param string receiverName 收件人
* @param string receiverPhone 手机号
* @param float minOrderSellerPrice 订单金额起
* @param float maxOrderSellerPrice 订单金额止
* @param int logisticsId 物流方式
* @param string waybillCode 物流单号
* @param string keywords 区域搜索关键字
* @param string provinceIds 省份ID逗号拼接
* @param string isCustom 是否自定义区域示例0
* @param string isExclude 区域搜索是否为排除示例0
* @param string buyerMemo 买家备注
* @param string sellerMemo 商家备注
* @param int[] sellerFlag 商家备注标签
* @param int hasBuyerMemo 是否有留言(0/1)
* @param int hasSellerMemo 是否有备注(0/1)
* @param int hasSellerNote 是否有本地备注(0/1)
* @param string pExpressStatus 快递单打印状态(express_printed/express_no_printed)
* @param string pInvoiceStatus 发货单打印状态(invoice_printed/invoice_no_printed)
* @param string sortType 排序方式(见字典orderSortType)
* @param int shipTimeLeftHours 剩余发货时间
* @param string fastSearchOrderFilter 快捷筛选
* @param int page 第几页
* @param int pageSize 每页条数
*/
public function searchOrderList() {
$data = $this->orderPrintService->searchOrderList($_GET, CommonTool::getOperatorInfo());
return $this->renderSuccess($data);
}
/**
* @api POST 修改订单地址
* @param string[] orderIds * 订单id
* @param int provinceAreaId 省份ID
* @param int cityAreaId 城市ID
* @param int countyAreaId 区县ID
* @param string address 详细地址
* @param string mobile 手机号
* @param string fullname 姓名
*/
public function updateTradeAddress() {
$this->orderService->updateTradeAddress($_POST, CommonTool::getOperatorInfo());
return $this->renderSuccess();
}
/**
* @api POST 批量保存本地备注
* @param string[] orderIds * 订单id
* @param string remark * 备注
* @param string flag * 旗帜
* @param int coverOriginal 是否覆盖原备注(0/1)
*/
public function saveBatchSellerMemo() {
$data = $this->orderService->saveBatchSellerMemo($_POST, CommonTool::getOperatorInfo());
return $this->renderSuccess($data);
}
/**
* @api POST 保存商家备注
* @param string[] orderId * 订单id
* @param string remark * 备注
* @param string flag * 旗帜
*/
public function saveSellerMemo() {
$data = $this->orderService->saveSellerMemo($_POST, CommonTool::getOperatorInfo());
return $this->renderSuccess($data);
}
/**
* @api POST 拆分、撤销拆分订单
* @param string orderId * 订单号
* @param string action * 拆分/撤销拆分split/revert
*/
public function revertOrSplitTrades() {
$this->orderMergeService->revertOrSplitTrades($_POST['orderId'], $_POST['action'], $this->mallId);
return $this->renderSuccess();
}
/**
* @api GET 获取可手动合并的订单
* @param string orderId * 订单id
*/
public function getManualMergeOrderList() {
$data = $this->orderMergeService->getManualMergeOrderList($this->mallId, $_POST['orderId']);
return $this->renderSuccess($data);
}
/**
* @api POST 手动合并订单
* @param string masterOrderId * 主订单id
* @param string[] orderIds * 子订单id
*/
public function saveManualMergeOrder() {
$this->orderMergeService->saveManualMergeOrder($this->mallId, $_POST['orderIds'], $_POST['masterOrderId']);
return $this->renderSuccess();
}
/**
* @api POST 批量隔离订单
* @param string[] orderIds * 订单id数组
*/
public function batchSetIsolation() {
$this->orderService->batchSetIsolation($this->mallId, $_POST['orderIds']);
return $this->renderSuccess();
}
/**
* @api POST 批量取消隔离订单
* @param string[] orderIds * 订单id数组
*/
public function batchCancelIsolation() {
$this->orderService->batchCancelIsolation($this->mallId, $_POST['orderIds']);
return $this->renderSuccess();
}
/**
* @api POST 批量保存本地备注
* @param string[] orderIds * 订单id
* @param string note * 备注
* @param int coverOriginal 是否覆盖原备注(0/1)
*/
public function saveBatchSellerNote() {
$data = $this->orderService->saveBatchSellerNote($this->mallId, $_POST['note'], $_POST['orderIds'], $_POST['coverOriginal']);
return $this->renderSuccess($data);
}
/**
* @api POST 快速定位订单
* @param array authMallIds * 授权店铺ID逗号分割示例:16700961 16412356
* @param string keyword * 查询关键词 订单号、采购订单号、物流单号、采购物流单号、收货人姓名、手机号,示例:5001092118842095024
* @param boolean isOrderPrint * 是否打单,示例: 1,0
*/
public function fastPositionOrder(){
$mallIds = $_POST['authMallIds'];
$keyword = trim($_POST['keyword']);
$isOrderPrint = empty($_POST['isOrderPrint']) ? false : true;
$data = $this->orderPrintService->fastPositionOrder($mallIds, $keyword, $isOrderPrint, CommonTool::getOperatorInfo());
return $this->renderSuccess($data);
}
/**
* @api GET 获取当前搜索条件下商品列表(参数同订单列表)
* @param array authMallIds * 授权店铺ID
*/
public function getHotProductList() {
$goodsList = $this->orderPrintService->getHotGoodsList($this->mallId, $_GET);
return $this->renderSuccess(['goodsList' => $goodsList]);
}
/**
* @api GET 获取指定条件下SKU列表
* @param int[] authMallIds 授权店铺id
* @param int goodsId * 商品id
*/
public function getHotSkuList() {
$skuList = $this->orderPrintService->getHotSkuListByGoodsId($this->mallId, $_GET);
return $this->renderSuccess(['skuList' => $skuList]);
}
}