|
@@ -145,6 +145,40 @@ class Talent extends AdminController {
|
|
|
return json(["code" => 200, "obj" => VerifyApi::getPublicList($params)]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 预备人才库-核查征信
|
|
|
+ * @auth {{/talentInfo/prepareHczx}}
|
|
|
+ */
|
|
|
+ public function prepareHczx() {
|
|
|
+ $ids = $this->request->param("ids");
|
|
|
+ $ids_arr = array_filter(explode(",", $ids));
|
|
|
+ if (!$ids_arr) {
|
|
|
+ $res = ["code" => 500, "msg" => "没有选择导出的名单"];
|
|
|
+ echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
|
|
|
+ }
|
|
|
+ $where[] = ["ti.id", "in", $ids_arr];
|
|
|
+ $list = TalentModel::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->field("ti.name,ti.card_type,ti.card_number,e.name as enterpriseName,e.description")->where($where)->select();
|
|
|
+ if (!$list) {
|
|
|
+ $res = ["code" => 500, "msg" => "没有可以导出的内容"];
|
|
|
+ echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
|
|
|
+ }
|
|
|
+ $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "备注"];
|
|
|
+ $rows = [];
|
|
|
+ $i = 1;
|
|
|
+ $card_types = DictApi::selectByParentCode("card_type");
|
|
|
+ foreach ($list as $item) {
|
|
|
+ $row = [
|
|
|
+ $i, $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], $item["description"]
|
|
|
+ ];
|
|
|
+ $rows[] = $row;
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ $filename = "优秀人才核查征信名单导出";
|
|
|
+ if ($rows) {
|
|
|
+ export($columns, $rows, $filename);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 预备人才库-征信通过
|
|
|
* @auth {{/talentInfo/hczxPass}}
|
|
@@ -172,7 +206,7 @@ class Talent extends AdminController {
|
|
|
$error++;
|
|
|
}
|
|
|
}
|
|
|
- return json(["code" => 200, "msg" => sprintf("核查征信成功:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
+ return json(["code" => 200, "msg" => sprintf("核查征信完成:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -191,8 +225,10 @@ class Talent extends AdminController {
|
|
|
if ($talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
return json(["msg" => "当前记录不是待核查征信状态,无法核查"]);
|
|
|
}
|
|
|
- VerifyApi::setPublic($id, $state, $msg);
|
|
|
- return json(["code" => 200, "msg" => "已设置征信失信"]);
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg)) {
|
|
|
+ return json(["code" => 200, "msg" => "已设置征信失信"]);
|
|
|
+ }
|
|
|
+ return json(["msg" => "设置征信失信失败"]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -212,8 +248,9 @@ class Talent extends AdminController {
|
|
|
foreach ($list as $item) {
|
|
|
$talent_condition = TalentConditionApi::getOne($item["talent_condition"]);
|
|
|
$enterprise = EnterpriseApi::getOne($item["enterprise_id"]);
|
|
|
+ $checkLog = TalentLogApi::getLastLog($item["id"], 1);
|
|
|
$row = [
|
|
|
- $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == 11 ? "审核通过" : "审核不通过", $enterprise["description"]
|
|
|
+ $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::ZX_PASS ? "审核通过" : "审核不通过", $checkLog["description"]
|
|
|
];
|
|
|
$rows[] = $row;
|
|
|
$i++;
|
|
@@ -282,8 +319,10 @@ class Talent extends AdminController {
|
|
|
if ($talent_info["checkState"] != TalentState::ANNOUNCED) {
|
|
|
return json(["msg" => "当前记录不是公示状态,无法审核"]);
|
|
|
}
|
|
|
- VerifyApi::setPublic($id, $state, $msg);
|
|
|
- return json(["code" => 200, "msg" => "公示再审核完成"]);
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg)) {
|
|
|
+ return json(["code" => 200, "msg" => "公示再审核完成"]);
|
|
|
+ }
|
|
|
+ return json(["msg" => "公示再审核失败"]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -312,15 +351,119 @@ class Talent extends AdminController {
|
|
|
$error++;
|
|
|
}
|
|
|
}
|
|
|
- return json(["code" => 200, "msg" => sprintf("公示完成:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
+ return json(["code" => 200, "msg" => sprintf("公示再审核完成:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预备人才库-公布预览
|
|
|
+ * @auth {{/talentInfo/publishExportBefore}}
|
|
|
+ */
|
|
|
+ public function publishExportBefore() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $ids = $params["ids"];
|
|
|
+ $ids = array_filter(explode(",", $ids));
|
|
|
+ if ($ids) {
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
+ $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select();
|
|
|
+ $rows = [];
|
|
|
+ $i = 1;
|
|
|
+ $talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
|
+ foreach ($list as $item) {
|
|
|
+ $talent_condition = TalentConditionApi::getOne($item["talent_condition"]);
|
|
|
+ $enterprise = EnterpriseApi::getOne($item["enterprise_id"]);
|
|
|
+ $checkLog = TalentLogApi::getLastLog($item["id"], 1);
|
|
|
+ $row = [
|
|
|
+ $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == TalentState::ANNOUNCED_REVERIFY_PASS ? "审核通过" : "审核不通过", $checkLog["description"]
|
|
|
+ ];
|
|
|
+ $rows[] = $row;
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"];
|
|
|
+ $filename = "优秀人才" . date("Ym") . "公布名单导出(公示批次-" . $list[0]["publicBatch"] . ")";
|
|
|
+ if ($rows) {
|
|
|
+ export($columns, $rows, $filename);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 预备人才库-公布
|
|
|
+ * @auth {{/talentInfo/publish}}
|
|
|
+ */
|
|
|
+ public function publish() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $id = $params["id"];
|
|
|
+ $msg = $params["checkMsg"];
|
|
|
+ $checkState = $params["checkState"];
|
|
|
+ $batch = $params["batch"];
|
|
|
+ if ($checkState == 1) {
|
|
|
+ $state = TalentState::PUBLISH_PASS;
|
|
|
+ $msg = "公布审核通过:" . $msg;
|
|
|
+ } else {
|
|
|
+ $state = TalentState::PUBLISH_FAIL;
|
|
|
+ $msg = "公布审核不通过:" . $msg;
|
|
|
+ }
|
|
|
+ if (!$batch || !strtotime($batch))
|
|
|
+ return json(["msg" => "公布批次时间错误"]);
|
|
|
+ if (!$msg)
|
|
|
+ return json(["msg" => "请填写审核意见"]);
|
|
|
+ $state = TalentState::PUBLISH_PASS; //公示再审核通过
|
|
|
+ $batch = $params["batch"];
|
|
|
+ if (!strtotime($batch))
|
|
|
+ return json(["msg" => "公布批次时间错误"]);
|
|
|
+ $talent_info = VerifyApi::getOne($id);
|
|
|
+ if ($talent_info["checkState"] != TalentState::ANNOUNCED_REVERIFY_PASS) {
|
|
|
+ return json(["msg" => "当前记录不是公示再审核通过状态,无法审核"]);
|
|
|
+ }
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg, $batch)) {
|
|
|
+ return json(["code" => 200, "msg" => "公布审核完成"]);
|
|
|
+ }
|
|
|
+ return json(["msg" => "公布审核失败"]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 预备人才库-批量公布通过
|
|
|
* @auth {{/talentInfo/preparePublish}}
|
|
|
*/
|
|
|
- public function pre_publish() {
|
|
|
-
|
|
|
+ public function preparePublish() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $ids = $params["ids"];
|
|
|
+ $ids = array_filter(explode(",", $ids));
|
|
|
+ $msg = "批量公布";
|
|
|
+ $state = TalentState::PUBLISH_PASS; //公示再审核通过
|
|
|
+ $batch = $params["batch"];
|
|
|
+ if (!strtotime($batch))
|
|
|
+ return json(["msg" => "公布批次时间错误"]);
|
|
|
+ $total = count($ids);
|
|
|
+ $error = 0;
|
|
|
+ $success = 0;
|
|
|
+ foreach ($ids as $id) {
|
|
|
+ $talent_info = VerifyApi::getOne($id);
|
|
|
+ if ($talent_info["checkState"] != TalentState::ANNOUNCED_REVERIFY_PASS) {
|
|
|
+ $error++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (VerifyApi::setPublic($id, $state, $msg, $batch)) {
|
|
|
+ $success++;
|
|
|
+ } else {
|
|
|
+ $error++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json(["code" => 200, "msg" => sprintf("公布完成:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function sendCard() {
|
|
|
+ //查询所有待发证的数据
|
|
|
+ $params = $this->request->param();
|
|
|
+ $ids = array_filter(explode(",", $params["ids"]));
|
|
|
+ $talent_list = VerifyApi::getListByIds($ids);
|
|
|
+ //晋江市优秀人才证书:当前年份+层次+四位递增数字
|
|
|
+ //集成电路优秀人才证书:IC+当前年份+递增四位数,如IC20190001
|
|
|
+ $year = date("Y");
|
|
|
+ foreach ($talent_list as $talent_info) {
|
|
|
+ $no_prefix = $year . $talent_info["talent_arrange"];
|
|
|
+ }
|
|
|
+ return new ResponseObj(ResponseObj . SUCCESS, "发证成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -347,14 +490,6 @@ class Talent extends AdminController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 预备人才库-公布预览
|
|
|
- * @auth {{/talentInfo/publishExportBefore}}
|
|
|
- */
|
|
|
- public function pre_publish_preview() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 基本条件审核-提交未保存
|
|
|
* @param \think\Request $request
|
|
@@ -764,40 +899,6 @@ class Talent extends AdminController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 预备人才库-核查征信
|
|
|
- * @auth {{/talentInfo/prepareHczx}}
|
|
|
- */
|
|
|
- public function exportHczx() {
|
|
|
- $ids = $this->request->param("ids");
|
|
|
- $ids_arr = array_filter(explode(",", $ids));
|
|
|
- if (!$ids_arr) {
|
|
|
- $res = ["code" => 500, "msg" => "没有选择导出的名单"];
|
|
|
- echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
|
|
|
- }
|
|
|
- $where[] = ["ti.id", "in", $ids_arr];
|
|
|
- $list = TalentModel::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->field("ti.name,ti.card_type,ti.card_number,e.name as enterpriseName,e.description")->where($where)->select();
|
|
|
- if (!$list) {
|
|
|
- $res = ["code" => 500, "msg" => "没有可以导出的内容"];
|
|
|
- echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
|
|
|
- }
|
|
|
- $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "备注"];
|
|
|
- $rows = [];
|
|
|
- $i = 1;
|
|
|
- $card_types = DictApi::selectByParentCode("card_type");
|
|
|
- foreach ($list as $item) {
|
|
|
- $row = [
|
|
|
- $i, $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], $item["description"]
|
|
|
- ];
|
|
|
- $rows[] = $row;
|
|
|
- $i++;
|
|
|
- }
|
|
|
- $filename = "优秀人才核查征信名单导出";
|
|
|
- if ($rows) {
|
|
|
- export($columns, $rows, $filename);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public function commonExport() {
|
|
|
$params = $this->request->param();
|
|
|
$fields = $params["export"];
|