Commit 90f1aced by Joneq

修改整箱和整卡板判断

parent b47f3541
Showing with 10 additions and 2 deletions
...@@ -434,13 +434,21 @@ class PickTaskLogic ...@@ -434,13 +434,21 @@ class PickTaskLogic
$palletBoxGoodsData = PickTaskDetailModel::whereIn('pick_task_detail_id',$pickTaskDetailIdArr)->select('pallet_id','box_id','out_store_detail_id','pick_task_detail_id','number')->get()->toArray(); $palletBoxGoodsData = PickTaskDetailModel::whereIn('pick_task_detail_id',$pickTaskDetailIdArr)->select('pallet_id','box_id','out_store_detail_id','pick_task_detail_id','number')->get()->toArray();
$pickTaskRemarkData = []; $pickTaskRemarkData = [];
//卡板和箱子的数量
$palletNum = [];
$boxNum = [];
foreach ($palletBoxGoodsData as $value){ foreach ($palletBoxGoodsData as $value){
$value['goods_id'] = OutStoreDetailModel::where('out_store_detail_id',$value['out_store_detail_id'])->value('goods_id'); $value['goods_id'] = OutStoreDetailModel::where('out_store_detail_id',$value['out_store_detail_id'])->value('goods_id');
$key = $value['pallet_id'].'_'.$value['box_id'].'_'.$value['goods_id']; $key = $value['pallet_id'].'_'.$value['box_id'].'_'.$value['goods_id'];
if (isset($pickTaskRemarkData[$key])){ if (isset($pickTaskRemarkData[$key])){
$pickTaskRemarkData[$key]['number'] = bcadd($pickTaskRemarkData[$key]['number'],$value['number']); $pickTaskRemarkData[$key]['number'] = bcadd($pickTaskRemarkData[$key]['number'],$value['number']);
$palletNum[$value['pallet_id']] = bcadd($palletNum[$value['pallet_id']],$value['number']);
$boxNum[$value['box_id']] = bcadd($boxNum[$value['box_id']],$value['number']);
}else{ }else{
$pickTaskRemarkData[$key]['number'] = $value['number']; $pickTaskRemarkData[$key]['number'] = $value['number'];
$palletNum[$value['pallet_id']] = $value['number'];
$boxNum[$value['box_id']] = $value['number'];
} }
$pickTaskRemarkData[$key]['pick_task_detail_id_arr'][] = $value['pick_task_detail_id']; $pickTaskRemarkData[$key]['pick_task_detail_id_arr'][] = $value['pick_task_detail_id'];
...@@ -452,7 +460,7 @@ class PickTaskLogic ...@@ -452,7 +460,7 @@ class PickTaskLogic
//卡板不为空卡板数量比较 //卡板不为空卡板数量比较
if (!empty($locationArr[0])){ if (!empty($locationArr[0])){
if ($value['number'] == StockModel::where('pallet_id',$locationArr[0])->sum('stock')){ if ($palletNum[$locationArr[0]] == StockModel::where('pallet_id',$locationArr[0])->sum('stock')){
$pickRemark = '整卡板'; $pickRemark = '整卡板';
}else{ }else{
$pickRemark = '拆零'; $pickRemark = '拆零';
...@@ -460,7 +468,7 @@ class PickTaskLogic ...@@ -460,7 +468,7 @@ class PickTaskLogic
}else{ }else{
//箱不为空,箱数量比较 //箱不为空,箱数量比较
if (!empty($locationArr[1])){ if (!empty($locationArr[1])){
if ($value['number'] == StockModel::where('box_id',$locationArr[1])->sum('stock')){ if ($boxNum[$locationArr[1]] == StockModel::where('box_id',$locationArr[1])->sum('stock')){
$pickRemark = '整箱'; $pickRemark = '整箱';
}else{ }else{
$pickRemark = '拆零'; $pickRemark = '拆零';
......
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