|
@@ -171,19 +171,18 @@ class Talent extends AdminController {
|
|
|
$ids = array_filter(explode(",", $ids));
|
|
|
|
|
|
$msg = "征信通过";
|
|
|
- $state = 2; //征信核查
|
|
|
- $pass = true;
|
|
|
+ $state = TalentState::ZX_PASS; //征信通过
|
|
|
|
|
|
$total = count($ids);
|
|
|
$error = 0;
|
|
|
$success = 0;
|
|
|
foreach ($ids as $id) {
|
|
|
$talent_info = VerifyApi::getOne($id);
|
|
|
- if ($talent_info["isPublic"] != 1 || $talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
+ if ($talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
$error++;
|
|
|
continue;
|
|
|
}
|
|
|
- if (VerifyApi::setPublic($id, $state, $pass, $msg)) {
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg)) {
|
|
|
$success++;
|
|
|
} else {
|
|
|
$error++;
|
|
@@ -200,16 +199,18 @@ class Talent extends AdminController {
|
|
|
$params = $this->request->param();
|
|
|
$id = $params["id"];
|
|
|
$msg = "征信失信:" . $params["outMsg"];
|
|
|
- $state = 2; //征信核查
|
|
|
- $pass = false;
|
|
|
+ $state = TalentState::ZX_FAIL; //征信不通过
|
|
|
$talent_info = VerifyApi::getOne($id);
|
|
|
- if ($talent_info["isPublic"] != 1 || $talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
+ if ($talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
return json(["msg" => "当前记录不是待核查征信状态,无法核查"]);
|
|
|
}
|
|
|
- VerifyApi::setPublic($id, $state, $pass, $msg);
|
|
|
+ VerifyApi::setPublic($id, $state, $msg);
|
|
|
return json(["code" => 200, "msg" => "已设置征信失信"]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 公示预览导出
|
|
|
+ */
|
|
|
public function exportPublic() {
|
|
|
$params = $this->request->param();
|
|
|
$ids_arr = array_filter(explode(",", $params["ids"]));
|
|
@@ -232,11 +233,42 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
if ($rows) {
|
|
|
$filename = "优秀人才公示预览导出";
|
|
|
- $settings = [
|
|
|
- "background-color" => ["A1:A10" => "ff0000"]
|
|
|
- ];
|
|
|
- export($columns, $rows, $filename, $settings);
|
|
|
+ export($columns, $rows, $filename);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公示
|
|
|
+ */
|
|
|
+ public function publicBatch() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $isMessage = $params["isMessage"] ?: 2;
|
|
|
+ $ids = $params["ids"];
|
|
|
+ $publicBatch = $params["batch"];
|
|
|
+ if (!$publicBatch || strlen($publicBatch) != 6 || !is_numeric($publicBatch))
|
|
|
+ return json(["msg" => "公示批次错误"]);
|
|
|
+
|
|
|
+ $ids = array_filter(explode(",", $ids));
|
|
|
+
|
|
|
+ $msg = "已公示";
|
|
|
+ $state = TalentState::ANNOUNCED; //公示
|
|
|
+
|
|
|
+ $total = count($ids);
|
|
|
+ $error = 0;
|
|
|
+ $success = 0;
|
|
|
+ foreach ($ids as $id) {
|
|
|
+ $talent_info = VerifyApi::getOne($id);
|
|
|
+ if ($talent_info["checkState"] != TalentState::ZX_PASS) {
|
|
|
+ $error++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg, $publicBatch)) {
|
|
|
+ $success++;
|
|
|
+ } else {
|
|
|
+ $error++;
|
|
|
+ }
|
|
|
}
|
|
|
+ return json(["code" => 200, "msg" => sprintf("公示完成:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -722,7 +754,7 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
$filename = "优秀人才核查征信名单导出";
|
|
|
if ($rows) {
|
|
|
- export($columns, $rows, $filename, getCommonExcelSetting(count($columns), count($rows)));
|
|
|
+ export($columns, $rows, $filename);
|
|
|
}
|
|
|
}
|
|
|
|