From f33f07d6a652f41b0a257e011f9e1b6d8287aad5 Mon Sep 17 00:00:00 2001
From: zcstatham <578322713@qq.com>
Date: Sun, 11 Sep 2022 22:46:41 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=A2=9E=E5=8A=A0=E9=98=9F?=
=?UTF-8?q?=E5=88=97=E5=90=8D=E5=AD=97=E6=AE=B5=EF=BC=88=E5=8F=AF=E8=83=BD?=
=?UTF-8?q?=E6=B2=A1=E7=94=A8=EF=BC=8C=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/view/task/index.html | 7 +++++++
extend/service/CarInfoHandle.php | 13 +++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/app/view/task/index.html b/app/view/task/index.html
index 9ddec5f..d14d617 100644
--- a/app/view/task/index.html
+++ b/app/view/task/index.html
@@ -27,6 +27,12 @@
[下载车辆信息导入模板]
+
@@ -262,6 +268,7 @@
break;
case 5:
$('#task-import').addClass('active').show();
+ $('#export-queue-name').addClass('active').show();
break;
}
});
diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php
index 686a1a9..dff93c8 100644
--- a/extend/service/CarInfoHandle.php
+++ b/extend/service/CarInfoHandle.php
@@ -444,6 +444,9 @@ class CarInfoHandle
if (empty($filename) OR !file_exists($filename)) {
return '文件不存在!';
}
+ $export_id = 0;
+ if($data['queue'] != '')
+ $export_id = JobsT::where('payload','like','%'. str_replace(['\\','"'],['_',''],json_encode($data['queue'])) .'%')->value('id');
$spreadRead = Excel::loadFile($filename);
$worksheet = $spreadRead->getSheet(0);
$highestRow = $worksheet->getHighestRow(); // e.g. 10
@@ -478,7 +481,12 @@ class CarInfoHandle
if ($car_frame_no == '') {
continue;
}
- $car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find();
+ if ($export_id)
+ $car_info = CarInfoT::where('car_frame_no', $car_frame_no)->where('is_export_bhx', $export_id)->find();
+ if (!$car_info)
+ $car_info = CarInfoT::where('car_frame_no', $car_frame_no)->where('is_export_bhx', '>', 0)->find();
+ if (!$car_info)
+ $car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find();
if (isset($car_info)) {
if ($is_update_failed == 0 && $car_info->is_export_failed > 0) {
$is_update_failed = $car_info->is_export_failed;
@@ -524,8 +532,9 @@ class CarInfoHandle
CarInfoT::where('is_export_failed', $is_update_failed)
->update(['is_export_failed' => 0, 'is_update_bhx' => Db::raw('is_update_bhx - 1')]);
} else {
+ $export_id = $export_id ?: $car_info->is_export_bhx;
CarInfoT::where('is_update_bhx', 0)
- ->where('is_export_bhx', $car_info->is_export_bhx)
+ ->where('is_export_bhx', $export_id)
->update(['is_update_bhx' => -1]);
}
return '操作成功' . "数据总计{$statistical_information['total_all']}条,