Commit 81cd46e0 by Joneq

增加箱子标签

parent 2eababed
Showing with 14 additions and 10 deletions
......@@ -394,22 +394,26 @@ class PalletLogic
//获取打印的拣货任务信息
//获取打印的箱子标签信息
public function print_box_label($data)
{
//查找拣货任务ID
$pickTask = PickTaskModel::where('pick_task_sn',$data['pick_task_sn'])->value('pick_task_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();
if (empty($pickTask)){
throw new \Exception('该拣货任务不存在');
if (empty($box)){
throw new \Exception('该箱子暂无需要打印的数据');
}
$outStoreDetailData = OutStoreDetailModel::where('pick_task_id',$pickTask)->get()->toArray();
if (empty($outStoreDetailData)){
throw new \Exception('该拣货任务不存在');
//将相同的物料合并
$Receiving = [];
foreach ($box['receiving_list'] as $k => $v) {
if (empty($Receiving[$v['goods_id']])) {
$Receiving[$v['goods_id']] = $v;
continue;
}
return $outStoreDetailData;
$Receiving[$v['goods_id']]['number'] = bcadd($Receiving[$v['goods_id']]['number'], $v['number'], 4);
}
$box['receiving_list'] = array_values($Receiving);
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