Ver Fonte

Merge branch 'yang' of ssh://was.baoshi56.com:10022/var/git/bswas

 Conflicts:
	.gitignore
LD há 4 anos atrás
pai
commit
8a9f11742d

+ 2 - 0
.gitignore

@@ -29,4 +29,6 @@ yarn-error.log
 /public/phpMyAdmin4.8.5/
 /public/fonts
 /phpunit.xml
+/serves/excelExportGo/logs
+/serves/excelExportGo/go_build_main_go.exe
 /laravel-echo-server.lock

+ 2 - 2
app/Http/Controllers/OrderController.php

@@ -319,12 +319,12 @@ sql;
             ->whereIn('orderno',$orderno)
             ->where('sostatus','99')
             ->whereIn('edisendflag',['R','W'])
-                ->where('addwho','==','EDI')
+            ->where('addwho','EDI')
             ->update(['edisendflag'=>'N']);
 
         $failedOrdernos =OracleDOCOrderHeader::query()
             ->whereIn('orderno', $orderno)
-            ->where('edisendflag', '!=', 'N')->pluck('orderno');
+                ->where('edisendflag', '!=', 'N')->pluck('orderno');
 
         $successedOrdernos =OracleDOCOrderHeader::query()
             ->whereIn('orderno', array_diff($orderno,$oldIds))

+ 3 - 3
app/Jobs/LogisticZopSync.php

@@ -42,6 +42,7 @@ class LogisticZopSync implements ShouldQueue
         LogService::log(LogisticZopSync::class, "{$this->logistic_number}-JOB-ZOP", '');
         $zopResult = [];
         $response = $this->sentRequestToZT();
+        dd($response);
         if(is_null($response)) return;
         if ($response->status) {
             $zopResult[] = [
@@ -156,11 +157,10 @@ class LogisticZopSync implements ShouldQueue
         $transfer_status = [];
         foreach ($itemRoutes as $item) {
             $data = [];
-            $data['accept_time'] = Carbon::parse($item->scanDate / 1000)->toDateTimeString();
+            $data['accept_time'] = Carbon::parse($item->scanDate / 1000)->addHours(8)->toDateTimeString();
             $scanSite = $item->scanSite;
             $data['accept_address'] = $scanSite->prov . '-' . $scanSite->name;
-            $data['remark'] = $item->scanType;
-
+            $data['remark'] = $item->desc;
             $transfer_status[] = $data;
         }
         return $transfer_status;

+ 9 - 1
app/Listeners/AddOrUpdateOrderIssuesListener.php

@@ -37,8 +37,16 @@ class AddOrUpdateOrderIssuesListener implements ShouldQueue
                 'exception_type' => '其他',
                 'exception' => '是',
             ]);
+
+        //如果问题件改为 完结订单 吧异常该为无
+        OrderPackage::query()->whereIn('order_id',
+            OrderIssue::query()->whereIn('order_id', $event->order_ids)->where('final_status', '已解决')->pluck('order_id'))
+            ->update([
+                'exception_type' => '无',
+                'exception' => '否',
+            ]);
         //更新统计数据
-        $orderPackageIds = OrderPackage::query()->whereIn('order_id', $order_ids)->pluck('id');
+        $orderPackageIds = OrderPackage::query()->whereIn('order_id', $event->order_ids)->pluck('id');
         event(new UpdateOrderPackageExceptionListenerEvent($orderPackageIds));
     }
 }

+ 5 - 0
app/Services/OrderPackageReceivedSyncService.php

@@ -143,6 +143,11 @@ class OrderPackageReceivedSyncService
             } catch (Exception $e) {
                 LogService::log(OrderPackageReceivedSyncService::class, "标记问题件不需要更新异常状态失败", $data['logistic_number'].'-'.json_encode($e));
             }
+            //如果已经收货,将异常更新为正常
+            if (array_key_exists('received_at',$data)) {
+                $data['exception_type'] = '无';
+                $data['exception'] = '否';
+            }
             if (isset($data['status'])) $orderPackage->status = $data['status'];
             if (isset($data['received_at'])) $orderPackage->received_at = $data['received_at'];
             if (isset($data['exception'])) $orderPackage->exception = $data['exception'];

+ 1 - 1
tests/Feature/LogisticZopSyncTest.php

@@ -39,7 +39,7 @@ class LogisticZopSyncTest extends TestCase
 
     public function test_get()
     {
-        LogisticZopSync::dispatch('75467972757443');
+        LogisticZopSync::dispatch('75600189836589');
     }