فهرست منبع

Merge branch 'Haozi'

zhouzhendong 4 سال پیش
والد
کامیت
d334151449

+ 42 - 0
app/Console/Commands/AccordingToOwnersManualBack.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+class AccordingToOwnersManualBack extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'AccordingToOwnersManualBack';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '根据货主自动回传奇门标记';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        return 0;
+    }
+}

+ 20 - 0
app/Http/Controllers/TestController.php

@@ -20,6 +20,8 @@ use App\Jobs\StoreCreateInstantBill;
 use App\Jobs\WeightUpdateInstantBill;
 use App\MaterialBox;
 use App\MaterialBoxModel;
+use App\OracleDOCASNHeader;
+use App\OracleDOCOrderHeader;
 use App\Order;
 use App\OrderPackage;
 use App\Owner;
@@ -347,4 +349,22 @@ sql;
             }
         }
     }
+
+    public function testDocOrder()
+    {
+        $now=Carbon::now()->toDateTimeString();
+        $before=Carbon::now()->subMinutes(30)->toDateTimeString();
+//        dd($now,$before);
+        $orders=OracleDOCOrderHeader::query()
+            ->whereIn('sostatus',['40','50','60','61'])
+//            ->where('edittime','>=',$before)
+//            ->where('edittime','<=',$now)
+            ->whereNotNull('soreference5')
+            ->where('manualflag','N')
+            ->whereIn('customerid',['BAOSHI']) //指定货主
+            ->where('releasestatus','!=','H')
+            ->get();
+//            ->update(['manualflag'=>'N','edittime'=>$now]);
+        dd($orders);
+    }
 }

+ 1 - 12
app/Services/StoreItemService.php

@@ -217,18 +217,7 @@ class StoreItemService
                 ];
             }
         }
-        if (count($updateParams) > 0) {
-            foreach (array_chunk($updateParams, 1000) as $item) {
-                try {
-                    $bool = $this->batchUpdate($item);
-                    if ($bool) {
-                        app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store_item success " . count($item) . ' || ' . json_encode($item));
-                    } else app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store_item FAILED " . ' || ' . json_encode($item));
-                } catch (\Exception $e) {
-                    app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store_item ERROR " . ' || ' . json_encode($updateParams) . ' || ' . json_encode($e->getMessage()) . ' || ' . json_encode($e->getTraceAsString()));
-                }
-            }
-        }
+        if (count($updateParams) > 1) $this->batchUpdate($updateParams);
         if (count($delete_storeItems) > 0) $this->deleteStoreItem($delete_storeItems);
         unset($updateParams, $asnDetails, $delete_storeItems);
     }

+ 1 - 12
app/Services/StoreService.php

@@ -223,18 +223,7 @@ class StoreService
                 ];
             }
         }
-        if (count($updateParams) > 1) {
-            foreach (array_chunk($updateParams, 1000) as $item) {
-                try {
-                    $bool=$this->batchUpdate($item);
-                    if ($bool) {
-                        app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store success " . count($item) . ' || ' . json_encode($item));
-                    } else app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store FAILED " . ' || ' . json_encode($item));
-                } catch (\Exception $e) {
-                    app('LogService')->log(__METHOD__, __FUNCTION__, "批量修改 store ERROR " . ' || ' . json_encode($updateParams) . ' || ' . json_encode($e->getMessage()) . ' || ' . json_encode($e->getTraceAsString()));
-                }
-            }
-        }
+        if (count($updateParams) > 1) $this->batchUpdate($updateParams);
         /** @var StoreItemService $storeItemService */
         $storeItemService = app(StoreItemService::class);
         $storeItemService->storeItemUpdateByWms($asnHerders);