|
@@ -9,6 +9,7 @@ use app\common\api\TalentState;
|
|
|
use app\enterprise\model\Talent as TalentModel;
|
|
|
use app\common\api\TalentConditionApi;
|
|
|
use app\common\api\DictApi;
|
|
|
+use app\common\api\EnterpriseApi;
|
|
|
|
|
|
/**
|
|
|
* Description of Talent
|
|
@@ -19,7 +20,7 @@ class Talent extends AdminController {
|
|
|
|
|
|
public function selectNeedCheckData() {
|
|
|
$params = $this->request->param();
|
|
|
- return json(VerifyApi::getPublicList($params));
|
|
|
+ return json(["code" => 200, "obj" => VerifyApi::getPublicList($params)]);
|
|
|
}
|
|
|
|
|
|
public function common_check() {
|
|
@@ -164,16 +165,75 @@ class Talent extends AdminController {
|
|
|
* 预备人才库-征信通过
|
|
|
* @auth {{/talentInfo/hczxPass}}
|
|
|
*/
|
|
|
- public function pre_zx_pass() {
|
|
|
-
|
|
|
+ public function hczxPass() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $ids = $params["ids"];
|
|
|
+ $ids = array_filter(explode(",", $ids));
|
|
|
+
|
|
|
+ $msg = "征信通过";
|
|
|
+ $state = 2; //征信核查
|
|
|
+ $pass = true;
|
|
|
+
|
|
|
+ $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) {
|
|
|
+ $error++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (VerifyApi::setPublic($id, $state, $pass, $msg)) {
|
|
|
+ $success++;
|
|
|
+ } else {
|
|
|
+ $error++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json(["code" => 200, "msg" => sprintf("核查征信成功:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 预备人才库-征信失信
|
|
|
* @auth {{/talentInfo/hczxReject}}
|
|
|
*/
|
|
|
- public function pre_zx_reject() {
|
|
|
-
|
|
|
+ public function hczxReject() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $id = $params["id"];
|
|
|
+ $msg = "征信失信:" . $params["outMsg"];
|
|
|
+ $state = 2; //征信核查
|
|
|
+ $pass = false;
|
|
|
+ $talent_info = VerifyApi::getOne($id);
|
|
|
+ if ($talent_info["isPublic"] != 1 || $talent_info["checkState"] != TalentState::REVERIFY_PASS) {
|
|
|
+ return json(["msg" => "当前记录不是待核查征信状态,无法核查"]);
|
|
|
+ }
|
|
|
+ VerifyApi::setPublic($id, $state, $pass, $msg);
|
|
|
+ return json(["code" => 200, "msg" => "已设置征信失信"]);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function exportPublic() {
|
|
|
+ $params = $this->request->param();
|
|
|
+ $ids_arr = array_filter(explode(",", $params["ids"]));
|
|
|
+ $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
|
+ if ($ids_arr) {
|
|
|
+ $where[] = ["id", "in", $ids_arr];
|
|
|
+ $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"]);
|
|
|
+ $row = [
|
|
|
+ $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == 11 ? "审核通过" : "审核不通过", $enterprise["description"]
|
|
|
+ ];
|
|
|
+ $rows[] = $row;
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($rows) {
|
|
|
+ $filename = "优秀人才公示预览导出";
|
|
|
+ export($columns, $rows, $filename);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -184,14 +244,6 @@ class Talent extends AdminController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 预备人才库-公示通过
|
|
|
- * @auth {{/talentInfo/publicPass}}
|
|
|
- */
|
|
|
- public function pre_public_pass() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 预备人才库-公布
|
|
|
* @auth {{/talentInfo/preparePublish}}
|
|
@@ -281,8 +333,13 @@ class Talent extends AdminController {
|
|
|
private function fstCheck(\think\Request $request, $talent_info) {
|
|
|
$params = $request->param();
|
|
|
if ($params["checkState"] == 3) {
|
|
|
- //审核成功
|
|
|
+ //审核成功,并取消设置越过部门并审
|
|
|
+ $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
+ $data["pass_dept_check"] = 0;
|
|
|
+ } else if ($params["checkState"] == 4) {
|
|
|
+ //审核成功,并设置越过部门并审。附加条件:最高进度曾经超过初审2(包含初审,因为再次初审也就证明从上面驳回过,这步是防止前端改checkState=4进来)
|
|
|
$log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
+ $data["pass_dept_check"] = $talent_info["highProcess"] >= 2 ? 1 : 0;
|
|
|
} else {
|
|
|
//审核驳回并记录需要修改的字段和上传文件
|
|
|
$checkState = TalentState::SCND_SAVE; //退回材料编辑状态
|
|
@@ -316,16 +373,16 @@ class Talent extends AdminController {
|
|
|
if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
|
|
|
$data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
|
|
|
}
|
|
|
+ if ($log["new_state"] == TalentState::FST_VERIFY_PASS && $talent_info["pass_dept_check"] == 0) {
|
|
|
+ $data["first_dept_check_time"] = date("Y-m-d H:i:s");
|
|
|
+ $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
+ $companyIds = array_filter(explode(",", $condition["companyIds"]));
|
|
|
+ TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
|
|
|
+ }
|
|
|
$data["id"] = $talent_info["id"];
|
|
|
$data["checkState"] = $log["new_state"];
|
|
|
- $data["first_dept_check_time"] = date("Y-m-d H:i:s");
|
|
|
TalentModel::update($data);
|
|
|
TalentLogApi::setActive($log["id"], 1);
|
|
|
- $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- $companyIds = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- if ($log["new_state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
- TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
|
|
|
- }
|
|
|
return json(["code" => 200, "msg" => "审核成功"]);
|
|
|
}
|
|
|
|
|
@@ -336,6 +393,9 @@ class Talent extends AdminController {
|
|
|
* @return type json
|
|
|
*/
|
|
|
private function deptCheck(\think\Request $request, $talent_info, $companys) {
|
|
|
+ if ($talent_info["pass_dept_check"] == 1)
|
|
|
+ return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
|
|
|
+
|
|
|
$params = $request->param();
|
|
|
if ($params["checkState"] == 3) {
|
|
|
//审核成功
|
|
@@ -368,6 +428,9 @@ class Talent extends AdminController {
|
|
|
* @return type json
|
|
|
*/
|
|
|
private function deptSubmitCheck($talent_info, $companys) {
|
|
|
+ if ($talent_info["pass_dept_check"] == 1)
|
|
|
+ return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
|
|
|
+
|
|
|
$dept_log = TalentLogApi::getLogByCompanyId($talent_info["id"], $this->user["companyId"], $talent_info["first_dept_check_time"]);
|
|
|
|
|
|
$over = 0; //完成度
|
|
@@ -490,7 +553,7 @@ class Talent extends AdminController {
|
|
|
} else if ($checkState == TalentState::FST_VERIFY_PASS) {
|
|
|
$condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
$companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- if ($companys) {
|
|
|
+ if ($companys && $talent_info["pass_dept_check"] != 1) {
|
|
|
if (!in_array($this->user["companyId"], $companys))
|
|
|
return json(["msg" => "你的部门不在并审部门列表"]);
|
|
|
return $this->deptCheck($request, $talent_info, $companys);
|
|
@@ -519,7 +582,7 @@ class Talent extends AdminController {
|
|
|
} else if ($checkState == TalentState::FST_VERIFY_PASS) {
|
|
|
$condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
$companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- if ($companys) {
|
|
|
+ if ($companys && $talent_info["pass_dept_check"] != 1) {
|
|
|
if (!in_array($this->user["companyId"], $companys))
|
|
|
return json(["msg" => "你的部门不在并审部门列表"]);
|
|
|
return $this->deptSubmitCheck($talent_info, $companys);
|
|
@@ -562,8 +625,13 @@ class Talent extends AdminController {
|
|
|
$process = 2;
|
|
|
break;
|
|
|
case 7:
|
|
|
+ $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
+ if ($tc["companyId"] && $talent_info["pass_dept_check"] != 1) {
|
|
|
+ $process = 3;
|
|
|
+ } else {
|
|
|
+ $process = 4;
|
|
|
+ }
|
|
|
$fields = DictApi::getTalentFields(3);
|
|
|
- $process = 3;
|
|
|
break;
|
|
|
case 9:
|
|
|
$fields = DictApi::getTalentFields(3);
|
|
@@ -604,6 +672,34 @@ class Talent extends AdminController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ 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 = "优秀人才核查征信名单导出";
|
|
|
+ export($columns, $rows, $filename);
|
|
|
+ }
|
|
|
+
|
|
|
public function commonExport() {
|
|
|
$params = $this->request->param();
|
|
|
$fields = $params["export"];
|
|
@@ -633,13 +729,29 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
|
|
|
public function getPhones() {
|
|
|
- $list = VerifyApi::getList($this->request);
|
|
|
- $phones = array_column($list["rows"], "phone");
|
|
|
- return json(["code" => 200, "obj" => implode(",", $phones)]);
|
|
|
+ $list = VerifyApi::getListByProcess($this->request->param("process"));
|
|
|
+ $result = [];
|
|
|
+ if ($list) {
|
|
|
+ foreach ($list as $item) {
|
|
|
+ if ($item["phone"] && $item["name"]) {
|
|
|
+ $result[] = sprintf("%s:%s", $item["name"], $item["phone"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json(["code" => 200, "obj" => implode(";", $result)]);
|
|
|
}
|
|
|
|
|
|
public function getEnterprisePhones() {
|
|
|
- return json(["code" => 200, "obj" => $phones]);
|
|
|
+ $list = VerifyApi::getListByProcess($this->request->param("process"));
|
|
|
+ $result = [];
|
|
|
+ if ($list) {
|
|
|
+ foreach ($list as $item) {
|
|
|
+ if ($item["agentName"] && $item["agentPhone"]) {
|
|
|
+ $result[] = sprintf("%s:%s", $item["agentName"], $item["agentPhone"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return json(["code" => 200, "obj" => implode(";", $result)]);
|
|
|
}
|
|
|
|
|
|
}
|