|
|
@@ -24,6 +24,9 @@ class InventoryController
|
|
|
* @apiSuccess {string} message 响应描述
|
|
|
* @apiSuccess {int} status_code HTTP响应码
|
|
|
* @apiSuccess {array} data 数据列表
|
|
|
+ * @apiSuccess {int} data.sameDayInventoryCount 员工当日盘点数
|
|
|
+ * @apiSuccess {int} data.stocktakingTask 当前盘点任务信息
|
|
|
+ * @apiSuccess {int} data.notStocktakingList 未盘任务列表
|
|
|
*
|
|
|
* @apiSuccessExample {json} Success-Response:
|
|
|
* HTTP/1.1 200 OK
|
|
|
@@ -31,27 +34,19 @@ class InventoryController
|
|
|
* "message": "请求成功",
|
|
|
* "status_code": "200"
|
|
|
* "data":[
|
|
|
- * inventoryTask => {
|
|
|
+ * "sameDayInventoryCount" => 0,
|
|
|
+ * "inventoryTask" => {
|
|
|
* "id" =>"盘点任务号",
|
|
|
* "created_at" =>"任务创建时间",
|
|
|
* "end_at" =>"库位最后操作时间",
|
|
|
* "type"=>"任务类型",
|
|
|
* "total"=>"盘点任务数",
|
|
|
* "processed"=>"盘点数",
|
|
|
- * }
|
|
|
- * inventoryTaskDetails=> [
|
|
|
+ * },
|
|
|
+ * "notStocktakingList"=> [
|
|
|
* {
|
|
|
* "id" =>"盘点任务明细号",
|
|
|
* "location" =>"库位",
|
|
|
- * "commodity_id" =>"商品id",
|
|
|
- * "produced_at"=>"生产日期",
|
|
|
- * "valid_at"=>"失效日期",
|
|
|
- * "stored_at"=>"入库日期",
|
|
|
- * "batch_number"=>"批号",
|
|
|
- * "erp_type_position"=>"属性仓",
|
|
|
- * "quality"=>"质量状态",
|
|
|
- * "stored_amount"=>"库存数量",
|
|
|
- * "verified_amount"=>"盘点数量",
|
|
|
* }
|
|
|
* ]
|
|
|
* ]
|
|
|
@@ -62,13 +57,12 @@ class InventoryController
|
|
|
$taskId = $request->input("taskId");
|
|
|
/** @var AndroidInventoryService $service */
|
|
|
$service=app('AndroidInventoryService');
|
|
|
- $inventoryTask = InventoryAccount::query()->find($taskId);
|
|
|
- $inventoryTaskDetails=$service->getUnInventoryTaskList($taskId);
|
|
|
- $staffName = Auth::user()['name'];
|
|
|
+ $stocktakingTask = InventoryAccount::query()->find($taskId);
|
|
|
+ $notStocktakingList=$service->getUnInventoryTaskList($taskId);
|
|
|
$sameDayInventoryCount=$service->getStaffSameDayInvCount();
|
|
|
- $this->response(['inventoryTask' => $inventoryTask,
|
|
|
- 'inventoryTaskDetails' => $inventoryTaskDetails,
|
|
|
- 'staffName'=>$staffName,'sameDayInventoryCount'=>$sameDayInventoryCount
|
|
|
+ $this->response(['stocktakingTask' => $stocktakingTask,
|
|
|
+ 'notStocktakingList' => $notStocktakingList,
|
|
|
+ 'sameDayInventoryCount'=>$sameDayInventoryCount
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -125,15 +119,12 @@ class InventoryController
|
|
|
* "data":{
|
|
|
* "id" =>"盘点任务明细号",
|
|
|
* "location" =>"库位",
|
|
|
- * "commodity_id" =>"商品id",
|
|
|
* "produced_at"=>"生产日期",
|
|
|
* "valid_at"=>"失效日期",
|
|
|
* "stored_at"=>"入库日期",
|
|
|
* "batch_number"=>"批号",
|
|
|
* "erp_type_position"=>"属性仓",
|
|
|
* "quality"=>"质量状态",
|
|
|
- * "stored_amount"=>"库存数量",
|
|
|
- * "verified_amount"=>"盘点数量",
|
|
|
* }
|
|
|
* }
|
|
|
*/
|
|
|
@@ -146,7 +137,7 @@ class InventoryController
|
|
|
if ($inventoryDetail) {
|
|
|
$this->response($inventoryDetail);
|
|
|
}else{
|
|
|
- $this->response(null,200,'未检测到指定盘点任务');
|
|
|
+ $this->response(null,403,'未检测到指定盘点任务');
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
@@ -169,13 +160,12 @@ class InventoryController
|
|
|
* "message": "请求成功",
|
|
|
* "status_code": "200"
|
|
|
* "data":[
|
|
|
- * inventoryTaskDetails=>[
|
|
|
+ * "notStocktakingList"=>[
|
|
|
* {
|
|
|
* "id"=>"盘点任务明细号",
|
|
|
* "location"=>"库位",
|
|
|
* }
|
|
|
* ]
|
|
|
- * sameDayInventoryCount=>“当日盘点行数”
|
|
|
* ]
|
|
|
* }
|
|
|
*/
|
|
|
@@ -188,10 +178,9 @@ class InventoryController
|
|
|
/** @var AndroidInventoryService $service */
|
|
|
$service=app('AndroidInventoryService');
|
|
|
$service->stockInventory($taskId,$location,$barcode,$amount);
|
|
|
- $inventoryTaskDetails=$service->getUnInventoryTaskList($taskId);
|
|
|
- $sameDayInventoryCount=$service->getStaffSameDayInvCount();
|
|
|
+ $notStocktakingList=$service->getUnInventoryTaskList($taskId);
|
|
|
$this->response([
|
|
|
- 'inventoryTaskDetails' => $inventoryTaskDetails, 'sameDayInventoryCount'=>$sameDayInventoryCount
|
|
|
+ "notStocktakingList" => $notStocktakingList,
|
|
|
]);
|
|
|
}
|
|
|
|