|
|
@@ -68,25 +68,45 @@ class PackageController extends Controller
|
|
|
$accomplishToWMS=new \App\Http\Controllers\Api\thirdPart\flux\PackageController();
|
|
|
|
|
|
//处理活动波次
|
|
|
- $packagesBatch=Package::where('batch_number',$package->batch_number)->get();
|
|
|
- foreach ($packagesBatch as $packageBatch){
|
|
|
- $packageBatch->measuring_machine_id=$measuringMachine->id;
|
|
|
- $packageBatch->weight=$request['weight'];
|
|
|
- $packageBatch->length=$max;
|
|
|
- $packageBatch->width=$centre;
|
|
|
- $packageBatch->height=$min;
|
|
|
- $packageBatch->bulk=$max*$centre*$min;
|
|
|
- if (isset($paperBox_id))$packageBatch->paper_box_id=$paperBox_id;
|
|
|
- $packageBatch->status="未上传";
|
|
|
- $this->log(__METHOD__,'Batch_'.__FUNCTION__,json_encode($packageBatch),null);
|
|
|
- $packageBatch->save();
|
|
|
- $result=$accomplishToWMS->accomplishToWMS($packageBatch);
|
|
|
+ if ($package->batch_rule&&strstr($package->batch_rule,'活动')){
|
|
|
+ $packagesBatch=Package::where('batch_number',$package->batch_number)->get();
|
|
|
+ foreach ($packagesBatch as $packageBatch){
|
|
|
+ $packageBatch->measuring_machine_id=$measuringMachine->id;
|
|
|
+ $packageBatch->weight=$request['weight'];
|
|
|
+ $packageBatch->length=$max;
|
|
|
+ $packageBatch->width=$centre;
|
|
|
+ $packageBatch->height=$min;
|
|
|
+ $packageBatch->bulk=$max*$centre*$min;
|
|
|
+ if (isset($paperBox_id))$packageBatch->paper_box_id=$paperBox_id;
|
|
|
+ $packageBatch->status="未上传";
|
|
|
+ $this->log(__METHOD__,'Batch_'.__FUNCTION__,json_encode($packageBatch),null);
|
|
|
+ $packageBatch->save();
|
|
|
+ $result=$accomplishToWMS->accomplishToWMS($packageBatch);
|
|
|
+ if ($result['result']=='success'){
|
|
|
+ $packageBatch->status="已上传";
|
|
|
+ }else{
|
|
|
+ $packageBatch->status="上传异常";
|
|
|
+ }
|
|
|
+ $packageBatch->save();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $package->measuring_machine_id=$measuringMachine->id;
|
|
|
+ $package->weight=$request['weight'];
|
|
|
+ $package->length=$max;
|
|
|
+ $package->width=$centre;
|
|
|
+ $package->height=$min;
|
|
|
+ $package->bulk=$max*$centre*$min;
|
|
|
+ if (isset($paperBox_id))$package->paper_box_id=$paperBox_id;
|
|
|
+ $package->status="未上传";
|
|
|
+ $this->log(__METHOD__,'Batch_'.__FUNCTION__,json_encode($package),null);
|
|
|
+ $package->save();
|
|
|
+ $result=$accomplishToWMS->accomplishToWMS($package);
|
|
|
if ($result['result']=='success'){
|
|
|
- $packageBatch->status="已上传";
|
|
|
+ $package->status="已上传";
|
|
|
}else{
|
|
|
- $packageBatch->status="上传异常";
|
|
|
+ $package->status="上传异常";
|
|
|
}
|
|
|
- $packageBatch->save();
|
|
|
+ $package->save();
|
|
|
}
|
|
|
event(new WeightEvent($package));
|
|
|
$response=["msg"=>"保存成功",
|