Переглянути джерело

海柔增加放箱时不才虑过期箱子的状态

LD 5 роки тому
батько
коміт
766d7ab9e0

+ 4 - 13
app/Http/Controllers/TestController.php

@@ -737,18 +737,10 @@ class TestController extends Controller
 
     public function testImp()
     {
-        $client_no = null;
-        $items = null;
-        $order = (new OrderTrackingImport())->getOrder($client_no, $items);
-        if ($order['id']) echo 'yes1';
-
-
-        $order = Order::query()->create([
-            'code' => 'null' . Str::uuid(), 'client_code' => 'asdfdfdg', 'web_order_number' => 'sadfdsf'
-        ]);
-        dd($order);
-//        $order=(new OrderTrackingImport())->getOrder('92024765871-SDO130000986796QX',$items);
-//        if($order['id']) echo 'yes2';
+        $batch=Batch::query()->first();
+        dump($batch->created_at);
+        dump($batch->created_at<Carbon::now()->subDay());
+        dump(Carbon::now()->subDay());
     }
 
 //    public function deleteOrderInfo()
@@ -1355,7 +1347,6 @@ where purch.islower=1 and deliver.id>'.$id);
         }
         ProcurementCheckSheet::query()->insert($insert);
     }
-}
     public function testPro(){
         /**@var SupplierService $supplierService*/
         $supplierService=app(SupplierService::class);

+ 1 - 1
app/Http/Requests/ForeignHaiRobotic_taskUpdateRequest.php

@@ -31,7 +31,7 @@ class ForeignHaiRobotic_taskUpdateRequest extends FormRequest
            'updateEventType'=>'required|in:0,1',
            'status'=>'required',//|in:0,1
 //           'binCode'=>'required',
-           'kubotId'=>'required',
+//           'kubotId'=>'required',
            'description'=>'nullable',
         ];
     }

+ 3 - 1
app/Services/StationRuleBatchService.php

@@ -8,6 +8,7 @@ use App\Batch;
 use App\StationRuleBatch;
 use App\StationTaskBatch;
 use App\StationType;
+use Carbon\Carbon;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
 use App\Traits\ServiceAppAop;
@@ -68,7 +69,8 @@ class StationRuleBatchService
             if(!$stationRuleBatch)continue;
             if(Cache::tags(['波次防重叠'.$batch['id']])->get($batch['id']))
                 continue;
-            $batches_toProcess->push($batch);
+            if($batch->created_at>Carbon::now()->subDay())
+                $batches_toProcess->push($batch);
             Cache::tags([ '波次防重叠'.$batch['id']])->put($batch['id'],true,config('haiRou.波次防重叠时间_秒'));
         }
         LogService::log(__METHOD__,'shouldProcess','波次任务分配1.3:'.json_encode($batches_toProcess));

+ 2 - 0
app/Services/StationTaskBatchService.php

@@ -6,6 +6,7 @@ namespace App\Services;
 
 use App\Exceptions\ErrorException;
 use App\StationTaskBatch;
+use Carbon\Carbon;
 use Exception;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
@@ -225,6 +226,7 @@ class StationTaskBatchService
         $hasProcessing=StationTaskBatch::query()
             ->whereNotIn('id', $ids)
             ->where(['status'=>'处理中'])
+            ->where('created_at','>',Carbon::now()->subDay())
             ->get('id')->isNotEmpty();
 
         $status = '处理中';

+ 3 - 0
app/Services/StationTaskMaterialBoxService.php

@@ -14,6 +14,7 @@ use App\StationCacheShelfGrid;
 use App\StationTask;
 use App\StationTaskBatch;
 use App\StationTaskMaterialBox;
+use Carbon\Carbon;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
 use App\Traits\ServiceAppAop;
@@ -65,6 +66,7 @@ class StationTaskMaterialBoxService
     {
         return StationTaskMaterialBox::query()
             ->where('status','<>','完成')
+            ->where('created_at','>',Carbon::now()->subHours(2))
             ->whereHas('materialBox',function ($query)use($batches){
                 $locations=OrderCommodity::query()
                     ->whereHas('order',function ($queryO)use($batches){
@@ -286,6 +288,7 @@ class StationTaskMaterialBoxService
         return StationTaskMaterialBox::query()
             ->where('station_id',$stationId)
             ->where('status','处理中')
+            ->where('created_at','>',Carbon::now()->subDay())
             ->first();
     }