0, * "inventoryTask" => { * "id" =>"盘点任务号", * "created_at" =>"任务创建时间", * "end_at" =>"库位最后操作时间", * "type"=>"任务类型", * "total"=>"盘点任务数", * "processed"=>"盘点数", * }, * "notStocktakingList"=> [ * { * "location" =>"库位", * "count" =>"未盘商品数", * } * ] * ] * } */ public function getInventoryTask(Request $request) { $taskId = $request->input("taskId"); /** @var AndroidInventoryService $service */ $service=app('AndroidInventoryService'); $stocktakingTask = InventoryAccount::query()->find($taskId); $notStocktakingList=$service->getUnInventoryTaskList($taskId); $sameDayInventoryCount=$service->getStaffSameDayInvCount(); $this->response(['stocktakingTask' => $stocktakingTask, 'notStocktakingList' => $notStocktakingList, 'sameDayInventoryCount'=>$sameDayInventoryCount ]); } /** * @api {post} /inventory/locationInvPro 当前库位下盘点比例 * @apiName locationInvPro * @apiGroup inventory * * @apiParam {int} taskId 盘点任务号 * @apiParam {string} location 库位 * * @apiSuccess {string} message 响应描述 * @apiSuccess {int} status_code HTTP响应码 * @apiSuccess {object} data * * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { * "message": "请求成功", * "status_code": "200" * "data":{ * "total" =>"库位盘点任务总条数", * "invCount" =>"已盘条数" * } * } */ public function locationInvPro(Request $request) { $taskId = $request->input("taskId"); $location = $request->input("location"); $res=app('AndroidInventoryService')->getLocInvPro($taskId,$location); $this->response($res); } /** * @api {post} /inventory/getInventoryDetail 根据盘点任务号,库位,条码 获取盘点明细 * @apiName getInventoryDetail * @apiGroup inventory * * @apiParam {int} taskId 盘点任务号 * @apiParam {string} location 库位 * @apiParam {string} barcode 条码 * * @apiSuccess {string} message 响应描述 * @apiSuccess {int} status_code HTTP响应码 * @apiSuccess {object} data * * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { * "message": "请求成功", * "status_code": "200" * "data":{ * "id" =>"盘点任务明细号", * "verified_amount" =>"已盘数量", * "produced_at"=>"生产日期", * "valid_at"=>"失效日期", * "batch_number"=>"批号", * "erp_type_position"=>"属性仓", * "quality"=>"质量状态", * } * } */ public function getInventoryDetail(Request $request) { $taskId = $request->input("taskId"); $location = $request->input("location"); $barcode = $request->input("barcode"); $inventoryDetail=app('AndroidInventoryService')->getInventoryDetail($taskId,$location,$barcode); if ($inventoryDetail) { $this->response($inventoryDetail); }else{ $this->response(null,403,'未检测到指定盘点任务'); } } /** * @api {post} /inventory/stockInventory 盘点 * @apiName stockInventory * @apiGroup inventory * * @apiParam {int} taskId 盘点任务号 * @apiParam {string} location 库位 * @apiParam {string} barcode 条码 * @apiParam {int} amount 盘点数量 * * @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":[ * "notStocktakingList"=>[ * { * "id"=>"盘点任务明细号", * "location"=>"库位", * } * ] * ] * } */ public function stockInventory(Request $request) { $taskId = $request->input("taskId"); $location = $request->input("location"); $barcode = $request->input("barcode"); $amount = $request->input("amount"); /** @var AndroidInventoryService $service */ $service=app('AndroidInventoryService'); $service->stockInventory($taskId,$location,$barcode,$amount); $notStocktakingList=$service->getUnInventoryTaskList($taskId); $this->response([ "notStocktakingList" => $notStocktakingList, ]); } /** * @api {post} /inventory/skipInventory 跳过盘点 * @apiName skipInventory * @apiGroup inventory * * @apiParam {int} inventoryDetailId 盘点任务明细id * * @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":[ * inventoryTaskDetails=>[ * { * "id"=>"盘点任务明细号", * "location"=>"库位", * } * ] * sameDayInventoryCount=>“当日盘点行数” * ] * } */ public function skipInventory(Request $request) { $inventoryDetailId = $request->input("inventoryDetailId"); /** @var AndroidInventoryService $service */ $service=app('AndroidInventoryService'); $inv=$service->skipInventory($inventoryDetailId); if ($inv){ $inventoryTaskDetails=$service->getUnInventoryTaskList($inv->inventory_account_id); $sameDayInventoryCount=$service->getStaffSameDayInvCount(); $this->response([ 'inventoryTaskDetails' => $inventoryTaskDetails, 'sameDayInventoryCount'=>$sameDayInventoryCount ]); }else{ $this->response(null,403,'跳过失败!'); } } }