|
@@ -781,6 +781,7 @@ class ViolationProduct extends Controller
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
|
try {
|
|
try {
|
|
|
foreach ($data as $key => $item) {
|
|
foreach ($data as $key => $item) {
|
|
|
|
|
+ $key_num = $key + 1;
|
|
|
if ($key < 2) continue;
|
|
if ($key < 2) continue;
|
|
|
//强制必传参数校验
|
|
//强制必传参数校验
|
|
|
$res_data = $this->import_data_check($key, $item);
|
|
$res_data = $this->import_data_check($key, $item);
|
|
@@ -821,6 +822,7 @@ class ViolationProduct extends Controller
|
|
|
$province_name = $province_name . '省';
|
|
$province_name = $province_name . '省';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!isset($city_id_data[$province_name])) return json_send(['code' => 'error', 'msg' => "第{$key_num}行省份信息错误", 'data' => '']);
|
|
|
$city_name = $item[14];
|
|
$city_name = $item[14];
|
|
|
if ($city_name && !strpos($city_name, '市')) {
|
|
if ($city_name && !strpos($city_name, '市')) {
|
|
|
$city_name = $city_name . '市';
|
|
$city_name = $city_name . '市';
|
|
@@ -831,6 +833,7 @@ class ViolationProduct extends Controller
|
|
|
} else {
|
|
} else {
|
|
|
$insert_product_data['company_id'] = $admin_company_id;
|
|
$insert_product_data['company_id'] = $admin_company_id;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!isset($city_id_data[$city_name])) return json_send(['code' => 'error', 'msg' => "第{$key_num}行城市信息错误", 'data' => '']);
|
|
|
$insert_product_data['first_responsible_person'] = !empty($first_responsible_person_id) ? implode(',', $first_responsible_person_id) : ''; //第一责任人ID集合
|
|
$insert_product_data['first_responsible_person'] = !empty($first_responsible_person_id) ? implode(',', $first_responsible_person_id) : ''; //第一责任人ID集合
|
|
|
$insert_product_data['responsible_person'] = !empty($responsible_person_id) ? implode(',', $responsible_person_id) : ''; //责任人ID集合
|
|
$insert_product_data['responsible_person'] = !empty($responsible_person_id) ? implode(',', $responsible_person_id) : ''; //责任人ID集合
|
|
|
$insert_product_data['platform'] = isset($platform_data[$item[2]]) ? $platform_data[$item[2]] : '0'; // 平台
|
|
$insert_product_data['platform'] = isset($platform_data[$item[2]]) ? $platform_data[$item[2]] : '0'; // 平台
|
|
@@ -895,13 +898,13 @@ class ViolationProduct extends Controller
|
|
|
if (!$item[10]) {
|
|
if (!$item[10]) {
|
|
|
return ['code' => 'error', 'msg' => "第{$key}行公司名称不能为空"];
|
|
return ['code' => 'error', 'msg' => "第{$key}行公司名称不能为空"];
|
|
|
}
|
|
}
|
|
|
- if (!$item[11]) {
|
|
|
|
|
|
|
+ if (!$item[12]) {
|
|
|
return ['code' => 'error', 'msg' => "第{$key}行信用代码不能为空"];
|
|
return ['code' => 'error', 'msg' => "第{$key}行信用代码不能为空"];
|
|
|
}
|
|
}
|
|
|
- if (!$item[12]) {
|
|
|
|
|
|
|
+ if (!$item[13]) {
|
|
|
return ['code' => 'error', 'msg' => "第{$key}行省份不能为空"];
|
|
return ['code' => 'error', 'msg' => "第{$key}行省份不能为空"];
|
|
|
}
|
|
}
|
|
|
- if (!$item[13]) {
|
|
|
|
|
|
|
+ if (!$item[14]) {
|
|
|
return ['code' => 'error', 'msg' => "第{$key}行城市不能为空"];
|
|
return ['code' => 'error', 'msg' => "第{$key}行城市不能为空"];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|