Zhouzhendong 4 سال پیش
والد
کامیت
e5c5bcf2ee

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

@@ -7,7 +7,9 @@ use App\Components\Database;
 use App\Components\ErrorPush;
 use App\MaterialBox;
 use App\MaterialBoxModel;
+use App\Services\RejectedService;
 use App\User;
+use App\Waybill;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Log;
@@ -33,9 +35,42 @@ class TestController extends Controller
     }
     public function test(Request $request)
     {
-        dd(implode(" ",User::query()->select("id")->pluck("id")->toArray()));
+        dd(1);
         Log::error(json_encode($request->header(),JSON_UNESCAPED_UNICODE));
         return json_encode($request->header(),JSON_UNESCAPED_UNICODE);
     }
+
+    private function paramDefault($waybill):array
+    {
+        $update = [];
+        if (!$waybill->order_type){
+            $update["order_type"] = $waybill->order_type = Waybill::ORDER_TYPE_DEFAULT;
+        }
+        if (!$waybill->transport_type){
+            $update["transport_type"] = $waybill->transport_type = "JZKH";
+        }
+        if (!$waybill->cargo_name){
+            $update["cargo_name"] = $waybill->cargo_name = "补货";
+        }
+        if (!$waybill->total_number){
+            $update["total_number"] = $waybill->total_number = 1;
+        }
+        if (!$waybill->total_weight){
+            $update["total_weight"] = $waybill->total_weight = 1;
+        }
+        if (!$waybill->package_service){
+            $update["package_service"] = $waybill->package_service = '托膜';
+        }
+        if (!$waybill->deliveryType_id){
+            $update["deliveryType_id"] = $waybill->deliveryType_id = 3;
+        }
+        if (!$waybill->pay_type){
+            $update["pay_type"] = $waybill->pay_type = Waybill::PAY_TYPE_DEFAULT;
+        }
+        if (!$waybill->back_sign_bill){
+            $update["back_sign_bill"] = $waybill->back_sign_bill = Waybill::BACK_SIGN_BILL_DEFAULT;
+        }
+        return array($update,$waybill);
+    }
 }
 

+ 1 - 3
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -98,6 +98,7 @@ class WaybillController extends Controller
                 $unit=Unit::query()->where('name','kg')->first();
                 if ($unit)$waybill->warehouse_weight_unit_id_other=$unit->id;
             }
+            $waybill->save();
             if ($waybill->wms_bill_number){
                 $notes = DB::connection("oracle")->selectOne(DB::raw("SELECT notes FROM DOC_ORDER_HEADER WHERE ORDERNO = ?"),[$waybill->wms_bill_number]);
                 if ($notes)$waybill->ordering_remark = $notes->notes;
@@ -107,7 +108,6 @@ class WaybillController extends Controller
                     app("WaybillService")->autoGetDBBill($waybill);
                 }
             }
-            $waybill->save();
             WaybillAuditLog::query()->create([
                 'waybill_id'=>$waybill->id,
                 'audit_stage'=>'创建',
@@ -133,8 +133,6 @@ class WaybillController extends Controller
         }
         return response()->json(['response'=>['return'=>['returnFlag'=>'1','returnCode'=>'0000','returnDesc'=>'正确接收','resultInfo'=>'']]])
             ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
-
-
     }
 
     protected function validatorForNew(array $data)

+ 0 - 4
app/Services/DbOpenService.php

@@ -22,10 +22,6 @@ class DbOpenService
      */
     public function getDbOrderNo($waybill):?array
     {
-        $waybill->loadCount(["waybillAuditLogs"=>function($query){
-            $query->where("audit_stage","发起德邦调度");
-        }]);
-        if ($waybill->waybill_audit_logs_count>0)return null;
         $header = [
             'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8',
             "Accept" => "application/json"