|
@@ -34,6 +34,7 @@ class Talent extends AdminController {
|
|
|
$request = $this->request;
|
|
|
$params = $request->param();
|
|
|
$id = $params["id"];
|
|
|
+ $process = $params["process"];
|
|
|
$info = VerifyApi::getTalentInfoById($id, true);
|
|
|
$force = intval($this->request['force'], 0);
|
|
|
$api_data = ApiData::where('uid', '=', $info['card_number'])->where('action', '=', 'rending')->where('status', '=', 1)->find(); //
|
|
@@ -56,7 +57,7 @@ class Talent extends AdminController {
|
|
|
$content = unserialize($api_data['content']);
|
|
|
$info['rs'] = $content;
|
|
|
}
|
|
|
-
|
|
|
+ $info["process"] = $process;
|
|
|
if (in_array($info["checkState"], [TalentState::BASE_VERIFY_FAIL, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_REJECT, TalentState::BASE_REVERIFY_FAIL])) {
|
|
|
return view("talentInfo_base_check", ["info" => $info]);
|
|
|
} else {
|
|
@@ -1362,6 +1363,7 @@ class Talent extends AdminController {
|
|
|
public function validateIsCheck() {
|
|
|
$params = $this->request->param();
|
|
|
$id = $params["id"];
|
|
|
+ $process = $params["process"];
|
|
|
$talent_info = VerifyApi::getOne($id);
|
|
|
$fstLog = TalentLogApi::getFstLog($id, 1);
|
|
|
$isMix = false;
|
|
@@ -1372,191 +1374,162 @@ class Talent extends AdminController {
|
|
|
$enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
|
|
|
if ($talent_info) {
|
|
|
$checkState = $talent_info["checkState"];
|
|
|
-// 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5基审复核通过 6基审复核驳回 7基审复核失败 8保存补充材料未提交 9提交补充材料进入初审 10初审通过 11初审驳回 12部门审核通过 13部门审核驳回 14复核通过 15复核驳回 16复核失败
|
|
|
+ if (!$process || ($process == 3 && $checkState != TalentState::SCND_SUBMIT) || ($process == 4 && $checkState != TalentState::FST_VERIFY_PASS) || ($process == 5 && $checkState != TalentState::DEPT_VERIFY_PASS)) {
|
|
|
+ return json(["msg" => "该申报不在审核范围内,无法审核"]);
|
|
|
+ }
|
|
|
$process = 0;
|
|
|
- if (in_array($checkState, [TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS])) {
|
|
|
- switch ($checkState) {
|
|
|
- case TalentState::FST_SUBMIT:
|
|
|
- $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
|
|
|
- $field_tmp = [];
|
|
|
- foreach ($fields as $key => $field) {
|
|
|
- $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
- }
|
|
|
- $where[] = ["project", "=", 1];
|
|
|
- $where[] = ["step", "=", 1];
|
|
|
- $where[] = ["active", "=", 1];
|
|
|
- $where[] = ["type", "=", $enterprise["type"]];
|
|
|
-
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
- /* foreach ($files as $key => $file) {
|
|
|
- $options = array_filter(explode(",", $file["option"]));
|
|
|
- if ($options) {
|
|
|
- switch ($file["rel"]) {
|
|
|
- case "talent_type":
|
|
|
- $allow_tags = array_filter(explode(",", $file["enterprise_tag"]));
|
|
|
- if ($allow_tags && !in_array($enterprise["enterpriseTag"], $allow_tags)) {
|
|
|
- unset($files[$key]);
|
|
|
- break;
|
|
|
- }
|
|
|
- if (!in_array($talent_info["talent_type"], $options)) {
|
|
|
- unset($files[$key]);
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "birthday":
|
|
|
- $birthYear = substr($talent_info["birthday"], 0, 4);
|
|
|
- $currentYear = date("Y");
|
|
|
- $age = $currentYear - $birthYear;
|
|
|
- if ($age < $options[0]) {
|
|
|
- unset($files[$key]);
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } */
|
|
|
- $process = 1;
|
|
|
- break;
|
|
|
- case TalentState::BASE_VERIFY_PASS:
|
|
|
- $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
|
|
|
- $field_tmp = [];
|
|
|
- foreach ($fields as $key => $field) {
|
|
|
- $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
- }
|
|
|
- $where[] = ["project", "=", 1];
|
|
|
- $where[] = ["step", "=", 1];
|
|
|
- $where[] = ["active", "=", 1];
|
|
|
- $where[] = ["type", "=", $enterprise["type"]];
|
|
|
-
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
- $process = 2;
|
|
|
- break;
|
|
|
- case TalentState::SCND_SUBMIT:
|
|
|
- $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
|
|
|
- $process = 3;
|
|
|
- break;
|
|
|
- case TalentState::FST_VERIFY_PASS:
|
|
|
- $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- if ($tc["companyIds"] && $talent_info["pass_dept_check"] != 1) {
|
|
|
- $process = 4;
|
|
|
- $fields = DictApi::getTalentFields(3, $talent_info["isImport"]);
|
|
|
- } else {
|
|
|
- $process = 5;
|
|
|
- $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
|
|
|
- }
|
|
|
- break;
|
|
|
- case TalentState::DEPT_VERIFY_PASS:
|
|
|
+ switch ($checkState) {
|
|
|
+ case TalentState::FST_SUBMIT:
|
|
|
+ $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
|
|
|
+ $field_tmp = [];
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
+ }
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["step", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["type", "=", $enterprise["type"]];
|
|
|
+
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
+ $process = 1;
|
|
|
+ break;
|
|
|
+ case TalentState::BASE_VERIFY_PASS:
|
|
|
+ $fields = DictApi::getTalentFields(1, $talent_info["isImport"]);
|
|
|
+ $field_tmp = [];
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
+ }
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["step", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["type", "=", $enterprise["type"]];
|
|
|
+
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
+ $process = 2;
|
|
|
+ break;
|
|
|
+ case TalentState::SCND_SUBMIT:
|
|
|
+ $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
|
|
|
+ $process = 3;
|
|
|
+ break;
|
|
|
+ case TalentState::FST_VERIFY_PASS:
|
|
|
+ $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
+ if ($tc["companyIds"] && $talent_info["pass_dept_check"] != 1) {
|
|
|
+ $process = 4;
|
|
|
+ $fields = DictApi::getTalentFields(3, $talent_info["isImport"]);
|
|
|
+ } else {
|
|
|
$process = 5;
|
|
|
$fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
|
|
|
- break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case TalentState::DEPT_VERIFY_PASS:
|
|
|
+ $process = 5;
|
|
|
+ $fields = DictApi::getTalentFields(2, $talent_info["isImport"]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if ($isMix && $process != 4) {
|
|
|
+ if ($enterprise["type"] == 2) {
|
|
|
+ $fields = DictApi::getTalentFields_IC();
|
|
|
+ } else {
|
|
|
+ $fields = DictApi::getTalentFields(4, $talent_info["isImport"]);
|
|
|
}
|
|
|
- if ($isMix && $process != 4) {
|
|
|
- if ($enterprise["type"] == 2) {
|
|
|
- $fields = DictApi::getTalentFields_IC();
|
|
|
- } else {
|
|
|
- $fields = DictApi::getTalentFields(4, $talent_info["isImport"]);
|
|
|
+ }
|
|
|
+ if ($fields["fst_work_time"] && in_array($enterprise['enterpriseTag'], ['mtdw', 'gyqyh', 'mbfqy', 'jrjg']) && $enterprise["type"] == 1) {
|
|
|
+ $fields["fst_work_time"] = $talent_info['talent_type'] == 1 ? "近三年来晋工作时间" : "近三年(首次)来晋工作时间";
|
|
|
+ }
|
|
|
+ if ($checkState != TalentState::FST_SUBMIT) {
|
|
|
+ //$fields = DictApi::getTalentFields(2);
|
|
|
+ $field_tmp = [];
|
|
|
+ if ($fields) {
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
}
|
|
|
}
|
|
|
- if ($fields["fst_work_time"] && in_array($enterprise['enterpriseTag'], ['mtdw', 'gyqyh', 'mbfqy', 'jrjg']) && $enterprise["type"] == 1) {
|
|
|
- $fields["fst_work_time"] = $talent_info['talent_type'] == 1 ? "近三年来晋工作时间" : "近三年(首次)来晋工作时间";
|
|
|
+ $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
+ $companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
+ $_companys = [];
|
|
|
+ foreach ($companys as $companyId) {
|
|
|
+ $company = CompanyApi::getOne($companyId);
|
|
|
+ $_companys[] = $company;
|
|
|
}
|
|
|
- if ($checkState != TalentState::FST_SUBMIT) {
|
|
|
- //$fields = DictApi::getTalentFields(2);
|
|
|
- $field_tmp = [];
|
|
|
- if ($fields) {
|
|
|
- foreach ($fields as $key => $field) {
|
|
|
- $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
+ if ($process == 4 && $enterprise["type"] == 1) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ $cwfts = explode(";", $condition["companyWithFileType"]);
|
|
|
+ foreach ($cwfts as $cwft) {
|
|
|
+ $_company_setting = explode(":", $cwft);
|
|
|
+ if ($_company_setting[0] == $this->user["companyId"]) {
|
|
|
+ $where[] = ["id", "in", explode(",", $_company_setting[1])];
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
- $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- $companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- $_companys = [];
|
|
|
- foreach ($companys as $companyId) {
|
|
|
- $company = CompanyApi::getOne($companyId);
|
|
|
- $_companys[] = $company;
|
|
|
+ if ($where) {
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
+ } else {
|
|
|
+ $files = [];
|
|
|
}
|
|
|
- if ($process == 4 && $enterprise["type"] == 1) {
|
|
|
- $where = [];
|
|
|
- $where[] = ["delete", "=", 0];
|
|
|
- $cwfts = explode(";", $condition["companyWithFileType"]);
|
|
|
- foreach ($cwfts as $cwft) {
|
|
|
- $_company_setting = explode(":", $cwft);
|
|
|
- if ($_company_setting[0] == $this->user["companyId"]) {
|
|
|
- $where[] = ["id", "in", explode(",", $_company_setting[1])];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if ($where) {
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
- } else {
|
|
|
- $files = [];
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ $where = [];
|
|
|
+ $whr = [];
|
|
|
+ if (!$isMix) {
|
|
|
+ $where[] = ["step", "=", 2];
|
|
|
+ }
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["type", "=", $enterprise["type"]];
|
|
|
+ $where[] = ["isConditionFile", "<>", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ if ($condition && $condition["bindFileTypes"]) {
|
|
|
+ $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select();
|
|
|
} else {
|
|
|
- $where = [];
|
|
|
- $whr = [];
|
|
|
- if (!$isMix) {
|
|
|
- $where[] = ["step", "=", 2];
|
|
|
- }
|
|
|
- $where[] = ["project", "=", 1];
|
|
|
- $where[] = ["active", "=", 1];
|
|
|
- $where[] = ["type", "=", $enterprise["type"]];
|
|
|
- $where[] = ["isConditionFile", "<>", 1];
|
|
|
- $where[] = ["delete", "=", 0];
|
|
|
- if ($condition && $condition["bindFileTypes"]) {
|
|
|
- $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select();
|
|
|
- } else {
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
- }
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
}
|
|
|
}
|
|
|
- $talent_info["files"] = array_filter(explode(",", $talent_info["modify_files"]));
|
|
|
- $talent_info["fields"] = array_filter(explode(",", $talent_info["modify_fields"]));
|
|
|
+ }
|
|
|
+ $talent_info["files"] = array_filter(explode(",", $talent_info["modify_files"]));
|
|
|
+ $talent_info["fields"] = array_filter(explode(",", $talent_info["modify_fields"]));
|
|
|
|
|
|
- /* 保存的审核内容start */
|
|
|
- $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, 0, ["active", "=", 0]);
|
|
|
- if ($last_log["step"] == 3 && $last_log["companyId"] != $this->user["companyId"]) {
|
|
|
- $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, $this->user["companyId"], ["active", "=", 0]);
|
|
|
- }
|
|
|
- $check = ["msg" => $last_log["description"]];
|
|
|
- if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
- if ($talent_info["pass_dept_check"] == 1) {
|
|
|
- if ($talent_info["isImport"] && $talent_info["isMatchZhiren"]) {
|
|
|
- $check["checkState"] = 3; //初审通过
|
|
|
- } else {
|
|
|
- $check["checkState"] = 4; //初审通过(跳过部门并审)
|
|
|
- }
|
|
|
+ /* 保存的审核内容start */
|
|
|
+ $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, 0, ["active", "=", 0]);
|
|
|
+ if ($last_log["step"] == 3 && $last_log["companyId"] != $this->user["companyId"]) {
|
|
|
+ $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, $this->user["companyId"], ["active", "=", 0]);
|
|
|
+ }
|
|
|
+ $check = ["msg" => $last_log["description"]];
|
|
|
+ if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
+ if ($talent_info["pass_dept_check"] == 1) {
|
|
|
+ if ($talent_info["isImport"] && $talent_info["isMatchZhiren"]) {
|
|
|
+ $check["checkState"] = 3; //初审通过
|
|
|
} else {
|
|
|
- if ($talent_info["re_check_companys"] && $talent_info["highProcess"] >= 4) {
|
|
|
- $check["checkState"] = 5; //初审通过(需要再次部门并审)
|
|
|
- } else {
|
|
|
- $check["checkState"] = 3; //初审通过
|
|
|
- }
|
|
|
+ $check["checkState"] = 4; //初审通过(跳过部门并审)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ($talent_info["re_check_companys"] && $talent_info["highProcess"] >= 4) {
|
|
|
+ $check["checkState"] = 5; //初审通过(需要再次部门并审)
|
|
|
+ } else {
|
|
|
+ $check["checkState"] = 3; //初审通过
|
|
|
}
|
|
|
}
|
|
|
- if ($last_log["state"] == TalentState::FST_VERIFY_REJECT && $last_log["new_state"] == TalentState::SCND_SAVE) {
|
|
|
- $check["checkState"] = 2; //初审驳回
|
|
|
- }
|
|
|
- if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::DEPT_VERIFY_PASS) {
|
|
|
- $check["checkState"] = 3; //部门通过
|
|
|
- }
|
|
|
- if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
- $check["checkState"] = 2; //部门驳回
|
|
|
- }
|
|
|
- if ($last_log["state"] == TalentState::REVERIFY_PASS && $last_log["new_state"] == TalentState::REVERIFY_PASS) {
|
|
|
- $check["checkState"] = 3; //复审通过
|
|
|
- }
|
|
|
- if ($last_log["state"] == TalentState::REVERIFY_REJECT && $last_log["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
- $check["checkState"] = 2; //复审驳回
|
|
|
- }
|
|
|
- if ($last_log["state"] == TalentState::REVERIFY_FAIL && $last_log["new_state"] == TalentState::REVERIFY_FAIL) {
|
|
|
- $check["checkState"] = -1; //复审失败
|
|
|
- }
|
|
|
- /* 保存的审核内容end */
|
|
|
- return json(["code" => 200, "obj" => ["process" => $process, "talentInfo" => $talent_info, "check" => $check, "fieldList" => $field_tmp, "fileList" => $files, "companys" => $_companys]]);
|
|
|
- } else {
|
|
|
- return json(["msg" => "该申报不在审核范围内,无法审核"]);
|
|
|
}
|
|
|
+ if ($last_log["state"] == TalentState::FST_VERIFY_REJECT && $last_log["new_state"] == TalentState::SCND_SAVE) {
|
|
|
+ $check["checkState"] = 2; //初审驳回
|
|
|
+ }
|
|
|
+ if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::DEPT_VERIFY_PASS) {
|
|
|
+ $check["checkState"] = 3; //部门通过
|
|
|
+ }
|
|
|
+ if ($last_log["state"] == TalentState::FST_VERIFY_PASS && $last_log["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
+ $check["checkState"] = 2; //部门驳回
|
|
|
+ }
|
|
|
+ if ($last_log["state"] == TalentState::REVERIFY_PASS && $last_log["new_state"] == TalentState::REVERIFY_PASS) {
|
|
|
+ $check["checkState"] = 3; //复审通过
|
|
|
+ }
|
|
|
+ if ($last_log["state"] == TalentState::REVERIFY_REJECT && $last_log["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
+ $check["checkState"] = 2; //复审驳回
|
|
|
+ }
|
|
|
+ if ($last_log["state"] == TalentState::REVERIFY_FAIL && $last_log["new_state"] == TalentState::REVERIFY_FAIL) {
|
|
|
+ $check["checkState"] = -1; //复审失败
|
|
|
+ }
|
|
|
+ /* 保存的审核内容end */
|
|
|
+ return json(["code" => 200, "obj" => ["process" => $process, "talentInfo" => $talent_info, "check" => $check, "fieldList" => $field_tmp, "fileList" => $files, "companys" => $_companys]]);
|
|
|
}
|
|
|
}
|
|
|
|