Commit 81cd46e0 by Joneq

增加箱子标签

parent 2eababed
Showing with 14 additions and 10 deletions
...@@ -394,22 +394,26 @@ class PalletLogic ...@@ -394,22 +394,26 @@ class PalletLogic
//获取打印的拣货任务信息 //获取打印的箱子标签信息
public function print_box_label($data) public function print_box_label($data)
{ {
//查找拣货任务ID $box = BoxModel::where('box_id',$data['box_id'])->where('box_sn',$data['box_sn'])->whereIn('status', [1, 3])->select('box_id', 'box_sn', 'weight')->with('ReceivingList')->first()->toArray();
$pickTask = PickTaskModel::where('pick_task_sn',$data['pick_task_sn'])->value('pick_task_id');
if (empty($pickTask)){ if (empty($box)){
throw new \Exception('该拣货任务不存在'); throw new \Exception('该箱子暂无需要打印的数据');
} }
$outStoreDetailData = OutStoreDetailModel::where('pick_task_id',$pickTask)->get()->toArray(); //将相同的物料合并
if (empty($outStoreDetailData)){ $Receiving = [];
throw new \Exception('该拣货任务不存在'); foreach ($box['receiving_list'] as $k => $v) {
if (empty($Receiving[$v['goods_id']])) {
$Receiving[$v['goods_id']] = $v;
continue;
}
$Receiving[$v['goods_id']]['number'] = bcadd($Receiving[$v['goods_id']]['number'], $v['number'], 4);
} }
$box['receiving_list'] = array_values($Receiving);
return $outStoreDetailData; return $box;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment