|
|
@@ -7,6 +7,7 @@ use App\City;
|
|
|
use App\Http\Controllers\Controller;
|
|
|
use App\Owner;
|
|
|
use App\Waybill;
|
|
|
+use App\OraccleBasCustomer;
|
|
|
use App\WMSWaybill;
|
|
|
use App\WMSWaybillOrder;
|
|
|
use Illuminate\Http\Request;
|
|
|
@@ -50,15 +51,25 @@ class WaybillController extends Controller
|
|
|
if (!$owner){$owner=new Owner(['name'=>$receiveInputting['CustomerID'],'code'=>$receiveInputting['CustomerID']]);$owner->save();}
|
|
|
$city=City::where('name',$receiveInputting['C_City'])->first();
|
|
|
$zfList=config('merchantsInfo.waybill.ZFList');
|
|
|
+ $bswasCustomer=OraccleBasCustomer::where("customerid",$receiveInputting['CustomerID'])->first();
|
|
|
+ if ($bswasCustomer){
|
|
|
+ $origination=$bswasCustomer->address1;
|
|
|
+ $addresses=config("merchantsInfo.address");
|
|
|
+ foreach ($addresses as $addressKey=>$addressValue){
|
|
|
+ if (strpos($origination,$addressKey))$origination=$addressValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $recipient_mobile=ltrim($receiveInputting['C_Tel1'],',');
|
|
|
+ $recipient_mobile=rtrim($receiveInputting['C_Tel1'],',');
|
|
|
$waybill=new Waybill([
|
|
|
'type'=>isset($zfList[$receiveInputting['CarrierID']])&&$zfList[$receiveInputting['CarrierID']]?"直发车":"专线",
|
|
|
'waybill_number'=>Uuid::uuid1(),
|
|
|
'owner_id'=>$owner->id,
|
|
|
'wms_bill_number'=>$receiveInputting['OrderNo']??'',
|
|
|
- 'origination'=>"",
|
|
|
+ 'origination'=>isset($origination)?$origination:"",
|
|
|
'destination'=>$receiveInputting['C_Address1']??'',
|
|
|
'recipient'=>$receiveInputting['ConsigneeName']??'',
|
|
|
- 'recipient_mobile'=>$receiveInputting['C_Tel1']??'',
|
|
|
+ 'recipient_mobile'=>$recipient_mobile??'',
|
|
|
'source_bill'=>$receiveInputting['ReservedField01']??'',
|
|
|
'destination_city_id'=>$city['id'],
|
|
|
]);
|