|
|
@@ -15,7 +15,7 @@ use App\Http\Requests\OrderDelivering;
|
|
|
use App\Jobs\CacheShelfTaskJob;
|
|
|
use App\Jobs\OrderCreateInstantBill;
|
|
|
use App\Jobs\OrderCreateWaybill;
|
|
|
-use App\Jobs\SettlementBillReportTask;
|
|
|
+use App\Jobs\SettlementBillReportJob;
|
|
|
use App\Jobs\StoreCreateInstantBill;
|
|
|
use App\Jobs\TestJob;
|
|
|
use App\Jobs\WeightUpdateInstantBill;
|
|
|
@@ -390,26 +390,42 @@ sql;
|
|
|
|
|
|
public function init_在途异常()
|
|
|
{
|
|
|
+// $logistic_numbers = OrderPackage::query()
|
|
|
+// ->select('logistic_number')
|
|
|
+// ->where('exception_status', 5)
|
|
|
+// ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
|
|
|
+// ->pluck('logistic_number');
|
|
|
+ /** @var OrderPackageReceivedSyncService $service */
|
|
|
+ $service = app('OrderPackageReceivedSyncService');
|
|
|
+// $service->syncLogisticRoute(false, $logistic_numbers);
|
|
|
+
|
|
|
+
|
|
|
$logistic_numbers = OrderPackage::query()
|
|
|
- ->select('logistic_number')
|
|
|
- ->where('exception_status', 5)
|
|
|
+ ->select(['logistic_number', 'order_id', 'id'])
|
|
|
+ ->whereIn('order_id', function ($query) {
|
|
|
+ $query->from('orders')->selectRaw('id')->whereIn('logistic_id', function ($builder) {
|
|
|
+ $builder->from('logistics')->selectRaw('id')->where('type', '=', '快递')->whereNotIn('belong_company', ['顺丰', '中通', '韵达', '圆通', '京东']);
|
|
|
+ });
|
|
|
+ })
|
|
|
->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
|
|
|
+ ->whereNull('received_at')
|
|
|
+ ->where('status', '!=',7)
|
|
|
->pluck('logistic_number');
|
|
|
- /** @var OrderPackageReceivedSyncService $service */
|
|
|
- $service = app('OrderPackageReceivedSyncService');
|
|
|
- $service->syncLogisticRoute(false, $logistic_numbers);
|
|
|
+ $service->syncLogisticRouteByAliJiSu($logistic_numbers);
|
|
|
+ }
|
|
|
|
|
|
+ public function update_order_packages_已签收()
|
|
|
+ {
|
|
|
+ OrderPackage::query()
|
|
|
+ ->where('status', 7)
|
|
|
+ ->where('exception_status','!=',0)
|
|
|
+ ->update([
|
|
|
+ 'exception_status' => 0,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
|
|
|
-// $logistic_numbers = OrderPackage::query()
|
|
|
-// ->select(['logistic_number', 'order_id', 'id'])
|
|
|
-// ->whereIn('order_id', function ($query) {
|
|
|
-// $query->from('orders')->selectRaw('id')->whereIn('logistic_id', function ($builder) {
|
|
|
-// $builder->from('logistics')->selectRaw('id')->where('type', '=', '快递')->whereNotIn('belong_company', ['顺丰', '中通', '韵达', '圆通', '京东']);
|
|
|
-// });
|
|
|
-// })
|
|
|
-// ->where('exception_status', 5)
|
|
|
-// ->where('created_at', '>=', now()->subDays(20)->toDateTimeString())
|
|
|
-// ->pluck('logistic_number');
|
|
|
-// $service->syncLogisticRouteByAliJiSu($logistic_numbers);
|
|
|
+ public function init_SettlementBillReportTask()
|
|
|
+ {
|
|
|
+ $this->dispatch(new SettlementBillReportJob('2021-08-01',[]));
|
|
|
}
|
|
|
}
|