Pārlūkot izejas kodu

Android部分接口
一些BUG修复与更新

Zhouzhendong 4 gadi atpakaļ
vecāks
revīzija
346d6d0d9b

+ 16 - 0
app/Components/ApiResponse.php

@@ -0,0 +1,16 @@
+<?php
+
+
+namespace App\Components;
+
+
+trait ApiResponse
+{
+    public function response($data, int $code = 200,string $message = null)
+    {
+        $response = ["status_code"=>$code,"data"=>$data,"message"=>$message];
+        header("Content-Type","application/json;charset=utf-8");
+        echo json_encode($response,JSON_UNESCAPED_UNICODE);
+        exit();
+    }
+}

+ 3 - 1
app/Http/ApiControllers/LoginController.php

@@ -23,6 +23,7 @@ class LoginController
      * @apiSuccess {string} message 响应描述
      * @apiSuccess {int} status_code HTTP响应码
      * @apiSuccess {string} data.token 认证token
+     * @apiSuccess {String} data.menu 菜单JSON
      *
      * @apiSuccessExample {json} Success-Response:
      *     HTTP/1.1 200 OK
@@ -30,7 +31,8 @@ class LoginController
      *       "message": "请求成功",
      *       "status_code": "200"
      *       "data":{
-     *             "toke":"token"
+     *             "toke":"token",
+     *             "menu":"{}",
      *        }
      *     }
      */

+ 126 - 1
app/Http/ApiControllers/WaybillController.php

@@ -4,10 +4,135 @@
 namespace App\Http\ApiControllers;
 
 
+use App\Components\ApiResponse;
+use App\Http\Requests\AndroidGateRequest;
+use App\Http\Requests\Api\WaybillDispatch;
+use App\Services\WaybillService;
+use App\Waybill;
+
 class WaybillController
 {
-    public function getData()
+    use ApiResponse;
+
+    /**
+     * @api {get} /waybill/dispatch 获取调度数据
+     * @apiName dispatch
+     * @apiGroup Waybill
+     *
+     * @apiParam {string} search 搜索文本(运单号或物流单号)
+     * @apiParam {string} deliver_at 发货时间
+     * @apiParam {int} page 页数
+     * @apiParam {int} paginate 每页多少
+     *
+     * @apiSuccess {string} message 响应描述
+     * @apiSuccess {int} status_code HTTP响应码
+     * @apiSuccess {array} data 数据列表
+     *
+     * @apiSuccessExample {json} Success-Response:
+     *     HTTP/1.1 200 OK
+     *     {
+     *       "message": "请求成功",
+     *       "status_code": "200"
+     *       "data":[
+     *          {
+     *              "waybill_number"=>"宝时单号",
+     *              "destination"   =>"目的地",
+     *              "recipient"     =>"收件人",
+     *              "recipient_mobile"=>"收件人电话",
+     *              "carrier_bill"=>"承运商单号",
+     *              "carrier_name"=>"承运商",
+     *              "warehouse_weight"=>"预估体积",
+     *              "carrier_weight"=>"实际体积",
+     *              "inquire_tel"=>"查件电话",
+     *              "warehouse_weight_other"=>"预估重量",
+     *              "carrier_weight_other"=>"实际重量",
+     *              "amount"=>"数量",
+     *              "amount_unit_name"=>"数量单位",
+     *              "origination"=>"提货仓"
+     *              "subjoin_fee"=>"附加费"
+     *          }
+     *        ]
+     *     }
+     */
+    public function getData(AndroidGateRequest $request)
+    {
+        $search     = $request->input("search");
+        $deliverAt  = $request->input("deliver_at");
+        $page       = $request->input("page",1);
+        $paginate   = $request->input("paginate",20);
+
+        /** @var WaybillService $service */
+        $service = app("WaybillService");
+        $query = $service->getDispatchQuery();
+        if ($search)$query->where(function ($query)use($search){
+            $query->where("waybill_number","like","%{$search}%")
+                ->orWhere("carrier_bill","like","%{$search}%");
+        });
+        if ($deliverAt)$query->where("deliver_at","like",$deliverAt."%");
+        $this->response($query->paginate($paginate,'*', 'page',$page)->append(["carrier_name","amount_unit_name","remove_relation"]));
+    }
+
+    /**
+     * @api {post} /waybill/dispatch 修改调度信息
+     * @apiName updateDispatch
+     * @apiGroup Waybill
+     *
+     * @apiParam {int} id 唯一码
+     * @apiParam {string} carrier_bill 物流单号
+     * @apiParam {string} inquire_tel 查件电话
+     * @apiParam {int} amount 货品数量
+     * @apiParam {string} amount_unit_name 数量单位(件/托)
+     * @apiParam {number} carrier_weight_other 重量/KG
+     * @apiParam {number} carrier_weight 体积/M³
+     * @apiParam {string} subjoin_fee 附加费描述
+     *
+     * @apiSuccess {string} message 响应描述
+     * @apiSuccess {int} status_code HTTP响应码
+     * @apiSuccess {bool} data 结果
+     *
+     * @apiSuccessExample {json} Success-Response:
+     *     HTTP/1.1 200 OK
+     *     {
+     *       "message": "请求成功",
+     *       "status_code": "200"
+     *       "data":true
+     *     }
+     *
+     */
+    public function dispatch(WaybillDispatch $request)
     {
+        $result = Waybill::query()->where("id",$request->input("id"))
+            ->update($request->validated());
+        if ($result==0)$this->response(false,204,"单据状态发生变化,修改失败");
+        $this->response(true);
+    }
 
+    /**
+     * @api {post} /waybill/dispatch/dailyBilling 修改每日专线费
+     * @apiName dailyBilling
+     * @apiGroup Waybill
+     *
+     * @apiParam {string} deliver_at 发货时间
+     * @apiParam {number} fee 费用
+     *
+     * @apiSuccess {string} message 响应描述
+     * @apiSuccess {int} status_code HTTP响应码
+     * @apiSuccess {bool} data 结果
+     *
+     * @apiSuccessExample {json} Success-Response:
+     *     HTTP/1.1 200 OK
+     *     {
+     *       "message": "请求成功",
+     *       "status_code": "200"
+     *       "data":true
+     *     }
+     */
+    public function dailyBilling(AndroidGateRequest $request)
+    {
+        $deliverAt  = $request->input("deliver_at");
+        $fee        = $request->input("fee");
+        if (!$deliverAt || !$fee || !is_numeric($fee) || !$fee<0)
+            $this->response(false,400,"非法参数或不满足需求");
+        $this->response(true);
     }
 }

+ 9 - 5
app/Http/Controllers/TestController.php

@@ -12,6 +12,7 @@ use App\Components\ErrorPush;
 use App\ErrorTemp;
 use App\Feature;
 use App\Http\ApiControllers\LoginController;
+use App\Http\Requests\AndroidGateRequest;
 use App\Http\Requests\OrderDelivering;
 use App\Jobs\BatchTaskJob;
 use App\Jobs\CacheShelfTaskJob;
@@ -117,7 +118,7 @@ class TestController extends Controller
         $this->data["active_test"] = "active";
     }
 
-    public function method(Request $request, $method)
+    public function method(AndroidGateRequest $request, $method)
     {
         try {
             return call_user_func([$this, $method], $request);
@@ -196,11 +197,14 @@ class TestController extends Controller
         }
         app("BatchService")->assignTasks($batches);
     }
-    public function test()
+    public function test(AndroidGateRequest $request)
     {
-        $a = new LoginController();
-        dd($a->getMenu());
-        dd(config('app.env'));
+        dd(Waybill::query()->with(["order:id,address","logistic:id,name","amountUnit:id,name"])
+            ->select("id","order_id","logistic_id","amount_unit_id",
+                "waybill_number","destination","recipient","recipient_mobile",
+                "carrier_bill","warehouse_weight","carrier_weight","inquire_tel",
+                "warehouse_weight_other","carrier_weight_other","amount","origination")
+            ->paginate(15)->append(["carrier_name","amount_unit_name","remove_relation"])->toJson());
         $url = config('api_logistic.collectUpload.ZTO.prod.url');
         $xAppKey =  config('api_logistic.collectUpload.ZTO.prod.x-appKey');
         $appSecret = config('api_logistic.collectUpload.ZTO.prod.appSecret');

+ 62 - 0
app/Http/Requests/AndroidGateRequest.php

@@ -0,0 +1,62 @@
+<?php
+
+
+namespace App\Http\Requests;
+
+
+use App\Authority;
+use App\Components\ApiResponse;
+use Illuminate\Foundation\Http\FormRequest;
+
+class AndroidGateRequest extends FormRequest
+{
+    use ApiResponse;
+    public function __construct()
+    {
+        parent::__construct();
+    }
+    /**
+     * 通用鉴权
+     *
+     * @return bool
+     */
+    public function authorize():bool
+    {
+        //去除参数
+        $routes = explode("/",ltrim(explode("?",$this->getPathInfo())[0],"/api/"));
+        //去除前缀
+        array_shift($routes);
+        $routeStr = implode("/",$routes);
+        $authorities = app("AuthorityService")->getUserAndroidAuthority();
+        foreach ($authorities as $authority){
+            if ($this->method() != Authority::METHOD[$authority->method])continue;
+            if ($authority->route == $routeStr)return true; //相等
+            if (strpos($authority->route,"*")===false)continue;//无泛匹配符
+            $route = explode("/",$authority->route);
+
+            $crLen = count($routes);
+            $trLen = count($route);
+            if ($crLen<$trLen)continue;
+            if ($crLen>$trLen && $route[$trLen-1]=='*'){
+                $routes = array_slice($routes,0,$trLen);
+                $crLen = $trLen;
+            }
+            if ($crLen!=$trLen)continue;
+            foreach ($route as $index=>$item){
+                if ($item=='*')$route[$index] = $routes[$index];
+            }
+            if (implode("/",$route)==$routeStr)return true;
+        }
+        return false;
+    }
+
+    public function failedAuthorization()
+    {
+        $this->response(false,403,"权限不足");
+    }
+
+    public function rules():array
+    {
+        return [];
+    }
+}

+ 64 - 0
app/Http/Requests/Api/WaybillDispatch.php

@@ -0,0 +1,64 @@
+<?php
+
+
+namespace App\Http\Requests\Api;
+
+
+use App\Http\Requests\AndroidGateRequest;
+use Illuminate\Contracts\Validation\Validator;
+use Illuminate\Validation\Rule;
+use Illuminate\Validation\ValidationException;
+
+class WaybillDispatch extends AndroidGateRequest
+{
+    public function rules():array
+    {
+        return [
+            "id"                    => ["required","integer"],
+            "carrier_bill"          => ["required","string","max:50"],
+            "inquire_tel"           => ["required","string","max:20"],
+            "amount"                => ["required","integer","min:1"],
+            "amount_unit_name"      => ["required",Rule::in(["件","托"])],
+            "carrier_weight_other"  => ["required_without:carrier_weight","numeric","min:0.01"],
+            "carrier_weight"        => ["required_without:carrier_weight_other","numeric","min:0.01"],
+            "subjoin_fee"           => ["nullable","string"],
+        ];
+    }
+
+    public function attributes():array
+    {
+        return [
+            "carrier_bill"          => "物流单号",
+            "inquire_tel"           => "查件电话",
+            "amount"                => "数量",
+            "amount_unit_name"      => "数量单位",
+            "carrier_weight_other"  => "重量",
+            "carrier_weight"        => "体积",
+            "subjoin_fee"           => "附加费",
+        ];
+    }
+
+    /**
+     * Handle a failed validation attempt.
+     *
+     * @param  Validator  $validator
+     * @return void
+     */
+    protected function failedValidation(Validator $validator)
+    {
+        $this->response($validator->errors(),400,"数据校验失败");
+    }
+
+    /**
+     * @throws ValidationException
+     */
+    public function validated():array
+    {
+        $param = $this->validator->validated();
+        $unit = app("UnitService")->getUnit($param["amount_unit_name"]);
+        $param["amount_unit_id"] = $unit->id;
+        unset($param["amount_unit_name"]);
+        unset($param["id"]);
+        return $param;
+    }
+}

+ 13 - 0
app/Interfaces/UserFilter.php

@@ -0,0 +1,13 @@
+<?php
+
+
+namespace App\Interfaces;
+
+
+use Illuminate\Database\Eloquent\Builder;
+
+interface UserFilter
+{
+    function getIdArr(?int $userId):array;
+    function getQuery(?int $userId):Builder;
+}

+ 6 - 0
app/Logistic.php

@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model;
  */use App\Traits\ModelTimeFormat;
 
 use App\Traits\ModelLogChanging;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 use Illuminate\Database\Eloquent\SoftDeletes;
 
 class Logistic extends Model
@@ -42,4 +43,9 @@ class Logistic extends Model
         foreach ($tag as &$t)$t = self::TAGS[$t];
         return implode(",",$tag);
     }
+
+    public function users():BelongsToMany
+    {   //用户
+        return $this->belongsToMany(User::class,"logistic_user","logistic_id","user_id");
+    }
 }

+ 18 - 2
app/Services/LogisticService.php

@@ -2,9 +2,9 @@
 
 namespace App\Services;
 
+use App\Interfaces\UserFilter;
 use App\Logistic;
 use App\OracleBasCustomer;
-use App\Shop;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Support\Facades\Auth;
@@ -13,7 +13,7 @@ use Illuminate\Support\Str;
 use App\Traits\ServiceAppAop;
 
 
-class LogisticService
+class LogisticService implements UserFilter
 {
     use ServiceAppAop;
     protected $modelClass=Logistic::class;
@@ -118,4 +118,20 @@ class LogisticService
         });
     }
 
+    function getIdArr(?int $userId = null): array
+    {
+        if (!$userId)$userId = Auth::id();
+        return array_column($this->getQuery($userId)->get()->toArray(),"id");
+    }
+    function getQuery(?int $userId = null): Builder
+    {
+        if (!$userId)$userId = Auth::id();
+        $query = Logistic::query()->select("id");
+        if (!app("UserService")->checkAdminIdentity($userId)){
+            $query->whereHas("users",function ($query)use($userId){
+                $query->where("id",$userId);
+            });
+        }
+        return $query;
+    }
 }

+ 21 - 1
app/Services/OwnerService.php

@@ -3,6 +3,7 @@
 namespace App\Services;
 
 use App\Authority;
+use App\Interfaces\UserFilter;
 use App\OracleBasCustomer;
 use App\Owner;
 use App\OwnerPriceDirectLogistic;
@@ -24,7 +25,7 @@ use Illuminate\Support\Facades\DB;
 use App\Traits\ServiceAppAop;
 
 
-class OwnerService
+class OwnerService implements UserFilter
 {
     use ServiceAppAop;
     protected $modelClass=Owner::class;
@@ -541,4 +542,23 @@ sql;
         $owner->update(['interval_time'=>$intervalTime]);
         return $owner;
     }
+
+    function getIdArr(?int $userId = null): array
+    {
+        if (!$userId)$userId = Auth::id();
+        return array_column($this->getQuery($userId)->get()->toArray(),"id");
+    }
+    function getQuery(?int $userId = null): Builder
+    {
+        if (!$userId)$userId = Auth::id();
+        $query = Owner::query()->select("id");
+        if (!app("UserService")->checkAdminIdentity($userId)){
+            $query->whereHas("roles",function ($query)use($userId){
+                $query->whereHas("users",function ($query)use($userId){
+                    $query->where("id",$userId);
+                });
+            });
+        }
+        return $query->whereNull("deleted_at");
+    }
 }

+ 1 - 1
app/Services/UserService.php

@@ -45,7 +45,7 @@ class UserService
      *
      * @return bool
      */
-    private function checkAdminIdentity($userId):bool
+    public function checkAdminIdentity(int $userId):bool
     {
         if ($userId == Auth::id())return array_search(Auth::user()["name"],config("users.superAdmin"))!==false;
         /** @var User|\stdClass $user */

+ 17 - 0
app/Services/WaybillService.php

@@ -364,4 +364,21 @@ class WaybillService
         $controller = new WaybillController();
         return $controller->accomplishToWMS($w);
     }
+
+    /**
+     * 获取调度数据
+     *
+     */
+    public function getDispatchQuery():Builder
+    {
+        return Waybill::query()->with(["order:id,address","logistic:id,name","amountUnit:id,name"])
+            ->select("id","order_id","logistic_id","amount_unit_id",
+                "waybill_number","destination","recipient","recipient_mobile",
+                "carrier_bill","warehouse_weight","carrier_weight","inquire_tel",
+                "warehouse_weight_other","carrier_weight_other","amount","origination")->where(function ($query){
+            /** @var Builder $query */
+           $query->whereIn("owner_id",app("OwnerService")->getQuery())
+               ->orWhereIn("logistic_id",app("LogisticService")->getQuery());
+        })->whereNotNull("deliver_at")->whereIn("status",["已审核","待终审"]);
+    }
 }

+ 17 - 0
app/Waybill.php

@@ -177,4 +177,21 @@ column
         return $this->hasOne(OwnerWayBillFeeDetail::class);
     }
 
+    public function getDestinationAttribute($value)
+    {
+        return $this->relations["order"]["address"] ?? $value;
+    }
+    public function getCarrierNameAttribute()
+    {
+        return $this->relations["logistic"]["name"] ?? "";
+    }
+    public function getAmountUnitNameAttribute()
+    {
+        return $this->relations["amountUnit"]["name"] ?? "件";
+    }
+    public function getRemoveRelationAttribute()
+    {
+        $this->unsetRelations();
+        $this->offsetUnset("remove_relation");
+    }
 }

+ 271 - 1
doc/api_data.js

@@ -48,13 +48,20 @@ define({ "api": [
             "optional": false,
             "field": "data.token",
             "description": "<p>认证token</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "data.menu",
+            "description": "<p>菜单JSON</p>"
           }
         ]
       },
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":{\n        \"toke\":\"token\"\n   }\n}",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":{\n        \"toke\":\"token\",\n        \"menu\":\"{}\",\n   }\n}",
           "type": "json"
         }
       ]
@@ -67,5 +74,268 @@ define({ "api": [
         "url": "https://was.baoshi56.com/api/v1/login"
       }
     ]
+  },
+  {
+    "type": "post",
+    "url": "/waybill/dispatch/dailyBilling",
+    "title": "修改每日专线费",
+    "name": "dailyBilling",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "deliver_at",
+            "description": "<p>发货时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "fee",
+            "description": "<p>费用</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "bool",
+            "optional": false,
+            "field": "data",
+            "description": "<p>结果</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":true\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch/dailyBilling"
+      }
+    ]
+  },
+  {
+    "type": "get",
+    "url": "/waybill/dispatch",
+    "title": "获取调度数据",
+    "name": "dispatch",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "search",
+            "description": "<p>搜索文本(运单号或物流单号)</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "deliver_at",
+            "description": "<p>发货时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "page",
+            "description": "<p>页数</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "paginate",
+            "description": "<p>每页多少</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "array",
+            "optional": false,
+            "field": "data",
+            "description": "<p>数据列表</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":[\n     {\n         \"waybill_number\"=>\"宝时单号\",\n         \"destination\"   =>\"目的地\",\n         \"recipient\"     =>\"收件人\",\n         \"recipient_mobile\"=>\"收件人电话\",\n         \"carrier_bill\"=>\"承运商单号\",\n         \"carrier_name\"=>\"承运商\",\n         \"warehouse_weight\"=>\"预估体积\",\n         \"carrier_weight\"=>\"实际体积\",\n         \"inquire_tel\"=>\"查件电话\",\n         \"warehouse_weight_other\"=>\"预估重量\",\n         \"carrier_weight_other\"=>\"实际重量\",\n         \"amount\"=>\"数量\",\n         \"amount_unit_name\"=>\"数量单位\",\n         \"origination\"=>\"提货仓\"\n         \"subjoin_fee\"=>\"附加费\"\n     }\n   ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch"
+      }
+    ]
+  },
+  {
+    "type": "post",
+    "url": "/waybill/dispatch",
+    "title": "修改调度信息",
+    "name": "updateDispatch",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "id",
+            "description": "<p>唯一码</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "carrier_bill",
+            "description": "<p>物流单号</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "inquire_tel",
+            "description": "<p>查件电话</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "amount",
+            "description": "<p>货品数量</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "amount_unit_name",
+            "description": "<p>数量单位(件/托)</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "carrier_weight_other",
+            "description": "<p>重量/KG</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "carrier_weight",
+            "description": "<p>体积/M³</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "subjoin_fee",
+            "description": "<p>附加费描述</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "bool",
+            "optional": false,
+            "field": "data",
+            "description": "<p>结果</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":true\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch"
+      }
+    ]
   }
 ] });

+ 271 - 1
doc/api_data.json

@@ -48,13 +48,20 @@
             "optional": false,
             "field": "data.token",
             "description": "<p>认证token</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "String",
+            "optional": false,
+            "field": "data.menu",
+            "description": "<p>菜单JSON</p>"
           }
         ]
       },
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":{\n        \"toke\":\"token\"\n   }\n}",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":{\n        \"toke\":\"token\",\n        \"menu\":\"{}\",\n   }\n}",
           "type": "json"
         }
       ]
@@ -67,5 +74,268 @@
         "url": "https://was.baoshi56.com/api/v1/login"
       }
     ]
+  },
+  {
+    "type": "post",
+    "url": "/waybill/dispatch/dailyBilling",
+    "title": "修改每日专线费",
+    "name": "dailyBilling",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "deliver_at",
+            "description": "<p>发货时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "fee",
+            "description": "<p>费用</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "bool",
+            "optional": false,
+            "field": "data",
+            "description": "<p>结果</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":true\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch/dailyBilling"
+      }
+    ]
+  },
+  {
+    "type": "get",
+    "url": "/waybill/dispatch",
+    "title": "获取调度数据",
+    "name": "dispatch",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "search",
+            "description": "<p>搜索文本(运单号或物流单号)</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "deliver_at",
+            "description": "<p>发货时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "page",
+            "description": "<p>页数</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "paginate",
+            "description": "<p>每页多少</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "array",
+            "optional": false,
+            "field": "data",
+            "description": "<p>数据列表</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":[\n     {\n         \"waybill_number\"=>\"宝时单号\",\n         \"destination\"   =>\"目的地\",\n         \"recipient\"     =>\"收件人\",\n         \"recipient_mobile\"=>\"收件人电话\",\n         \"carrier_bill\"=>\"承运商单号\",\n         \"carrier_name\"=>\"承运商\",\n         \"warehouse_weight\"=>\"预估体积\",\n         \"carrier_weight\"=>\"实际体积\",\n         \"inquire_tel\"=>\"查件电话\",\n         \"warehouse_weight_other\"=>\"预估重量\",\n         \"carrier_weight_other\"=>\"实际重量\",\n         \"amount\"=>\"数量\",\n         \"amount_unit_name\"=>\"数量单位\",\n         \"origination\"=>\"提货仓\"\n         \"subjoin_fee\"=>\"附加费\"\n     }\n   ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch"
+      }
+    ]
+  },
+  {
+    "type": "post",
+    "url": "/waybill/dispatch",
+    "title": "修改调度信息",
+    "name": "updateDispatch",
+    "group": "Waybill",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "id",
+            "description": "<p>唯一码</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "carrier_bill",
+            "description": "<p>物流单号</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "inquire_tel",
+            "description": "<p>查件电话</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": false,
+            "field": "amount",
+            "description": "<p>货品数量</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "amount_unit_name",
+            "description": "<p>数量单位(件/托)</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "carrier_weight_other",
+            "description": "<p>重量/KG</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "number",
+            "optional": false,
+            "field": "carrier_weight",
+            "description": "<p>体积/M³</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "string",
+            "optional": false,
+            "field": "subjoin_fee",
+            "description": "<p>附加费描述</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "fields": {
+        "Success 200": [
+          {
+            "group": "Success 200",
+            "type": "string",
+            "optional": false,
+            "field": "message",
+            "description": "<p>响应描述</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "int",
+            "optional": false,
+            "field": "status_code",
+            "description": "<p>HTTP响应码</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "bool",
+            "optional": false,
+            "field": "data",
+            "description": "<p>结果</p>"
+          }
+        ]
+      },
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n  \"message\": \"请求成功\",\n  \"status_code\": \"200\"\n  \"data\":true\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "version": "0.0.0",
+    "filename": "app/Http/ApiControllers/WaybillController.php",
+    "groupTitle": "Waybill",
+    "sampleRequest": [
+      {
+        "url": "https://was.baoshi56.com/api/v1/waybill/dispatch"
+      }
+    ]
   }
 ]

+ 1 - 1
doc/api_project.js

@@ -13,7 +13,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-26T05:02:28.154Z",
+    "time": "2021-10-05T06:15:44.245Z",
     "url": "https://apidocjs.com",
     "version": "0.29.0"
   }

+ 1 - 1
doc/api_project.json

@@ -13,7 +13,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-26T05:02:28.154Z",
+    "time": "2021-10-05T06:15:44.245Z",
     "url": "https://apidocjs.com",
     "version": "0.29.0"
   }