浏览代码

一些微小的修复

Zhouzhendong 4 年之前
父节点
当前提交
bedf26902f
共有 3 个文件被更改,包括 11 次插入12 次删除
  1. 8 9
      app/Http/ApiControllers/InventoryController.php
  2. 2 2
      app/Services/AndroidInventoryService.php
  3. 1 1
      routes/api.php

+ 8 - 9
app/Http/ApiControllers/InventoryController.php

@@ -5,17 +5,16 @@ namespace App\Http\ApiControllers;
 
 
 use App\Components\ApiResponse;
-use App\Http\Requests\AndroidGateRequest;
 use App\InventoryAccount;
 use App\Services\AndroidInventoryService;
-use Illuminate\Support\Facades\Auth;
+use Illuminate\Http\Request;
 
 class InventoryController
 {
     use ApiResponse;
 
     /**
-     * @api {get} /inventory/inventoryTasks 获取盘点任务数据
+     * @api {get} /inventory/inventoryTask 获取盘点任务数据
      * @apiName inventoryTasks
      * @apiGroup inventory
      *
@@ -45,14 +44,14 @@ class InventoryController
      *          },
      *          "notStocktakingList"=> [
      *            {
-     *              "id" =>"盘点任务明细号",
      *              "location"   =>"库位",
+     *              "count"   =>"未盘商品数",
      *             }
      *           ]
      *        ]
      *     }
      */
-    public function getInventoryTask(AndroidGateRequest $request)
+    public function getInventoryTask(Request $request)
     {
         $taskId = $request->input("taskId");
         /** @var AndroidInventoryService $service */
@@ -90,7 +89,7 @@ class InventoryController
      *           }
      *     }
      */
-    public function locationInvPro(AndroidGateRequest $request)
+    public function locationInvPro(Request $request)
     {
         $taskId = $request->input("taskId");
         $location = $request->input("location");
@@ -128,7 +127,7 @@ class InventoryController
      *           }
      *     }
      */
-    public function getInventoryDetail(AndroidGateRequest $request)
+    public function getInventoryDetail(Request $request)
     {
         $taskId = $request->input("taskId");
         $location = $request->input("location");
@@ -169,7 +168,7 @@ class InventoryController
      *        ]
      *     }
      */
-    public function stockInventory(AndroidGateRequest $request)
+    public function stockInventory(Request $request)
     {
         $taskId = $request->input("taskId");
         $location = $request->input("location");
@@ -211,7 +210,7 @@ class InventoryController
      *        ]
      *     }
      */
-    public function skipInventory(AndroidGateRequest $request)
+    public function skipInventory(Request $request)
     {
         $inventoryDetailId = $request->input("inventoryDetailId");
         /** @var AndroidInventoryService $service */

+ 2 - 2
app/Services/AndroidInventoryService.php

@@ -18,9 +18,9 @@ class AndroidInventoryService
     public function getUnInventoryTaskList($taskId)
     {
         return  InventoryAccountMission::query()
-            ->select('id','location')
+            ->select('location')->selectRaw("count(*) count")
             ->where('inventory_account_id', $taskId)
-            ->where('checked', '否')
+            ->where('checked', '否')->groupBy("location")
             ->get();
     }
     //根据员工姓名获取当日盘点行数

+ 1 - 1
routes/api.php

@@ -33,7 +33,7 @@ Route::prefix("v1")->group(function (){
                 Route::GET('batchRecover', 'OrderController@recoverBatch');
             });
             Route::prefix("inventory")->group(function () {
-                Route::POST('inventoryTask', 'InventoryController@getInventoryTask');
+                Route::get('inventoryTask', 'InventoryController@getInventoryTask');
                 Route::POST('locationInvPro', 'InventoryController@locationInvPro');
                 Route::POST('getInventoryDetail', 'InventoryController@getInventoryDetail');
                 Route::POST('stockInventory', 'InventoryController@stockInventory');