SubOrderServiceInterface.php 4.95 KB
Newer Older
1 2 3 4 5 6 7
<?php
/**
 * Created by PhpStorm.
 * User: zhaopeng
 * Date: 2020/9/1
 * Time: 10:09
 */
fuyunnan's avatar
fuyunnan committed
8

9
namespace Meibuyu\Rpc\Service\Interfaces\Order;
10 11 12 13 14 15

interface SubOrderServiceInterface
{

    /**
     * @param int $id
fuyunnan's avatar
fuyunnan committed
16
     * @param array $column 需要查询的字段
17 18 19
     * @param array $relation 需要的子订单关联关系可传入['order','order_product']
     * @return array | null
     */
fuyunnan's avatar
fuyunnan committed
20
    public function getById(int $id, array $column = ['*'], array $relation = []): array;
21 22 23 24 25 26 27 28

    /**
     *
     * @param array $idList 子订单的ID  数组[1,2,3]
     * @param array $column 需要查询字段
     * @param array $relation 需要的关联关系可传入['order','order_product']
     * @return array | null
     */
fuyunnan's avatar
fuyunnan committed
29
    public function getByIdList(array $idList, array $column = ['*'], array $relation = []): array;
30 31 32 33 34 35

    /**
     * @param array $idList 需要改变发货状态的子订单ID数组
     * @param int $status 需要改变的发货状态ID 1 待发货 2 已发货 3 已签收 4 已取消
     * @return bool
     */
fuyunnan's avatar
fuyunnan committed
36
    public function updateSubOrderShipStatus(array $idList, int $status): bool;
37

38 39 40 41 42
    /**
     * 需要改变的子订单id
     * @param int $id
     * @return bool
     */
fuyunnan's avatar
fuyunnan committed
43 44 45 46 47 48 49 50 51 52 53
    public function StockIntoUpdateSubOrderStatus(int $id): bool;

    /**
     * description:通过来源单号获取生产工厂
     * author: fuyunnan
     * @param
     * @return array
     * @throws
     * Date: 2020/10/29
     */
    public function getBySourcesFactory($sources): array;
54

fuyunnan's avatar
fuyunnan committed
55 56 57
    /**
     *
     * @param array $source 来源单号数组
fuyunnan's avatar
fuyunnan committed
58
     * @return array
fuyunnan's avatar
fuyunnan committed
59
     */
fuyunnan's avatar
fuyunnan committed
60
    public function getBySourceSite($source): array;
fuyunnan's avatar
fuyunnan committed
61

zhaopeng343's avatar
zhaopeng343 committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    /**
     * 订单采购完成 修改子订单信息  ---1688采购系统使用
     * @param $data //修改参数数组(二维数组)
     *     参数字段:$data = [
     *        [
     *          'sub_order_no'=>oa子订单编号
     *          'supplier_name'=>供应商,
     *          'purchase_price'=>采购总价,
     *          'platform_order'=>'采购平台订单号',
     *          'domestic_logistics_no'=>物流单号,
     *          'domestic_logistics_price'=>物流价格
     *        ],
     *        [
     *           'sub_order_no'=>oa子订单编号
     *           'supplier_name'=>供应商,
     * 'purchase_price'=>采购总价,
     * 'platform_order'=>'采购平台订单号',
     * 'domestic_logistics_no'=>物流单号,
     * 'domestic_logistics_price'=>物流价格
     * ]
     *      ]
     * @return bool
     */
85
    public function purchaseCompleted($data, $type): bool;
zhaopeng343's avatar
zhaopeng343 committed
86

zhaopeng343's avatar
zhaopeng343 committed
87 88 89 90 91 92
    /**
     * 1688采购异常订单 修改OA子订单状态
     * @param $orderId //oa子订单id
     * @param $errorCode //异常信息 1 取消 2其他
     * @return array
     */
93
    public function purchaseError($orderId, $errorCode): array;
zhaopeng343's avatar
zhaopeng343 committed
94

zhaopeng343's avatar
zhaopeng343 committed
95 96 97 98 99 100
    /**
     * 1688采购取消
     * @param $orderNo
     * @param $editData
     * @return bool
     */
101
    public function purchaseCancel($orderNo, $editData = []): bool;
zhaopeng343's avatar
zhaopeng343 committed
102

zhaopeng343's avatar
zhaopeng343 committed
103 104 105 106
    /**
     * 1688采购 修改oa子订单
     * @param $editData
     * $editData = [
zhaopeng343's avatar
zhaopeng343 committed
107 108
     *           'logistic_no'=>'需要修改的物流单号'
     *           'logistic_no_new'=>'修改后的物流单号',
zhaopeng343's avatar
zhaopeng343 committed
109
     *           'logistic_price'=>'物流费用',
zhaopeng343's avatar
zhaopeng343 committed
110 111 112
     *       ]
     * @return array
     */
113
    public function purchaseEdit($editData): bool;
114

zhaopeng343's avatar
zhaopeng343 committed
115 116 117 118 119 120 121 122
    /**
     * 删除物流信息
     * @param $data =>[
     *          'sub_order_no'=>'子订单号',
     *          'logistic_no'=>'物流单号'
     *       ]
     * @return bool
     */
123
    public function purchaseDelete($data): bool;
zhaopeng343's avatar
zhaopeng343 committed
124

125
    /**
126
     * 通过子订单获取出库信息
127
     * @param array $subOrderNos
128
     * @return array (返回满足出库条件的子订单号以及出库数量 keyBy sub_order_no)
129
     */
130
    public function isOutStockInfo(array $subOrderNos = []):array;
131

132 133 134 135 136
    /**
     * 通过子订单号获取子订单信息
     * @param array $subOrderNos
     * @return array
     */
姜克保's avatar
姜克保 committed
137
    public function getSubOrderInfoByNo(array $subOrderNos = [], array $column = ['sub_order_no','shipping_notes','dispatch_notes','product_specification']): array;
138

秦俊坤's avatar
秦俊坤 committed
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
    /**
     * 获取手动采购对应的成本单价(总成本 + 运费) / 对应的数量
     * @param $subOrderNo
     * @return mixed
     */
    public function getManualPurchaseUnitPriceBySubOrderNo($subOrderNo);

    /**
     *  获取【订单中心-采购入库】对应的成本单价
     * @param $subOrderNo
     * @return mixed
     */
    public function getOrderPurchaseUnitPrice($subOrderNo);

    /**
     * 获取销售退回单价
     * 这里的 orderNo 有可能是主订单的 order_no, 也有可能是子订单的 sub_order_no, 先从
     * @param $orderNo
     * @param $productId
     * @return mixed
     */
    public function getSalesReturnUnitPrice($orderNo, $productId);
161 162 163 164 165 166 167 168

    /**
     * 获取主订单下的所有子订单列表
     *
     * @param string $subOrderNo 子订单号
     * @return mixed
     */
    public function getBySubOrderNo(string $subOrderNo);
169
}