Просмотр исходного кода

Merge branch 'waybill_ZD'

# Conflicts:
#	app/City.php
#	app/Http/Controllers/PackageController.php
#	app/Http/Controllers/api/thirdPart/flux/WaybillController.php
#	public/js/app.js
#	resources/views/layouts/app.blade.php
#	webpack.mix.js
LD 5 лет назад
Родитель
Сommit
2f03cb4b26

+ 7 - 1
app/Http/Controllers/TestController.php

@@ -14,13 +14,16 @@ use App\Package;
 use App\Rejected;
 use App\RejectedBill;
 use App\RejectedBillItem;
+use App\Unit;
 use App\User;
 use App\UserToken;
 use App\Waybill;
+use App\OraccleBasCustomer;
 use App\WMSReflectReceive;
 use Carbon\Carbon;
 use Endroid\QrCode\Response\QrCodeResponse;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
 use Zttp\Zttp;
 
 class TestController extends Controller
@@ -132,7 +135,10 @@ class TestController extends Controller
     }
 
     public function test1(){
-
+        $str=",15984854564564,";
+        $str=ltrim($str,',');
+        $str=rtrim($str,',');
+        dd($str);
     }
 
 

+ 13 - 2
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -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'],
             ]);

+ 11 - 0
app/OraccleBasCustomer.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OraccleBasCustomer extends Model
+{
+    protected $connection="oracle";
+    protected $table="BAS_CUSTOMER";
+}

+ 6 - 1
config/merchantsInfo.php

@@ -10,5 +10,10 @@ return [
             "BSZXDF"=>true,
             "BSZX"=>true,
         ],
-    ]
+    ],
+    "address"=>[
+        "武乡"=>"嘉定武乡仓",
+        "九干"=>"松江九干仓",
+        "泗砖"=>"松江泗砖仓",
+    ],
 ];

+ 2 - 2
public/js/app.js

@@ -2259,7 +2259,7 @@ function fromByteArray (uint8) {
 var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
   typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
   typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
-  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : 
+  typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
   false;
 
 /**
@@ -61401,4 +61401,4 @@ module.exports = __webpack_require__(/*! D:\wamp64\www\bswas\resources\sass\app.
 
 /***/ })
 
-/******/ });
+/******/ });