|
@@ -150,17 +150,27 @@ class VerifyApi {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 获得新的需要重审的部门集合(如果$oriReCheckCompanyIds为空,返回认定条件审核部门集合$talentConditionCompanyIds)
|
|
|
* @param type $oriReCheckCompanyIds 原来的需要再审核的部门id集合
|
|
|
- * @param type $TalentConditionCompanyIds 认定条件中的审核部门id集合
|
|
|
+ * @param type $talentConditionCompanyIds 认定条件中的审核部门id集合
|
|
|
* @param type $passedCompanyIds 已经通过审核的部门id集合
|
|
|
* @return type
|
|
|
*/
|
|
|
- public static function getReCheckCompanyIds($oriReCheckCompanyIds, $TalentConditionCompanyIds, $passedCompanyIds) {
|
|
|
- if (!$oriReCheckCompanyIds || !$TalentConditionCompanyIds)
|
|
|
- return null;
|
|
|
- $removeReCheckCompanyIds = array_diff($oriReCheckCompanyIds, $TalentConditionCompanyIds);
|
|
|
- $remainReCheckCompanyIds = array_diff($oriReCheckCompanyIds, $removeReCheckCompanyIds);
|
|
|
+ public static function getNewReCheckCompanyIds($oriReCheckCompanyIds, $talentConditionCompanyIds, $passedCompanyIds) {
|
|
|
+ if ($oriReCheckCompanyIds) {
|
|
|
+ //$removeReCheckCompanyIds:获得再审核部门中已经被移除的集合(修改认定条件审核部门后,已经不再在列表中的部门Id集合)
|
|
|
+ $removeReCheckCompanyIds = array_diff($oriReCheckCompanyIds, $talentConditionCompanyIds);
|
|
|
+ //$reCheckCompanyIds:获得再审核部门中仍需审核的部门集合
|
|
|
+ $reCheckCompanyIds = array_diff($oriReCheckCompanyIds, $removeReCheckCompanyIds);
|
|
|
+ //$notInReCheckCompanyIds:不在重审列表里面的审核部门集合(这里面存在新增的审核部门)
|
|
|
+ $notInReCheckCompanyIds = array_diff($talentConditionCompanyIds, $reCheckCompanyIds);
|
|
|
+ //$needReCheckCompanyIds:找出不在重审列表里面并且没有在已审核通过的列表中的部门Id集合
|
|
|
+ $needReCheckCompanyIds = array_diff($notInReCheckCompanyIds, $passedCompanyIds);
|
|
|
+ //合并新的需要重审的部门集合
|
|
|
+ $newReCheckCompanyIds = array_unique(array_merge($reCheckCompanyIds, $needReCheckCompanyIds));
|
|
|
+ return $newReCheckCompanyIds;
|
|
|
+ }
|
|
|
+ return $talentConditionCompanyIds;
|
|
|
}
|
|
|
|
|
|
public static function getFullDeptList($params, $where = []) {
|
|
@@ -222,6 +232,8 @@ class VerifyApi {
|
|
|
foreach ($companys as $k => $companyId) {
|
|
|
$company = getCacheById("Company", $companyId);
|
|
|
$log = TalentLogApi::getCompanyNewestCheckedLog($item["id"], $companyId);
|
|
|
+ if (!$log && in_array($item["realState"], [TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT]))
|
|
|
+ continue;
|
|
|
$verifyDepts[$k]["id"] = $companyId;
|
|
|
$verifyDepts[$k]["shortName"] = $company["shortName"];
|
|
|
$verifyDepts[$k]["name"] = $company["name"];
|
|
@@ -242,16 +254,16 @@ class VerifyApi {
|
|
|
$whereRaw = "";
|
|
|
switch ($params["checkState"]) {
|
|
|
case 1://待部门并审(首次提交)
|
|
|
- $where[] = ["tl.active", "=", 0];
|
|
|
- $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
- $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
- //$whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
+ //$where[] = ["tl.active", "=", 0];
|
|
|
+ //$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ //$where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
+ $whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
break;
|
|
|
case 2://待部门并审(重新提交)
|
|
|
- $where[] = ["tl.active", "=", 0];
|
|
|
- $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
- $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
- //$whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is not null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
+ //$where[] = ["tl.active", "=", 0];
|
|
|
+ //$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ //$where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
+ $whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is not null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
break;
|
|
|
case 3://部门并审通过
|
|
|
$where[] = ["tl.active", "=", 1];
|
|
@@ -262,7 +274,7 @@ class VerifyApi {
|
|
|
$where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
break;
|
|
|
default:
|
|
|
- $whereRaw = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
+ $whereRaw = sprintf("(((tl.active=0 and tl.state=%d) or (tl.active is null)) and ti.pass_dept_check=0 and ti.checkState=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -291,7 +303,7 @@ class VerifyApi {
|
|
|
$item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江市现代产业体系人才" : "集成电路优秀人才";
|
|
|
$item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
|
|
|
$lastCheckLog = TalentLogApi::getCompanyNewestCheckedLog($item["id"], $companyId);
|
|
|
- $item["deptCheckState"] = $lastCheckLog["new_state"];
|
|
|
+ $item["deptCheckState"] = $lastCheckLog["new_state"] ?: TalentState::FST_VERIFY_PASS;
|
|
|
$item["talentArrangeName"] = $talent_arrange_kvs[$item["talent_arrange"]];
|
|
|
}unset($item);
|
|
|
return ["total" => $count, "rows" => $list];
|
|
@@ -705,6 +717,9 @@ class VerifyApi {
|
|
|
if ($params["isMatchZhiren"]) {
|
|
|
$where[] = ["ti.isMatchZhiren", "=", $params["isMatchZhiren"]];
|
|
|
}
|
|
|
+ if ($params["company_id"]) {
|
|
|
+ $where[] = ["tc.companyIds", "like", "%" . $params["company_id"] . "%"];
|
|
|
+ }
|
|
|
switch ($process) {
|
|
|
case 1:
|
|
|
$where[] = ["ti.checkState", "in", [TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_FAIL]];
|
|
@@ -784,14 +799,16 @@ class VerifyApi {
|
|
|
} else {
|
|
|
switch ($params["checkState"]) {
|
|
|
case 1://待部门并审(首次提交)
|
|
|
- $where[] = ["tl.active", "=", 0];
|
|
|
- $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
- $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
+ //$where[] = ["tl.active", "=", 0];
|
|
|
+ //$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ //$where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
|
|
|
+ $whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
break;
|
|
|
case 2://待部门并审(重新提交)
|
|
|
- $where[] = ["tl.active", "=", 0];
|
|
|
- $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
- $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
+ //$where[] = ["tl.active", "=", 0];
|
|
|
+ //$where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
|
|
|
+ //$where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
|
|
|
+ $whereRaw = sprintf("((tl.active=0 and tl.state=%d) or (tl.active is null)) and tl2.resubmit is not null and ti.pass_dept_check=0 and ti.checkState=%d", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS);
|
|
|
break;
|
|
|
case 3://部门并审通过
|
|
|
$where[] = ["tl.active", "=", 1];
|
|
@@ -802,7 +819,7 @@ class VerifyApi {
|
|
|
$where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
|
|
|
break;
|
|
|
default:
|
|
|
- $whereRaw = sprintf("(tl.active=0 and tl.state=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
+ $whereRaw = sprintf("(((tl.active=0 and tl.state=%d) or (tl.active is null)) and ti.pass_dept_check=0 and ti.checkState=%d) or (tl.active=1 and (tl.new_state in (%d,%d)))", TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_PASS);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -865,7 +882,7 @@ class VerifyApi {
|
|
|
->select()->toArray();
|
|
|
} else {
|
|
|
$fields[] = "tl.active";
|
|
|
- $fields[] = "tl.new_state as deptCheckState";
|
|
|
+ $fields[] = "if(tl.new_state,tl.new_state,10) as deptCheckState";
|
|
|
$fields[] = "tl.createTime as first_dept_check_time";
|
|
|
$list = Talent::alias("ti")
|
|
|
->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
|
|
@@ -944,9 +961,9 @@ class VerifyApi {
|
|
|
} else {
|
|
|
$item["checkState"] = "待初审(首次提交)";
|
|
|
}
|
|
|
- } else if ($item["state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
+ } else if ($item["state"] == TalentState::FST_VERIFY_PASS || (!$item["state"] && $item["deptCheckState"])) {
|
|
|
if ($item["deptCheckState"]) {
|
|
|
- if ($item["acitve"] == 0 && $item["state"] == TalentState::FST_VERIFY_PASS) {
|
|
|
+ if (($item["acitve"] == 0 && $item["state"] == TalentState::FST_VERIFY_PASS) || !$item["active"]) {
|
|
|
if ($item["resubmit"]) {
|
|
|
$item["checkState"] = "待部门并审(重新提交)";
|
|
|
} else {
|
|
@@ -1027,6 +1044,8 @@ class VerifyApi {
|
|
|
while ($log = $deptChecklogs[$i]) {
|
|
|
if ($log["companyId"] == $companyId) {
|
|
|
break;
|
|
|
+ } else {
|
|
|
+ $log = null;
|
|
|
}
|
|
|
$i++;
|
|
|
}
|
|
@@ -1043,6 +1062,10 @@ class VerifyApi {
|
|
|
}
|
|
|
$deptDescriptions[] = sprintf("%s:%s", $company["name"], $log["description"]);
|
|
|
} else {
|
|
|
+ if (!$log && in_array($item["state"], [TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT])) {
|
|
|
+ unset($verifyDepts[$k]);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$verifyDepts[$k] .= "(待审核)";
|
|
|
$item["deptWait"]++;
|
|
|
}
|