|
@@ -337,9 +337,11 @@ class Talent extends AdminController {
|
|
|
$log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
$data["pass_dept_check"] = 0;
|
|
|
} else if ($params["checkState"] == 4) {
|
|
|
- //审核成功,并设置越过部门并审。附加条件:最高进度曾经超过初审2(包含初审,因为再次初审也就证明从上面驳回过,这步是防止前端改checkState=4进来)
|
|
|
+ if ($talent_info["highProcess"] < 3)
|
|
|
+ return json(["msg" => "只有曾经通过部门并审,初审时才可以选择直接跳过部门并审阶段"]);
|
|
|
+ //审核成功,并设置越过部门并审。附加条件:最高进度曾经通过部门并审3(包含部门并审)
|
|
|
$log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
|
|
|
- $data["pass_dept_check"] = $talent_info["highProcess"] >= 2 ? 1 : 0;
|
|
|
+ $data["pass_dept_check"] = $talent_info["highProcess"] >= 3 ? 1 : 0;
|
|
|
} else {
|
|
|
//审核驳回并记录需要修改的字段和上传文件
|
|
|
$checkState = TalentState::SCND_SAVE; //退回材料编辑状态
|
|
@@ -369,7 +371,7 @@ class Talent extends AdminController {
|
|
|
$nowProcess = 2;
|
|
|
$log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
if (!$log || $log["active"] == 1)
|
|
|
- return json(["msg" => "日志数据异常,审核失败"]);
|
|
|
+ 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"];
|
|
|
}
|
|
@@ -380,6 +382,7 @@ class Talent extends AdminController {
|
|
|
//这边去除已经审核通过的单位,主要通过日志是否存在记录。
|
|
|
$pass_companyIds = TalentLogApi::getPassDepts($talent_info["id"]); //已经通过的单位
|
|
|
$unpass_companyIds = array_diff($companyIds, (array) $pass_companyIds); //排除已经通过的单位
|
|
|
+ sort($unpass_companyIds);
|
|
|
TalentLogApi::writeDeptLogs($talent_info["id"], $unpass_companyIds, TalentState::FST_VERIFY_PASS);
|
|
|
}
|
|
|
$data["id"] = $talent_info["id"];
|
|
@@ -413,6 +416,8 @@ class Talent extends AdminController {
|
|
|
//审核驳回并记录需要修改的字段和上传文件
|
|
|
$checkState = TalentState::SCND_SUBMIT; //退回待初审
|
|
|
$log_checkState = TalentState::FST_VERIFY_PASS; //当前状态不变
|
|
|
+ $data["modify_files"] = $params["files"];
|
|
|
+ $data["modify_fields"] = $params["fields"];
|
|
|
}
|
|
|
|
|
|
$fst_dept_check_time = $talent_info["first_dept_check_time"];
|
|
@@ -422,8 +427,6 @@ class Talent extends AdminController {
|
|
|
if ($dept_log["active"] == 1)
|
|
|
return json(["msg" => "您的部门已经审核过了"]);
|
|
|
$data["id"] = $talent_info["id"];
|
|
|
- $data["modify_files"] = $params["files"];
|
|
|
- $data["modify_fields"] = $params["fields"];
|
|
|
TalentModel::update($data);
|
|
|
//修改日志
|
|
|
TalentLogApi::rewrite($dept_log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
|
|
@@ -451,6 +454,8 @@ class Talent extends AdminController {
|
|
|
$nowProcess = 3;
|
|
|
if (!$dept_log)
|
|
|
return json(["msg" => "未匹配日志,审核失败"]);
|
|
|
+ if ($dept_log["state"] == $dept_log["new_state"])
|
|
|
+ return json(["msg" => "请先保存审核状态,再提交审核"]);
|
|
|
if ($dept_log["active"] == 1)
|
|
|
return json(["msg" => "您的部门已经审核过了"]);
|
|
|
|
|
@@ -460,9 +465,11 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
$logs = TalentLogApi::getListLogByTime($talent_info["id"], $talent_info["first_dept_check_time"]);
|
|
|
for ($i = 0; $i < count($logs); $i++) {
|
|
|
- $over += $logs[$i]["active"] == 1 ? 1 : 0;
|
|
|
- if ($logs[$i]["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
- $error++;
|
|
|
+ if (!in_array($logs[$i]["companyId"], $pass_companyIds)) {
|
|
|
+ $over += $logs[$i]["active"] == 1 ? 1 : 0;
|
|
|
+ if ($logs[$i]["new_state"] == TalentState::SCND_SUBMIT) {
|
|
|
+ $error++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if ($over == count($companys)) {
|
|
@@ -528,7 +535,7 @@ class Talent extends AdminController {
|
|
|
private function commonSubmitCheck($talent_info, $nowProcess) {
|
|
|
$log = TalentLogApi::getLastLog($talent_info["id"], 1);
|
|
|
if (!$log || $log["active"] == 1)
|
|
|
- return json(["msg" => "日志数据异常,审核失败"]);
|
|
|
+ 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"];
|
|
|
}
|
|
@@ -639,7 +646,7 @@ class Talent extends AdminController {
|
|
|
break;
|
|
|
case 7:
|
|
|
$tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
- if ($tc["companyId"] && $talent_info["pass_dept_check"] != 1) {
|
|
|
+ if ($tc["companyIds"] && $talent_info["pass_dept_check"] != 1) {
|
|
|
$process = 3;
|
|
|
} else {
|
|
|
$process = 4;
|