|
@@ -14,6 +14,9 @@ use app\common\api\MenuApi;
|
|
|
use app\admin\model\SysRelation;
|
|
|
use app\common\api\CompanyApi;
|
|
|
use app\common\api\IntegralRecordApi;
|
|
|
+use app\common\state\ProjectState;
|
|
|
+use app\common\state\IntegralState;
|
|
|
+use app\common\model\IntegralRecord;
|
|
|
|
|
|
/**
|
|
|
* Description of Talent
|
|
@@ -62,16 +65,16 @@ class IntegralVerify extends AdminController {
|
|
|
$ids_arr = array_filter(explode(",", $ids));
|
|
|
$counts = 0;
|
|
|
foreach ($ids_arr as $id) {
|
|
|
- $ti = VerifyApi::getOne($id);
|
|
|
+ $record = IntegralRecord::getOne($id);
|
|
|
$data["id"] = $id;
|
|
|
- if ($ti["checkState"] == TalentState::FST_SUBMIT) {
|
|
|
- $data["checkState"] = TalentState::BASE_VERIFY_FAIL;
|
|
|
- TalentLogApi::write(1, $id, TalentState::BASE_VERIFY_FAIL, $msg, 1);
|
|
|
+ if ($record["checkState"] == IntegralState::SUBMIT) {
|
|
|
+ $data["checkState"] = IntegralState::VERIFY_FAIL;
|
|
|
+ TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::VERIFY_FAIL, $msg, 1);
|
|
|
TalentModel::update($data);
|
|
|
$counts++;
|
|
|
- } else if ($ti["checkState"] == TalentState::SCND_SAVE) {
|
|
|
- $data["checkState"] = TalentState::FST_VERIFY_FAIL;
|
|
|
- TalentLogApi::write(1, $id, TalentState::FST_VERIFY_FAIL, $msg, 1);
|
|
|
+ } else if ($record["checkState"] == IntegralState::VERIFY_PASS) {
|
|
|
+ $data["checkState"] = IntegralState::FST_VERIFY_FAIL;
|
|
|
+ TalentLogApi::write(ProjectState::INTEGRAL, $id, IntegralState::REVERIFY_FAIL, $msg, 1);
|
|
|
TalentModel::update($data);
|
|
|
$counts++;
|
|
|
} else {
|
|
@@ -607,55 +610,30 @@ class IntegralVerify extends AdminController {
|
|
|
* @param type $talent_info
|
|
|
* @return type json
|
|
|
*/
|
|
|
- private function fstCheck(\think\Request $request, $talent_info) {
|
|
|
+ private function fstCheck(\think\Request $request, $record) {
|
|
|
$params = $request->param();
|
|
|
- if ($params["checkState"] == 3) {
|
|
|
+ if ($params["checkState"] == 1) {
|
|
|
//审核成功,并取消设置越过部门并审
|
|
|
- $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
- $data["pass_dept_check"] = 0;
|
|
|
- if ($talent_info["isImport"] && $talent_info["isMatchZhiren"]) {
|
|
|
- $data["pass_dept_check"] = 1;
|
|
|
- }
|
|
|
- } else if ($params["checkState"] == 4) {
|
|
|
- if ($talent_info["highProcess"] < 4)
|
|
|
- return json(["msg" => "只有曾经通过部门并审,初审时才可以选择直接跳过部门并审阶段"]);
|
|
|
-//审核成功,并设置越过部门并审。附加条件:最高进度曾经通过部门并审4(包含部门并审)
|
|
|
- $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
- $data["pass_dept_check"] = $talent_info["highProcess"] >= 4 ? 1 : 0;
|
|
|
- } else if ($params["checkState"] == 5) {
|
|
|
- //选择重审部门
|
|
|
- if ($talent_info["highProcess"] < 4)
|
|
|
- return json(["msg" => "只有曾经通过部门并审,初审时才可以选择再次审核的部门"]);
|
|
|
- if (!$params["companys"])
|
|
|
- return json(["msg" => "请选择需要再次审核的部门"]);
|
|
|
- $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- $companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位
|
|
|
- $re_check_companys = array_filter(explode(",", $talent_info["re_check_companys"]));
|
|
|
- foreach ($re_check_companys as $reCompanyId) {
|
|
|
- if (!in_array($reCompanyId, $companyIds)) {
|
|
|
- return json(["msg" => "错误的部门"]);
|
|
|
- }
|
|
|
- }
|
|
|
- $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
- $data["pass_dept_check"] = 0;
|
|
|
- } else {
|
|
|
+ $log_checkState = $checkState = IntegralState::VERIFY_PASS; //初审成功
|
|
|
+ } else if ($params["checkState"] == 2) {
|
|
|
//审核驳回并记录需要修改的字段和上传文件
|
|
|
- $checkState = TalentState::SCND_SAVE; //退回材料编辑状态
|
|
|
- $log_checkState = TalentState::FST_VERIFY_REJECT; //日志记录拒绝状态
|
|
|
+ $checkState = IntegralState::SAVE; //退回材料编辑状态
|
|
|
+ $log_checkState = IntegralState::VERIFY_REJECT; //日志记录拒绝状态
|
|
|
+ } else {
|
|
|
+ $checkState = IntegralState::VERIFY_FAIL;
|
|
|
}
|
|
|
- $log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
+ $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
|
|
|
if (!$log)
|
|
|
return json(["msg" => "日志数据异常,保存失败"]);
|
|
|
if ($log["active"] == 0) {
|
|
|
TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
} else {
|
|
|
- TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
+ TalentLogApi::write(ProjectState::INTEGRAL, $record["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
}
|
|
|
- $data["id"] = $talent_info["id"];
|
|
|
+ $data["id"] = $record["id"];
|
|
|
$data["modify_files"] = $params["files"];
|
|
|
$data["modify_fields"] = $params["fields"];
|
|
|
- $data["re_check_companys"] = $params["companys"];
|
|
|
- TalentModel::update($data);
|
|
|
+ IntegralRecord::update($data);
|
|
|
return json(["code" => 200, "msg" => "保存成功"]);
|
|
|
}
|
|
|
|
|
@@ -664,51 +642,34 @@ class IntegralVerify extends AdminController {
|
|
|
* @param type $talent_info
|
|
|
* @return type json
|
|
|
*/
|
|
|
- private function fstSubmitCheck($talent_info) {
|
|
|
- $nowProcess = 3;
|
|
|
- $log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
+ private function fstSubmitCheck($record) {
|
|
|
+ $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
|
|
|
if (!$log || $log["active"] == 1)
|
|
|
return json(["msg" => "请先保存审核状态,再提交审核"]);
|
|
|
- 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"];
|
|
|
- }
|
|
|
- $userIds = [];
|
|
|
- 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"])); //该条件下需要审核的所有单位
|
|
|
- if ($talent_info["re_check_companys"]) {
|
|
|
- $unpass_companyIds = array_filter(explode(",", $talent_info["re_check_companys"]));
|
|
|
- } else {
|
|
|
-//这边去除已经审核通过的单位,主要通过日志是否存在记录。
|
|
|
- $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
- $unpass_companyIds = array_diff($companyIds, (array) $pass_companyIds); //排除已经通过的单位
|
|
|
- if (!$unpass_companyIds) {
|
|
|
- $data["pass_dept_check"] = 1; //部门已经全部审核过了,跳过部门审核
|
|
|
- }
|
|
|
- }
|
|
|
- if ($unpass_companyIds) {
|
|
|
- sort($unpass_companyIds);
|
|
|
- TalentLogApi::writeDeptLogs($talent_info["id"], $unpass_companyIds, TalentState::FST_VERIFY_PASS);
|
|
|
-
|
|
|
- //初审通过发送短信通知并审部门
|
|
|
- $privs = ["/admin/talent/dept_check"];
|
|
|
- $menuIds = MenuApi::getMenuIdsByNewUrls($privs);
|
|
|
- $where[] = ["menuid", "in", $menuIds];
|
|
|
- $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid");
|
|
|
- $where = [];
|
|
|
- $where[] = ["status", "=", 1];
|
|
|
- $where[] = ["companyId", "in", $unpass_companyIds];
|
|
|
- $where[] = ["roleid", "in", $roleIds];
|
|
|
- $where[] = ["roleid", "<>", 1];
|
|
|
- $userIds = User::where($where)->column("id");
|
|
|
- }
|
|
|
+ if ($log["new_state"] == IntegralState::VERIFY_PASS) {
|
|
|
+ $data["modify_files"] = null;
|
|
|
+ $data["modify_fields"] = null;
|
|
|
}
|
|
|
- $data["id"] = $talent_info["id"];
|
|
|
+ $data["id"] = $record["id"];
|
|
|
$data["checkState"] = $log["new_state"];
|
|
|
- TalentModel::update($data);
|
|
|
+ IntegralRecord::update($data);
|
|
|
TalentLogApi::setActive($log["id"], 1);
|
|
|
- $this->sendMsgByState($talent_info, $log["new_state"], $userIds);
|
|
|
+ $userIds = [];
|
|
|
+ if (in_array($data["checkState"], [IntegralState::VERIFY_PASS])) {
|
|
|
+ //初审成功需要发送短信给复核部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户
|
|
|
+ //从复核权限,逆推复核人员
|
|
|
+ $privs = ["/admin/integralVerify/re_verify"];
|
|
|
+ $menuIds = MenuApi::getMenuIdsByNewUrls($privs);
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["menuid", "in", $menuIds];
|
|
|
+ $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($privs))->column("roleid");
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["status", "=", 1];
|
|
|
+ $where[] = ["roleid", "in", $roleIds];
|
|
|
+ $where[] = ["roleid", "<>", 1];
|
|
|
+ $userIds = User::where($where)->column("id");
|
|
|
+ }
|
|
|
+ $this->sendMsgByState($record, $log["new_state"], $userIds);
|
|
|
return json(["code" => 200, "msg" => "审核成功"]);
|
|
|
}
|
|
|
|
|
@@ -718,29 +679,31 @@ class IntegralVerify extends AdminController {
|
|
|
* @param type $talent_info
|
|
|
* @param type json
|
|
|
*/
|
|
|
- private function reCheck(\think\Request $request, $talent_info) {
|
|
|
+ private function reCheck(\think\Request $request, $record) {
|
|
|
$params = $request->param();
|
|
|
- if ($params["checkState"] == 3) {
|
|
|
-//审核成功
|
|
|
- $log_checkState = $checkState = TalentState::REVERIFY_PASS; //复核成功
|
|
|
+ $data["modify_files"] = null;
|
|
|
+ $data["modify_fields"] = null;
|
|
|
+ if ($params["checkState"] == 1) {
|
|
|
+ //审核成功
|
|
|
+ $log_checkState = $checkState = IntegralState::REVERIFY_PASS; //复核成功
|
|
|
} else if ($params["checkState"] == 2) {
|
|
|
-//审核驳回并记录需要修改的字段和上传文件
|
|
|
- $checkState = TalentState::SCND_SUBMIT; //退回待初审
|
|
|
- $log_checkState = TalentState::REVERIFY_REJECT; //日志记录拒绝状态
|
|
|
+ //审核驳回并记录需要修改的字段和上传文件
|
|
|
+ $checkState = IntegralState::SUBMIT; //退回待初审
|
|
|
+ $log_checkState = IntegralState::REVERIFY_REJECT; //日志记录拒绝状态
|
|
|
+ $data["modify_files"] = $params["files"];
|
|
|
+ $data["modify_fields"] = $params["fields"];
|
|
|
} else {
|
|
|
- $log_checkState = $checkState = TalentState::REVERIFY_FAIL; //审核失败
|
|
|
+ $log_checkState = $checkState = IntegralState::REVERIFY_FAIL; //审核失败
|
|
|
}
|
|
|
- $log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
+ $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
|
|
|
if (!$log)
|
|
|
return json(["msg" => "日志数据异常,保存失败"]);
|
|
|
if ($log["active"] == 0) {
|
|
|
TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
} else {
|
|
|
- TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
+ TalentLogApi::write(ProjectState::INTEGRAL, $record["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
|
}
|
|
|
- $data["id"] = $talent_info["id"];
|
|
|
- $data["modify_files"] = $params["files"];
|
|
|
- $data["modify_fields"] = $params["fields"];
|
|
|
+ $data["id"] = $record["id"];
|
|
|
TalentModel::update($data);
|
|
|
return json(["code" => 200, "msg" => "保存成功"]);
|
|
|
}
|
|
@@ -750,30 +713,22 @@ class IntegralVerify extends AdminController {
|
|
|
* @param type $talent_info
|
|
|
* @return type json
|
|
|
*/
|
|
|
- private function reSubmitCheck($talent_info) {
|
|
|
- return $this->commonSubmitCheck($talent_info, 5);
|
|
|
- }
|
|
|
-
|
|
|
- private function commonSubmitCheck($talent_info, $nowProcess) {
|
|
|
- $log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
+ private function reSubmitCheck($record) {
|
|
|
+ $log = TalentLogApi::getLastLog($record["id"], ProjectState::INTEGRAL);
|
|
|
if (!$log || $log["active"] == 1)
|
|
|
return json(["msg" => "请先保存审核状态,再提交审核"]);
|
|
|
- if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
|
|
|
- $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
|
|
|
- }
|
|
|
-
|
|
|
- $data["id"] = $talent_info["id"];
|
|
|
+ $data["id"] = $record["id"];
|
|
|
$data["checkState"] = $log["new_state"];
|
|
|
- TalentModel::update($data);
|
|
|
+ IntegralRecord::update($data);
|
|
|
TalentLogApi::setActive($log["id"], 1);
|
|
|
$userIds = [];
|
|
|
- if (in_array($data["checkState"], [TalentState::REVERIFY_PASS, TalentState::REVERIFY_REJECT])) {
|
|
|
+ if (in_array($data["checkState"], [IntegralState::REVERIFY_PASS, IntegralState::REVERIFY_REJECT])) {
|
|
|
//复核成功需要发送短信给征信部门,复核的其它状态发送通知给用户,调用此方法的还有基础审核的每个状态都要发送通知给用户
|
|
|
//从征信审核权限,逆推征信部门
|
|
|
- if ($data["checkState"] == TalentState::REVERIFY_PASS) {
|
|
|
- $privs = ["/admin/talent/hczxReject", "/admin/talent/hczxPass"];
|
|
|
+ if ($data["checkState"] == IntegralState::REVERIFY_PASS) {
|
|
|
+ $privs = ["/admin/integralVerify/hczxReject", "/admin/integralVerify/hczxPass"];
|
|
|
} else {
|
|
|
- $privs = ["admin/talent/fst_check"];
|
|
|
+ $privs = ["admin/integralVerify/fst_check"];
|
|
|
}
|
|
|
$menuIds = MenuApi::getMenuIdsByNewUrls($privs);
|
|
|
$where = [];
|
|
@@ -785,7 +740,7 @@ class IntegralVerify extends AdminController {
|
|
|
$where[] = ["roleid", "<>", 1];
|
|
|
$userIds = User::where($where)->column("id");
|
|
|
}
|
|
|
- $this->sendMsgByState($talent_info, $data["checkState"], $userIds);
|
|
|
+ $this->sendMsgByState($record, $data["checkState"], $userIds);
|
|
|
return json(["code" => 200, "msg" => "审核成功"]);
|
|
|
}
|
|
|
|
|
@@ -891,9 +846,9 @@ class IntegralVerify extends AdminController {
|
|
|
$files = $params["files"];
|
|
|
$fields = $params["fields"];
|
|
|
$id = $params["id"];
|
|
|
- $talent_info = VerifyApi::getOne($id);
|
|
|
- $checkState = $talent_info["checkState"];
|
|
|
- if (!$talent_info) {
|
|
|
+ $record = IntegralRecordApi::getOne($id);
|
|
|
+ $checkState = $record["checkState"];
|
|
|
+ if (!$record) {
|
|
|
return json(["msg" => "数据错误"]);
|
|
|
}
|
|
|
if (!$check) {
|
|
@@ -902,24 +857,13 @@ class IntegralVerify extends AdminController {
|
|
|
if (!$check_msg) {
|
|
|
return json(["msg" => "请填写审核说明"]);
|
|
|
}
|
|
|
- if ($checkState == TalentState::FST_SUBMIT) {
|
|
|
- return $this->baseCheck($request, $talent_info);
|
|
|
- } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
|
|
|
- return $this->baseReCheck($request, $talent_info);
|
|
|
- } else if ($checkState == TalentState::SCND_SUBMIT) {
|
|
|
- return $this->fstCheck($request, $talent_info);
|
|
|
- } else if ($checkState == TalentState::FST_VERIFY_PASS) {
|
|
|
- $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- $companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- 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);
|
|
|
- } else {
|
|
|
- return $this->reCheck($request, $talent_info);
|
|
|
- }
|
|
|
- } else if ($checkState == TalentState::DEPT_VERIFY_PASS) {
|
|
|
- return $this->reCheck($request, $talent_info);
|
|
|
+ if ($check == 2 && !$files && $fields) {
|
|
|
+ return json(["msg" => "请选择可修改的字段或项目"]);
|
|
|
+ }
|
|
|
+ if ($checkState == IntegralState::SUBMIT) {
|
|
|
+ return $this->fstCheck($request, $record);
|
|
|
+ } else if ($checkState == IntegralState::VERIFY_PASS) {
|
|
|
+ return $this->reCheck($request, $record);
|
|
|
} else {
|
|
|
return json(["msg" => "不在审核范围内,保存失败"]);
|
|
|
}
|
|
@@ -928,29 +872,15 @@ class IntegralVerify extends AdminController {
|
|
|
public function submitCheck() {
|
|
|
//公共调度方法
|
|
|
$id = $this->request->param("id");
|
|
|
- $talent_info = VerifyApi::getOne($id);
|
|
|
- $checkState = $talent_info["checkState"];
|
|
|
- if (!$talent_info) {
|
|
|
+ $record = IntegralRecordApi::getOne($id);
|
|
|
+ $checkState = $record["checkState"];
|
|
|
+ if (!$record) {
|
|
|
return json(["msg" => "数据错误"]);
|
|
|
}
|
|
|
- if ($checkState == TalentState::FST_SUBMIT) {
|
|
|
- return $this->baseSubmitCheck($talent_info);
|
|
|
- } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
|
|
|
- return $this->baseReSubmitCheck($talent_info);
|
|
|
- } else if ($checkState == TalentState::SCND_SUBMIT) {
|
|
|
- return $this->fstSubmitCheck($talent_info);
|
|
|
- } else if ($checkState == TalentState::FST_VERIFY_PASS) {
|
|
|
- $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- $companys = array_filter(explode(",", $condition["companyIds"]));
|
|
|
- if ($companys && $talent_info["pass_dept_check"] != 1) {
|
|
|
- if (!in_array($this->user["companyId"], $companys))
|
|
|
- return json(["msg" => "你的部门不在并审部门列表"]);
|
|
|
- return $this->deptSubmitCheck($talent_info, $companys);
|
|
|
- } else {
|
|
|
- return $this->reSubmitCheck($talent_info);
|
|
|
- }
|
|
|
- } else if ($checkState == TalentState::DEPT_VERIFY_PASS) {
|
|
|
- return $this->reSubmitCheck($talent_info);
|
|
|
+ if ($checkState == IntegralState::SUBMIT) {
|
|
|
+ return $this->fstSubmitCheck($record);
|
|
|
+ } else if ($checkState == IntegralState::VERIFY_PASS) {
|
|
|
+ return $this->reSubmitCheck($record);
|
|
|
} else {
|
|
|
return json(["msg" => "不在审核范围内,审核失败"]);
|
|
|
}
|
|
@@ -959,154 +889,20 @@ class IntegralVerify extends AdminController {
|
|
|
public function validateIsCheck() {
|
|
|
$params = $this->request->param();
|
|
|
$id = $params["id"];
|
|
|
- $talent_info = VerifyApi::getOne($id);
|
|
|
- $fstLog = TalentLogApi::getFstLog($id, 1);
|
|
|
- $isMix = false;
|
|
|
- if (in_array($fstLog["state"], [TalentState::SCND_SAVE, TalentState::SCND_SUBMIT])) {
|
|
|
- //初次提交是待初审状态,则为新的混合基础信息和人才认证信息的申报
|
|
|
- $isMix = true;
|
|
|
- }
|
|
|
- $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复核失败
|
|
|
- $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:
|
|
|
- $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 ($checkState != TalentState::FST_SUBMIT) {
|
|
|
- //$fields = DictApi::getTalentFields(2);
|
|
|
- $field_tmp = [];
|
|
|
- if ($fields) {
|
|
|
- foreach ($fields as $key => $field) {
|
|
|
- $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
- }
|
|
|
- }
|
|
|
- $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 ($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)->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])->select();
|
|
|
- } else {
|
|
|
- $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
- }
|
|
|
- }
|
|
|
+ $record = IntegralRecordApi::getOne($id);
|
|
|
+ $enterprise = \app\common\model\Enterprise::findOrEmpty($record["enterprise_id"]);
|
|
|
+ if ($record) {
|
|
|
+ $items = $record["detail"]->toArray(); //项目明细
|
|
|
+ $checkState = $record["checkState"];
|
|
|
+ if (in_array($checkState, [IntegralState::SUBMIT, IntegralState::VERIFY_PASS])) {
|
|
|
+ $fields = DictApi::getIntegralFields();
|
|
|
+ $field_tmp = [];
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
}
|
|
|
- $talent_info["files"] = array_filter(explode(",", $talent_info["modify_files"]));
|
|
|
- $talent_info["fields"] = array_filter(explode(",", $talent_info["modify_fields"]));
|
|
|
- return json(["code" => 200, "obj" => ["process" => $process, "talentInfo" => $talent_info, "fieldList" => $field_tmp, "fileList" => $files, "companys" => $_companys]]);
|
|
|
+ $record["files"] = $record["modify_files"];
|
|
|
+ $record["fields"] = array_filter(explode(",", $record["modify_fields"]));
|
|
|
+ return json(["code" => 200, "obj" => ["record" => $record, "fieldList" => $field_tmp]]);
|
|
|
} else {
|
|
|
return json(["msg" => "该申报不在审核范围内,无法审核"]);
|
|
|
}
|