type=='德邦物流'){ if ($waybill->carrier_bill)return; $waybill->load("order"); if (!$waybill->order){ Log::error("德邦单号获取失败",["no"=>$waybill->waybill_number,"info"=>"运单无绑定订单"]); return; } $update = $this->paramDefault($waybill); $bill = app('DbOpenService')->getDbOrderNo($waybill); if (!$bill || $bill["result"]=="false"){ Log::error("德邦单号获取失败",["no"=>$waybill->waybill_number,"info"=>$bill]); return; } $update["carrier_bill"] = $bill['mailNo']; $update["waybill_number"] = $bill['mailNo']; $update["station_no"] = $bill['stationNo']; $update["arrived_org_simple_name"] = $bill['arrivedOrgSimpleName']; $update["much_higher_delivery"] = $bill['muchHigherDelivery']; $waybill->update($update); if (!app("WaybillService")->notifyFlux($waybill)){ Log::error("德邦单号回传FLUX失败",["no"=>$waybill->waybill_number,"info"=>$bill]); return; } } } 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){ $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 $update; } }