|
|
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
use App\Authority;
|
|
|
+use App\Carrier;
|
|
|
use App\Commodity;
|
|
|
use App\CommodityBarcode;
|
|
|
use App\Console\Commands\SyncWMSOrderTask;
|
|
|
@@ -11,7 +12,6 @@ use App\Events\CancelOrder;
|
|
|
use App\Imports\OrderTrackingImport;
|
|
|
use App\InventoryAccount;
|
|
|
use App\LaborReport;
|
|
|
-use App\Feature;
|
|
|
use App\Log;
|
|
|
use App\Logistic;
|
|
|
use App\OracleActAllocationDetails;
|
|
|
@@ -24,7 +24,6 @@ use App\OrderCommodity;
|
|
|
use App\OrderIssue;
|
|
|
use App\OrderPackage;
|
|
|
use App\Owner;
|
|
|
-use App\OwnerAreaReport;
|
|
|
use App\Package;
|
|
|
use App\Process;
|
|
|
use App\ProcessDaily;
|
|
|
@@ -34,8 +33,9 @@ use App\RejectedBillItem;
|
|
|
use App\Services\CacheService;
|
|
|
use App\Services\common\BatchUpdateService;
|
|
|
use App\Services\common\DataHandlerService;
|
|
|
-use App\Services\FeatureService;
|
|
|
use App\Services\InventoryCompareService;
|
|
|
+use App\Services\LogisticService;
|
|
|
+use App\Services\LogService;
|
|
|
use App\Services\OracleDocAsnHerderService;
|
|
|
use App\Services\OracleDOCOrderHeaderService;
|
|
|
use App\Services\OrderPackageService;
|
|
|
@@ -46,17 +46,16 @@ use App\Services\OwnerService;
|
|
|
use App\Services\StoreService;
|
|
|
use App\Services\WarehouseService;
|
|
|
use App\StoreCheckingReceiveItem;
|
|
|
-use App\Unit;
|
|
|
use App\User;
|
|
|
use App\Warehouse;
|
|
|
+use App\Waybill;
|
|
|
+use App\WaybillPriceModel;
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
-use Illuminate\Support\Facades\Hash;
|
|
|
-use Illuminate\Support\Facades\Redis;
|
|
|
use Illuminate\Support\Str;
|
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
|
use Ramsey\Collection\Collection;
|
|
|
@@ -96,8 +95,46 @@ class TestController extends Controller
|
|
|
app(BatchUpdateService::class)->batchUpdate('inventory_accounts',$updateParams);
|
|
|
}
|
|
|
}
|
|
|
- public function test4(){
|
|
|
- dd($this->dd());
|
|
|
+ public function mergeCarrier(){
|
|
|
+ $carriers = Carrier::query()->get();
|
|
|
+ $logistics = [];
|
|
|
+ $map = [];
|
|
|
+ foreach ($carriers as $carrier){
|
|
|
+ $map[$carrier->name] = $carrier->id;
|
|
|
+ $lo = Logistic::query()->where("name",$carrier->name)->first();
|
|
|
+ if ($lo){
|
|
|
+ if ($lo->type == '快递'){
|
|
|
+ $lo->update(["type"=>"全部"]);$lo->save();
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ };
|
|
|
+ $logistics[] = [
|
|
|
+ "name" => $carrier->name,
|
|
|
+ 'mobile' => $carrier->mobile,
|
|
|
+ 'delivery_fee'=> $carrier->delivery_fee,
|
|
|
+ 'remark'=> $carrier->remark,
|
|
|
+ "type" => "logistic"
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ Logistic::query()->insert($logistics);
|
|
|
+ $ls = Logistic::query()->where("type","logistic")->get();
|
|
|
+ $result = [];
|
|
|
+ foreach ($ls as $l)
|
|
|
+ {
|
|
|
+ if (isset($map[$l->name]))$result[$map[$l->name]] = $l->id;
|
|
|
+ }
|
|
|
+ LogService::log(__METHOD__,"同步承运商",json_encode($result));
|
|
|
+ foreach ($result as $tag => $val){
|
|
|
+ Waybill::query()->where("logistic_id",$tag)->update([
|
|
|
+ "logistic_id" => $val
|
|
|
+ ]);
|
|
|
+ WaybillPriceModel::query()->where("logistic_id",$tag)->update([
|
|
|
+ "logistic_id" => $val
|
|
|
+ ]);
|
|
|
+ DB::table("logistic_user")->where("logistic_id",$tag)->update([
|
|
|
+ "logistic_id" => $val
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private function dd()
|