|
@@ -376,8 +376,11 @@ class Talent extends AdminController {
|
|
|
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);
|
|
|
+ $companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位
|
|
|
+ //这边去除已经审核通过的单位,主要通过日志是否存在记录。
|
|
|
+ $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
+ $unpass_companyIds = array_diff($companyIds, (array) $pass_companyIds); //排除已经通过的单位
|
|
|
+ TalentLogApi::writeDeptLogs($talent_info["id"], $unpass_companyIds, TalentState::FST_VERIFY_PASS);
|
|
|
}
|
|
|
$data["id"] = $talent_info["id"];
|
|
|
$data["checkState"] = $log["new_state"];
|
|
@@ -395,6 +398,11 @@ class Talent extends AdminController {
|
|
|
private function deptCheck(\think\Request $request, $talent_info, $companys) {
|
|
|
if ($talent_info["pass_dept_check"] == 1)
|
|
|
return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
|
|
|
+ if (!in_array($this->user["companyId"], $companys))
|
|
|
+ return json(["msg" => "您的部门不在该申请的并审部门列表中。"]);
|
|
|
+ $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
+ if (in_array($this->user["companyId"], $pass_companyIds))
|
|
|
+ return json(["msg" => "您的部门已经审核过了,无需重复审核。"]);
|
|
|
|
|
|
$params = $request->param();
|
|
|
if ($params["checkState"] == 3) {
|
|
@@ -430,10 +438,15 @@ class Talent extends AdminController {
|
|
|
private function deptSubmitCheck($talent_info, $companys) {
|
|
|
if ($talent_info["pass_dept_check"] == 1)
|
|
|
return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
|
|
|
+ if (!in_array($this->user["companyId"], $companys))
|
|
|
+ return json(["msg" => "您的部门不在该申请的并审部门列表中。"]);
|
|
|
+ $pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
+ if (in_array($this->user["companyId"], $pass_companyIds))
|
|
|
+ return json(["msg" => "您的部门已经审核过了,无需重复审核。"]);
|
|
|
|
|
|
$dept_log = TalentLogApi::getLogByCompanyId($talent_info["id"], $this->user["companyId"], $talent_info["first_dept_check_time"]);
|
|
|
|
|
|
- $over = 0; //完成度
|
|
|
+ $over = $pass_companyIds ? count($pass_companyIds) : 0; //完成度,如果重审之前已有通过审核的部门,不用再审,直接按通过算
|
|
|
$error = 0; //失败数
|
|
|
$nowProcess = 3;
|
|
|
if (!$dept_log)
|