|
|
@@ -20,10 +20,11 @@ class WaybillController extends Controller
|
|
|
|
|
|
public function new_(Request $request)
|
|
|
{
|
|
|
+ (new Controller())->log(__METHOD__,__FUNCTION__,'WMS requesting:.'.'|'.json_encode($request->all()));
|
|
|
$errors=$this->validatorForNew($request->all())->errors();
|
|
|
if(count($errors)>0){
|
|
|
$this->log(__METHOD__, 'error_' . __FUNCTION__, json_encode($request->getContent()));
|
|
|
- (new Controller())->log(__METHOD__,'error_'.__FUNCTION__,'fields wrong, see Errors report please.'.'|'.json_encode($request).'|'.json_encode($errors));
|
|
|
+ (new Controller())->log(__METHOD__,'error_'.__FUNCTION__,'fields wrong, see Errors report please.'.'|'.json_encode($request->all()).'|'.json_encode($errors));
|
|
|
return response()->json(['response'=>['return'=>['returnFlag'=>'0','returnCode'=>'0001','returnDesc'=>'消息处理失败:Failure','resultInfo'=>'',
|
|
|
'errors'=>$errors]]])
|
|
|
->setEncodingOptions(JSON_UNESCAPED_UNICODE);
|
|
|
@@ -45,20 +46,20 @@ class WaybillController extends Controller
|
|
|
->setEncodingOptions(JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
}
|
|
|
- $owner=Owner::where('code',$receiveInputting->CustomerID)->first();
|
|
|
- if (!$owner){$owner=new Owner(['name'=>$receiveInputting->CustomerID,'code'=>$receiveInputting->CustomerID]);$owner->save();}
|
|
|
- $city=City::where('name',$receiveInputting->C_City)->first();
|
|
|
+ $owner=Owner::where('code',$receiveInputting['CustomerID'])->first();
|
|
|
+ if (!$owner){$owner=new Owner(['name'=>$receiveInputting['CustomerID'],'code'=>$receiveInputting['CustomerID']]);$owner->save();}
|
|
|
+ $city=City::where('name',$receiveInputting['C_City'])->first();
|
|
|
$zfCar=config('bszf.ZFList');
|
|
|
$waybill=new Waybill([
|
|
|
- 'type'=>isset($zfCar[$receiveInputting->CarrierID])&&$zfCar[$receiveInputting->CarrierID]?"直发车":"专线",
|
|
|
+ 'type'=>isset($zfCar[$receiveInputting['CarrierID']])&&$zfCar[$receiveInputting['CarrierID']]?"直发车":"专线",
|
|
|
'waybill_number'=>Uuid::uuid1(),
|
|
|
'owner_id'=>$owner->id,
|
|
|
- 'wms_bill_number'=>$receiveInputting->OrderNo,
|
|
|
+ 'wms_bill_number'=>$receiveInputting['OrderNo'],
|
|
|
'origination'=>"上海市松江区泗砖路351号宝时松江仓",
|
|
|
- 'destination'=>$receiveInputting->C_Address1,
|
|
|
- 'recipient'=>$receiveInputting->ConsigneeName,
|
|
|
- 'recipient_mobile'=>$receiveInputting->C_Tel,
|
|
|
- 'destination_city_id'=>$city->id,
|
|
|
+ 'destination'=>$receiveInputting['C_Address1'],
|
|
|
+ 'recipient'=>$receiveInputting['ConsigneeName'],
|
|
|
+ 'recipient_mobile'=>$receiveInputting['C_Tel'],
|
|
|
+ 'destination_city_id'=>$city['id'],
|
|
|
]);
|
|
|
$waybill->save();
|
|
|
if ($waybill->type=='直发车'){
|