|
@@ -37,7 +37,6 @@ class Import {
|
|
|
* @return bool
|
|
|
*/
|
|
|
public function deal($data): bool {
|
|
|
-
|
|
|
if ($data['type'] == 1) {//企业导入
|
|
|
$id = $data['id'];
|
|
|
$res = Db::table("new_talent_zhiren")->where('id', $id)->findOrEmpty();
|
|
@@ -169,6 +168,7 @@ class Import {
|
|
|
Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $res['task_file'], 'task_status' => 1, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return true;
|
|
|
} catch (\Exception $e) {
|
|
|
+ var_dump($e->getMessage());
|
|
|
Db::table("new_talent_zhiren")->where('id', $data['id'])->update(['task_result' => $e->getMessage(), 'status' => 0, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return false;
|
|
|
}
|
|
@@ -324,6 +324,7 @@ class Import {
|
|
|
Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $res['task_file'], 'task_status' => 1, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return true;
|
|
|
} catch (\Exception $e) {
|
|
|
+ var_dump($e->getMessage());
|
|
|
Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $e->getMessage(), 'task_status' => 0, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return false;
|
|
|
}
|
|
@@ -409,10 +410,11 @@ class Import {
|
|
|
if (empty($row[$i])) {
|
|
|
array_push($msg, "证件号码不能为空");
|
|
|
} else {
|
|
|
+
|
|
|
if (!isCreditNo($row[$i]) && $item['card_type'] == 1) {
|
|
|
array_push($msg, "证件号码不正确");
|
|
|
}
|
|
|
- $talent_info = Db::table("new_talent_info")->where("card_number", $row[$i])->where('apply_year',$batch["batch"])->findOrEmpty();
|
|
|
+ $talent_info = Db::table("new_talent_info")->where("card_number", $row[$i])->where('apply_year',$batch["batch"])->where('delete',0)->findOrEmpty();
|
|
|
if ($talent_info) {
|
|
|
$action = 'update';
|
|
|
}
|
|
@@ -470,13 +472,15 @@ class Import {
|
|
|
$item['updateTime'] = date("Y-m-d H:i:s", time());
|
|
|
Db::table("new_talent_info")->where('id', $talent_info['id'])->update($item);
|
|
|
$sheet->setCellValue('AC' . ($index + 2), '更新成功');
|
|
|
+ $log = TalentLogApi::system(1, $talent_info["id"],8,"直认数据导入",1);
|
|
|
} else {
|
|
|
$item['apply_year'] = $batch["batch"];
|
|
|
$item['createTime'] = date("Y-m-d H:i:s", time());
|
|
|
- Db::table("new_talent_info")->insert($item);
|
|
|
+ $talent_info_id = Db::table("new_talent_info")->insertGetId($item);
|
|
|
$sheet->setCellValue('AC' . ($index + 2), '导入成功');
|
|
|
+ $log = TalentLogApi::system(1, $talent_info_id,8,"直认数据导入",1);
|
|
|
}
|
|
|
- $log = TalentLogApi::system(1, $talent_info["id"],8,"直认数据导入",1);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -485,7 +489,7 @@ class Import {
|
|
|
Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $res['task_file'], 'task_status' => 1, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return true;
|
|
|
} catch (\Exception $e) {
|
|
|
-
|
|
|
+ var_dump($e->getMessage());
|
|
|
Db::table("new_talent_zhiren")->where('id', $id)->update(['task_result' => $e->getMessage(), 'task_status' => 0, 'updateTime' => date("Y-m-d H:i:s", time())]);
|
|
|
return false;
|
|
|
}
|