Browse Source

富勒定时回传任务BUG修复

LD 5 years ago
parent
commit
d1d16cedc3

+ 11 - 4
app/Console/Commands/FluxOrderFix.php

@@ -44,9 +44,16 @@ class FluxOrderFix extends Command
     }
 
     public function fixEdisendflagAtWrong(){
-        OracleDOCOrderHeader::where('edisendflag','W')->whereNotNull('edisendtime')->where('edisendtime','>',Carbon::now()->subDays(2))
-            ->update(['edisendflag'=>'N','manualflag'=>'N',
-//                'edisendtime'=>null
-            ]);
+        OracleDOCOrderHeader::where('edisendflag','W')
+            ->whereNull('EDI_RESENDTIME')
+            ->where('edisendtime','>',Carbon::now()->subDays(2))
+            ->where('ediremarks2','<>','不支持的单据类型')
+        ->update(['edisendflag'=>'N','manualflag'=>'N','EDI_RESENDTIME'=>Carbon::now()]);
+
+        OracleDOCOrderHeader::where('edisendflag','W')
+            ->where('EDI_RESENDTIME','>',Carbon::now()->subDays(2))
+            ->where('edisendtime','>',Carbon::now()->subDays(2))
+            ->where('ediremarks2','<>','不支持的单据类型')
+        ->update(['edisendflag'=>'N','manualflag'=>'N']);
     }
 }

+ 1 - 1
app/Console/Kernel.php

@@ -29,7 +29,7 @@ class Kernel extends ConsoleKernel
     protected function schedule(Schedule $schedule)
     {
         $schedule->command('LogExpireDelete')->dailyAt('00:01');
-        $schedule->command('FluxOrderFix')->hourlyAt(6);
+        $schedule->command('FluxOrderFix')->hourlyAt(1);
     }
 
     /**

+ 7 - 22
app/Http/Controllers/TestController.php

@@ -87,29 +87,14 @@ class TestController extends Controller
     function t2(Request $request)
     { //x        $packagesBatch=Package::where('batch_number',$batch_number)->first();
 
-        $uploaded = 0;
-        $count = DB::table('logs')->where('operation', 'like', "%PackageController::new_%")
-            ->where('created_at', '>', "2020-06-03 14:02:00")
-            ->where('created_at', '<', "2020-06-03 15:05:00")
-            ->where('type', "request_new_")
-            ->where('description', 'like', "%W200603000117%")
-            ->count();
-        $requests = DB::table('logs')->where('operation', 'like', "%PackageController::new_%")
-            ->where('created_at', '>', "2020-06-03 14:02:00")
-            ->where('created_at', '<', "2020-06-03 15:05:00")
-            ->where('description', 'like', "%W200603000117%")
-            ->where('type', "request_new_")
+
+        $objs=OracleDOCOrderHeader::select(['EDI_RESENDTIME'])->where('edisendflag','W')
+            ->where('EDI_RESENDTIME','>',Carbon::now()->subDays(2))
+            ->where('edisendtime','>',Carbon::now()->subDays(2))
+            ->where('ediremarks2','<>','不支持的单据类型')
             ->get();
-        $requests->each(function ($request) use (&$uploaded) {
-            $requestJson = json_decode($request->description, true);
-            $response = Zttp::withHeaders(['content-type' => 'application/json',
-            ])->post('https://was.baoshi56.com/api/thirdPart/flux/package/new',
-                $requestJson
-            );
-            if ($response->json() && $response->json()['response'] && $response->json()['response']['flag'] == 'Y')
-                $uploaded += 1;
-        });
-        dd($uploaded . '/' . $count);
+//        ->update(['edisendflag'=>'N','manualflag'=>'N','EDI_RESENDTIME'=>Carbon::now()]);
+        dd($objs);
 
 
     }