|
|
@@ -14,6 +14,10 @@ use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
use App\Models\Manager\Process\ViolationProductMember as ViolationProductMemberModel;
|
|
|
use App\Models\Manager\Citys as CitysModel;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
+use App\Servers\Aliyun\Oss;
|
|
|
+use App\Jobs\Manager\Other\ExportViolationProductJobs;
|
|
|
+use App\Models\Manager\Other\DownloadTask as DownloadTaskModel;
|
|
|
+use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
/**
|
|
|
* 违规处理-违规商品
|
|
|
@@ -214,346 +218,69 @@ class ViolationProduct extends Controller
|
|
|
* @version 1.0
|
|
|
* @date 2025-06-17
|
|
|
*/
|
|
|
- public function export_excel(Request $request, ViolationProductModel $ViolationProductModel, EmployeeModel $EmployeeModel, ViolationProductMemberModel $ViolationProductMemberModel)
|
|
|
+ public function export_excel(Request $request, DownloadTaskModel $DownloadTaskModel)
|
|
|
{
|
|
|
$request->scene('export_excel')->validate();
|
|
|
- $admin_company_id = request('admin_company_id', '0');
|
|
|
- $company_id = request('access_token.company_id', '0');
|
|
|
- $is_admin = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
|
|
|
- $user_id = request('access_token.uid', 0);
|
|
|
+ $message_data['admin_company_id'] = request('admin_company_id', '0');
|
|
|
+ $message_data['company_id'] = request('access_token.company_id', '0');
|
|
|
+ $message_data['is_admin'] = request('access_token.is_admin', '0'); //是否管理员操作 0=是1=否
|
|
|
+ $message_data['user_id'] = request('access_token.uid', 0);
|
|
|
// 查询条件
|
|
|
- $map = [];
|
|
|
- $limit = request('limit', config('page_num', 10));
|
|
|
- $status = request('status', '');
|
|
|
- $start_time = request('start_time', '');
|
|
|
- $end_time = request('end_time', '');
|
|
|
- $product_name = request('product_name', '');
|
|
|
- $product_names = request('product_names', '');
|
|
|
- $first_responsible_person = request('first_responsible_person', '');
|
|
|
- $responsible_person = request('responsible_person', '');
|
|
|
- $platform = request('platform', '');
|
|
|
- $company_name = request('company_name', '');
|
|
|
- $store_name = request('store_name', '');
|
|
|
- $store_names = request('store_names', '');
|
|
|
- $source_responsible_person = request('source_responsible_person', '');
|
|
|
- $processing_status = request('processing_status', '');
|
|
|
- $product_specs = request('product_specs', '');
|
|
|
- $online_posting_count = request('online_posting_count', '');
|
|
|
- $category_name = request('category_name', '');
|
|
|
- $province_ids = request('province_ids', '');
|
|
|
- $city_ids = request('city_ids', '');
|
|
|
- $shipment_province_ids = request('shipment_province_ids', '');
|
|
|
- $shipment_city_ids = request('shipment_city_ids', '');
|
|
|
- // 时间条件
|
|
|
- if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
|
|
|
- if ($end_time) $map[] = ['insert_time', '<=', strtotime($end_time)];
|
|
|
- // 其他条件
|
|
|
- if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
|
|
|
- if ($store_name) $map[] = ['store_name', 'like', "%$store_name%"];
|
|
|
- if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
|
|
|
+ $message_data['status'] = request('status', '');
|
|
|
+ $message_data['start_time'] = request('start_time', '');
|
|
|
+ $message_data['end_time'] = request('end_time', '');
|
|
|
+ $message_data['product_name'] = request('product_name', '');
|
|
|
+ $message_data['product_names'] = request('product_names', '');
|
|
|
+ $message_data['first_responsible_person'] = request('first_responsible_person', '');
|
|
|
+ $message_data['responsible_person'] = request('responsible_person', '');
|
|
|
+ $message_data['platform'] = request('platform', '');
|
|
|
+ $message_data['company_name'] = request('company_name', '');
|
|
|
+ $message_data['company_names'] = request('company_names', '');
|
|
|
+ $message_data['store_name'] = request('store_name', '');
|
|
|
+ $message_data['store_names'] = request('store_names', '');
|
|
|
+ $message_data['source_responsible_person'] = request('source_responsible_person', '');
|
|
|
+ $message_data['processing_status'] = request('processing_status', '');
|
|
|
+ $message_data['product_specs'] = request('product_specs', '');
|
|
|
+ $message_data['online_posting_count'] = request('online_posting_count', '');
|
|
|
+ $message_data['category_name'] = request('category_name', '');
|
|
|
+ $message_data['id'] = request('id', '');
|
|
|
+ $message_data['online_posting_cunt'] = request('online_posting_cunt', '');
|
|
|
+ $message_data['continuous_listing_count'] = request('continuous_listing_count', '');
|
|
|
+ $message_data['province_ids'] = request('province_ids', '');
|
|
|
+ $message_data['city_ids'] = request('city_ids', '');
|
|
|
+ $message_data['shipment_province_ids'] = request('shipment_province_ids', '');
|
|
|
+ $message_data['shipment_city_ids'] = request('shipment_city_ids', '');
|
|
|
|
|
|
$violation_product_where = [];
|
|
|
// 权限判断
|
|
|
- if ($is_admin != 1 && $company_id != 0) {
|
|
|
- $violation_product_where['company_id'] = $company_id;
|
|
|
+ if ($message_data['is_admin'] != 1 && $message_data['company_id'] != 0) {
|
|
|
+ $violation_product_where['company_id'] = $message_data['company_id'];
|
|
|
} else {
|
|
|
- $violation_product_where['company_id'] = $admin_company_id;
|
|
|
- }
|
|
|
- $ViolationProductModel = $ViolationProductModel->where($violation_product_where);
|
|
|
-
|
|
|
- //多选平台查询
|
|
|
- if ($platform && is_string($platform)) {
|
|
|
- $platform = explode(',', $platform);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('platform', $platform);
|
|
|
- }
|
|
|
- //多选处理状态查询
|
|
|
- if ($processing_status && is_string($processing_status)) {
|
|
|
- $processing_status = explode(',', $processing_status);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('processing_status', $processing_status);
|
|
|
- }
|
|
|
- //多选状态查询
|
|
|
- if ($status && is_string($status)) {
|
|
|
- $status = explode(',', $status);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('status', $status);
|
|
|
- }
|
|
|
- //多选店铺名称查询
|
|
|
- if ($store_names && is_string($store_names)) {
|
|
|
- $store_names = explode(',', $store_names);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('store_name', $store_names);
|
|
|
- }
|
|
|
- //多选违规挂网次数查询
|
|
|
- if ($online_posting_count && is_string($online_posting_count)) {
|
|
|
- $online_posting_count = explode(',', $online_posting_count);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('online_posting_count', $online_posting_count);
|
|
|
- }
|
|
|
- //多选规格查询
|
|
|
- if ($product_specs && is_string($product_specs)) {
|
|
|
- $product_specs = explode(',', $product_specs);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('product_specs', $product_specs);
|
|
|
- }
|
|
|
- //多选商品查询
|
|
|
- if ($product_names && is_string($product_names)) {
|
|
|
- $product_names = explode(',', $product_names);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('product_name', $product_names);
|
|
|
- }
|
|
|
- //多选公司查询
|
|
|
- if ($company_name && is_string($company_name)) {
|
|
|
- $company_name = explode(',', $company_name);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('company_name', $company_name);
|
|
|
- }
|
|
|
- //多选第一责任人
|
|
|
- if ($first_responsible_person && is_string($first_responsible_person)) {
|
|
|
- $first_responsible_person = explode(',', $first_responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $first_responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
- });
|
|
|
- }
|
|
|
- //多选责任人
|
|
|
- if ($responsible_person && is_string($responsible_person)) {
|
|
|
- $responsible_person = explode(',', $responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
- });
|
|
|
- }
|
|
|
- //多选溯源责任人
|
|
|
- if ($source_responsible_person && is_string($source_responsible_person)) {
|
|
|
- $source_responsible_person = explode(',', $source_responsible_person);
|
|
|
- $subQuery = $ViolationProductMemberModel->whereIn('employee_id', $source_responsible_person)->distinct('violation_product_logid')->select('violation_product_logid');
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query1) use ($subQuery) {
|
|
|
- $query1->select('violation_product_logid')->fromSub($subQuery, 'sub1');
|
|
|
- });
|
|
|
- }
|
|
|
- //多选省份
|
|
|
- if ($province_ids && is_string($province_ids)) {
|
|
|
- $province_ids = explode(',', $province_ids);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('province_id', $province_ids);
|
|
|
- }
|
|
|
- //多选城市
|
|
|
- if ($city_ids && is_string($city_ids)) {
|
|
|
- $city_ids = explode(',', $city_ids);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('city_id', $city_ids);
|
|
|
- }
|
|
|
- //多选发货省份
|
|
|
- if ($shipment_province_ids && is_string($shipment_province_ids)) {
|
|
|
- $shipment_province_ids = explode(',', $shipment_province_ids);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('shipment_province_id', $shipment_province_ids);
|
|
|
- }
|
|
|
- //多选发货城市
|
|
|
- if ($shipment_city_ids && is_string($shipment_city_ids)) {
|
|
|
- $shipment_city_ids = explode(',', $shipment_city_ids);
|
|
|
- $ViolationProductModel = $ViolationProductModel->whereIn('shipment_city_id', $shipment_city_ids);
|
|
|
- }
|
|
|
-
|
|
|
- if ($is_admin != 1 && $company_id != 0) {
|
|
|
- $result_totle = $ViolationProductModel->where(function ($q) use ($user_id) {
|
|
|
- $q->where('first_responsible_person', 'like', "%,$user_id,%")
|
|
|
- ->orWhere('responsible_person', 'like', "%,$user_id,%")
|
|
|
- ->orWhere('source_responsible_person', 'like', "%,$user_id,%");
|
|
|
- })
|
|
|
- ->where($map)
|
|
|
- ->orderByDesc('id')
|
|
|
- ->count();
|
|
|
- } else {
|
|
|
- $result_totle = $ViolationProductModel->where($map)
|
|
|
- ->orderByDesc('id')
|
|
|
- ->count();
|
|
|
- }
|
|
|
-
|
|
|
- // 数量过多时,限制导出
|
|
|
- if ($result_totle > 100000) {
|
|
|
- return json_send(['code' => 'error', 'msg' => '导出数据过多,请缩小查询条件']);
|
|
|
- }
|
|
|
- if ($is_admin != 1 && $company_id != 0) {
|
|
|
- $result = $ViolationProductModel->where(function ($q) use ($user_id) {
|
|
|
- $q->where('first_responsible_person', 'like', "%,$user_id,%")
|
|
|
- ->orWhere('responsible_person', 'like', "%,$user_id,%")
|
|
|
- ->orWhere('source_responsible_person', 'like', "%,$user_id,%");
|
|
|
- })
|
|
|
- ->where($map)
|
|
|
- ->orderByDesc('id')
|
|
|
- ->get()->toarray();
|
|
|
- } else {
|
|
|
- $result = $ViolationProductModel->where($map)
|
|
|
- ->orderByDesc('id')
|
|
|
- ->get()->toarray();
|
|
|
- }
|
|
|
- // 分配数据
|
|
|
- if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
|
- // 处理责任人展示信息
|
|
|
- $list_data = $this->processing_responsible_person($result);
|
|
|
- // 导出数据
|
|
|
- $this->export_download($list_data);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 处理责任人展示信息
|
|
|
- * @author 唐远望
|
|
|
- * @version 1.0
|
|
|
- * @date 2025-12-17
|
|
|
- */
|
|
|
- public function processing_responsible_person($result)
|
|
|
- {
|
|
|
- $EmployeeModel = new EmployeeModel();
|
|
|
- //获取所有员工
|
|
|
- $employeee_data = $EmployeeModel->select(['id', 'name'])->get()->toarray();
|
|
|
- $employeee_list = [];
|
|
|
- if (!empty($employeee_data)) {
|
|
|
- foreach ($employeee_data as $key => $value) {
|
|
|
- $employeee_list[$value['id']] = $value['name'];
|
|
|
- }
|
|
|
- }
|
|
|
- if (isset($result) && count($result) > 0) {
|
|
|
- foreach ($result as $key => $value) {
|
|
|
- //查询第一责任人名称
|
|
|
- $first_responsible_person = $value['first_responsible_person'] != '' ? explode(',', $value['first_responsible_person']) : [];
|
|
|
- $first_responsible_person_name = [];
|
|
|
- if (!empty($first_responsible_person)) {
|
|
|
- foreach ($first_responsible_person as $k => $v) {
|
|
|
- if (isset($employeee_list[$v])) {
|
|
|
- $first_responsible_person_name[] = $employeee_list[$v];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result[$key]['first_responsible_person_name'] = $first_responsible_person_name;
|
|
|
- //查询责任人名称
|
|
|
- $responsible_person = $value['responsible_person'] != '' ? explode(',', $value['responsible_person']) : [];
|
|
|
- $responsible_person_name = [];
|
|
|
- if (!empty($responsible_person)) {
|
|
|
- foreach ($responsible_person as $k => $v) {
|
|
|
- if (isset($employeee_list[$v])) {
|
|
|
- $responsible_person_name[] = $employeee_list[$v];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result[$key]['responsible_person_name'] = $responsible_person_name;
|
|
|
- //查询来源责任人名称
|
|
|
- $source_responsible_person = $value['source_responsible_person'] != '' ? explode(',', $value['source_responsible_person']) : [];
|
|
|
- $source_responsible_person_name = [];
|
|
|
- if (!empty($source_responsible_person)) {
|
|
|
- foreach ($source_responsible_person as $k => $v) {
|
|
|
- if (isset($employeee_list[$v])) {
|
|
|
- $source_responsible_person_name[] = $employeee_list[$v];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result[$key]['source_responsible_person_name'] = $source_responsible_person_name;
|
|
|
- }
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 导出下载
|
|
|
- * @author 唐远望
|
|
|
- * @version 1.0
|
|
|
- * @date 2025-06-17
|
|
|
- */
|
|
|
- public function export_download($data)
|
|
|
- {
|
|
|
- // 创建一个新的 Spreadsheet 对象
|
|
|
- $spreadsheet = new Spreadsheet();
|
|
|
- $sheet = $spreadsheet->getActiveSheet();
|
|
|
-
|
|
|
- //合并单元格
|
|
|
- $sheet->mergeCells('A1:Q1');
|
|
|
- $sheet->setCellValue('A1', '禁止挂网商品导出(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
|
|
|
- // 获取合并后的单元格样式对象
|
|
|
- $style = $sheet->getStyle('A1');
|
|
|
- // 设置水平居中和垂直居中
|
|
|
- $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setVertical(Alignment::VERTICAL_CENTER);
|
|
|
- // 然后设置行高以适应两行文本
|
|
|
- $sheet->getRowDimension(1)->setRowHeight(40); // 设置行高,单位是磅(point)
|
|
|
- // 设置表头
|
|
|
- $sheet->setCellValue('A2', '第一责任人');
|
|
|
- $sheet->setCellValue('B2', '责任人');
|
|
|
- $sheet->setCellValue('C2', '平台');
|
|
|
- $sheet->setCellValue('D2', '商品分类');
|
|
|
- $sheet->setCellValue('E2', '商品名称');
|
|
|
- $sheet->setCellValue('F2', '库存');
|
|
|
- $sheet->setCellValue('G2', '销量');
|
|
|
- $sheet->setCellValue('H2', '快照URL');
|
|
|
- $sheet->setCellValue('I2', '商品规格');
|
|
|
- $sheet->setCellValue('J2', '累计挂网次数');
|
|
|
- $sheet->setCellValue('K2', '连续挂网次数');
|
|
|
- $sheet->setCellValue('L2', '链接地址');
|
|
|
- $sheet->setCellValue('M2', '店铺名称');
|
|
|
- $sheet->setCellValue('N2', '公司名称');
|
|
|
- $sheet->setCellValue('O2', '公司分类');
|
|
|
- $sheet->setCellValue('P2', '信用代码');
|
|
|
- $sheet->setCellValue('Q2', '省份');
|
|
|
- $sheet->setCellValue('R2', '城市');
|
|
|
- $sheet->setCellValue('S2', '溯源责任人');
|
|
|
- $sheet->setCellValue('T2', '处理状态');
|
|
|
- $sheet->setCellValue('U2', '任务状态');
|
|
|
- $sheet->setCellValue('V2', '记录时间');
|
|
|
- $sheet->setCellValue('W2', '发货省份');
|
|
|
- $sheet->setCellValue('X2', '发货城市');
|
|
|
-
|
|
|
- $platform_data = [
|
|
|
- '0' => '全部',
|
|
|
- '1' => '淘宝',
|
|
|
- '2' => '京东',
|
|
|
- '3' => '拼多多',
|
|
|
- '4' => '美团',
|
|
|
- '5' => '药师帮',
|
|
|
- '6' => '1药城',
|
|
|
- '7' => '药久久',
|
|
|
- ];
|
|
|
- $processing_status_text = [
|
|
|
- '1' => '待处理',
|
|
|
+ $violation_product_where['company_id'] = $message_data['admin_company_id'];
|
|
|
+ }
|
|
|
+ $key_name = 'ExportViolationProductJobs_' . $violation_product_where['company_id'];
|
|
|
+ $export_data_info = Cache::get($key_name);
|
|
|
+ if ($export_data_info) return json_send(['code' => 'fail', 'msg' => '导出任务正在执行中,请稍后再试', 'data' => '']);
|
|
|
+
|
|
|
+
|
|
|
+ // 生成唯一文件ID
|
|
|
+ $fileId = make_snow_flake();
|
|
|
+ $message_data['file_id'] = $fileId;
|
|
|
+ $fileName = '违规挂网商品导出_' . date('Y-m-d H:i:s', time()) . '.xlsx';
|
|
|
+ $downloadLog = [
|
|
|
+ 'insert_time' => time(),
|
|
|
+ 'company_id' => $violation_product_where['company_id'],
|
|
|
+ 'operator_userid' => $message_data['user_id'],
|
|
|
+ 'file_name' => $fileName,
|
|
|
+ 'file_id' => $fileId,
|
|
|
+ 'url' => '',
|
|
|
];
|
|
|
- $status_text = [
|
|
|
- '0' => '有效',
|
|
|
- '1' => '无效',
|
|
|
- ];
|
|
|
- // 填充数据
|
|
|
- $row = 3; // 从第2行开始
|
|
|
- foreach ($data as $item) {
|
|
|
- $first_responsible_person_name = !empty($item['first_responsible_person_name']) ? implode(',', $item['first_responsible_person_name']) : '';
|
|
|
- $responsible_person_name = !empty($item['responsible_person_name']) ? implode(',', $item['responsible_person_name']) : '';
|
|
|
- $source_responsible_person_name = !empty($item['source_responsible_person_name']) ? implode(',', $item['source_responsible_person_name']) : '';
|
|
|
- $sheet->setCellValue('A' . $row, $first_responsible_person_name);
|
|
|
- $sheet->setCellValue('B' . $row, $responsible_person_name);
|
|
|
- $sheet->setCellValue('C' . $row, isset($platform_data[$item['platform']]) ? $platform_data[$item['platform']] : '');
|
|
|
- $sheet->setCellValue('D' . $row, $item['category_name']);
|
|
|
- $sheet->setCellValue('E' . $row, $item['product_name']);
|
|
|
- $sheet->setCellValue('F' . $row, $item['inventory']);
|
|
|
- $sheet->setCellValue('G' . $row, $item['sales']);
|
|
|
- $sheet->setCellValue('H' . $row, $item['snapshot_url']);
|
|
|
- $sheet->setCellValue('I' . $row, $item['product_specs']);
|
|
|
- $sheet->setCellValue('J' . $row, $item['online_posting_count']);
|
|
|
- $sheet->setCellValue('K' . $row, $item['continuous_listing_count']);
|
|
|
- $sheet->setCellValue('L' . $row, $item['link_url']);
|
|
|
- $sheet->setCellValue('M' . $row, $item['store_name']);
|
|
|
- $sheet->setCellValue('N' . $row, $item['company_name']);
|
|
|
- $sheet->setCellValue('O' . $row, $item['company_category_name']);
|
|
|
- $sheet->setCellValue('P' . $row, $item['social_credit_code']);
|
|
|
- $sheet->setCellValue('Q' . $row, $item['province_name']);
|
|
|
- $sheet->setCellValue('R' . $row, $item['city_name']);
|
|
|
- $sheet->setCellValue('S' . $row, $source_responsible_person_name);
|
|
|
- $sheet->setCellValue('T' . $row, isset($processing_status_text[$item['processing_status']]) ? $processing_status_text[$item['processing_status']] : '');
|
|
|
- $sheet->setCellValue('U' . $row, isset($status_text[$item['status']]) ? $status_text[$item['status']] : '');
|
|
|
- $sheet->setCellValue('V' . $row, date('Y-m-d H:i:s', $item['insert_time']));
|
|
|
- $sheet->setCellValue('W' . $row, $item['shipment_city_name']);
|
|
|
- $sheet->setCellValue('X' . $row, $item['shipment_city_name']);
|
|
|
- $row++;
|
|
|
- }
|
|
|
- foreach (range('A', 'P') as $column) {
|
|
|
- $sheet->getColumnDimension($column)->setAutoSize(true);
|
|
|
- }
|
|
|
- // 生成 Excel 文件
|
|
|
- $writer = new Xlsx($spreadsheet);
|
|
|
-
|
|
|
- // 直接输出到浏览器(下载)
|
|
|
- $filename = '禁止挂网商品数据' . date('YmdHis') . '.xlsx';
|
|
|
- header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
|
- header('Content-Disposition: attachment;filename="' . $filename . '"');
|
|
|
- header('Cache-Control: max-age=0');
|
|
|
- $writer->save('php://output');
|
|
|
- exit;
|
|
|
+ // 写入数据表
|
|
|
+ $result = $DownloadTaskModel->insertGetId($downloadLog);
|
|
|
+ if(!$result) return json_send(['code' => 'fail', 'msg' => '导出任务添加失败', 'data' => '']);
|
|
|
+ ExportViolationProductJobs::dispatch($message_data);
|
|
|
+ // ExportViolationProductJobs::dispatchSync($message_data);
|
|
|
+ return json_send(['code' => 'success', 'msg' => '导出任务添加成功', 'data' => '']);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1008,17 +735,17 @@ class ViolationProduct extends Controller
|
|
|
$shipment_province_name = $shipment_province_name . '省';
|
|
|
}
|
|
|
}
|
|
|
- $shipment_province_id ='0';
|
|
|
- if (!isset($province_id_data[$shipment_province_name])){
|
|
|
+ $shipment_province_id = '0';
|
|
|
+ if (!isset($province_id_data[$shipment_province_name])) {
|
|
|
$shipment_province_name = '';
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$shipment_province_id = $province_id_data[$shipment_province_name]['id'];
|
|
|
}
|
|
|
$shipment_city_id = '0';
|
|
|
$shipment_city_name = isset($item[21]) ? $item[21] : '';
|
|
|
- if (!isset($city_id_data[$shipment_city_name])){
|
|
|
+ if (!isset($city_id_data[$shipment_city_name])) {
|
|
|
$shipment_city_name = '';
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$shipment_city_id = $city_id_data[$shipment_city_name]['id'];
|
|
|
}
|
|
|
|