Selaa lähdekoodia

人才层次变更支持旧数据

sugangqiang 8 kuukautta sitten
vanhempi
commit
39ed7175ea

+ 25 - 20
app/admin/controller/TalentTypeChange.php

@@ -76,7 +76,7 @@ class TalentTypeChange extends AdminController {
         $where[] = ["delete", "=", 0];
         switch ($process) {
             case -1:
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $where[] = ["type", "=", $this->user["type"]];
                 $company = \app\common\api\CompanyApi::getOne($this->user["companyId"]);
                 $where[] = ["beforeCheckCompany", "EXP", Db::raw("is not null")];
@@ -85,13 +85,13 @@ class TalentTypeChange extends AdminController {
                 }
                 break;
             case 1:
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "not in", [3, 5]];
                 break;
             case 2:
                 //$where[] = ["ttc.type", "=", $this->user["type"]];
-                $where[] = ["ttc.createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["ttc.createTime", ">=", "2022-10-01 00:00:00"];
                 if (ttcApi::chkUserInSuperDeptUsers()) {
                     $where[] = ["ttc.type", "=", $this->user["type"]];
                 } else {
@@ -114,17 +114,17 @@ class TalentTypeChange extends AdminController {
                 $list = ttcModel::alias("ttc")->field("ttc.*,td.companyId,td.state as depState")->leftJoin("un_talent_depcheckstate td", "td.mainId=ttc.id")->where($where)->limit($offset, $limit)->order("ttc.createTime {$order}")->select()->toArray();
                 break;
             case 3:
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $where[] = ["type", "=", $this->user["type"]];
                 $whereRaw = "firstDepPassTime is not null or (checkCompanyIds is null and highProcess >=1)";
                 break;
             case 4:
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "in", [-1, 35]];
                 break;
             case 5:
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "=", 35];
                 $where[] = ["isPublic", "=", 6];
@@ -270,7 +270,11 @@ class TalentTypeChange extends AdminController {
             $response->msg = "只能修改初审驳回的数据";
             return $response;
         }
-        $talentInfo = \app\common\api\VerifyApi::getOne($info["talentId"]);
+        if (strlen($info["talentId"]) == 19) {
+            $talentInfo = \app\common\api\VerifyApi::getPassOneByIdCard($info["idCard"]);
+        } else {
+            $talentInfo = \app\common\api\VerifyApi::getOne($info["talentId"]);
+        }
         if (!$talentInfo || $talentInfo["checkState"] != \app\common\api\TalentState::CERTIFICATED || $talentInfo["delete"] == 1) {
             $response->msg = "系统错误,请联系管理员";
             return $response;
@@ -745,7 +749,7 @@ class TalentTypeChange extends AdminController {
         $info = $this->request->param();
         $response = new \stdClass();
         $where = [];
-        $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+        //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
         $where[] = ["type", "=", $this->user["type"]];
         if ($info) {
             if (\StrUtil::isNotEmpAndNull($info["talentName"])) {
@@ -1081,7 +1085,7 @@ class TalentTypeChange extends AdminController {
         if (!strtotime($startTime) || !strtotime($endTime))
             return json(["msg" => "时间格式错误"]);
         $where = [];
-        $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+        //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
         $where[] = ["type", "=", $this->user["type"]];
         $where[] = ["publicBatch", "between", [$startTime, $endTime]];
         $list = ttcModel::where($where)->order("publicBatch")->select()->toArray();
@@ -1397,7 +1401,7 @@ class TalentTypeChange extends AdminController {
         if (!strtotime($startTime) || !strtotime($endTime))
             return json(["msg" => "时间格式错误"]);
         $where = [];
-        $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+        //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
         $where[] = ["type", "=", $this->user["type"]];
         $where[] = ["newIdentifyMonth", "between", [$startTime, $endTime]];
         $list = ttcModel::where($where)->order("newIdentifyMonth")->select()->toArray();
@@ -1547,11 +1551,12 @@ class TalentTypeChange extends AdminController {
                         return json(["msg" => "只能对公布通过的对象发放人才码,请核查待发放人才码名单后再重新发放人才码"]);
                     }
                     if (strlen($change["talentId"]) == 19) {
-                        $newInfo = ttcApi::getOne($id);
-                        if ($newInfo) {
-                            $change["talentId"] = $newInfo["talentId"];
-                            $change["newIdentifyCondition"] = $newInfo["newIdentifyCondition"];
+                        $talentInfo = \app\common\api\VerifyApi::getPassOneByIdCard($change["idCard"]);
+                        if (!$talentInfo) {
+                            Db::rollback();
+                            return json(["msg" => "在人才库中匹配不到申请人【" . $change["talentName"] . "】"]);
                         }
+                        $change["talentId"] = $talentInfo["id"];
                     }
                     $no_prefix = $_prefix_type . $year . $change["newTalentArrange"];
                     $where = [];
@@ -1694,7 +1699,7 @@ class TalentTypeChange extends AdminController {
         switch ($process) {
             case -1:
                 $where[] = ["type", "=", $this->user["type"]];
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $company = \app\common\api\CompanyApi::getOne($this->user["companyId"]);
                 $where[] = ["beforeCheckCompany", "EXP", Db::raw("is not null")];
                 if ($this->user["code"] != $company["code"]) {
@@ -1704,7 +1709,7 @@ class TalentTypeChange extends AdminController {
             case 1:
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "not in", [3, 5]];
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 break;
             case 2:
                 //$where[] = ["ttc.type", "=", $this->user["type"]];
@@ -1715,7 +1720,7 @@ class TalentTypeChange extends AdminController {
                     $where[] = ["td.companyId", "=", $companyId];
                 }
                 $where[] = ["td.type", "=", ProjectState::LEVELCHANGE];
-                $where[] = ["ttc.createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["ttc.createTime", ">=", "2022-10-01 00:00:00"];
                 switch ($checkState) {
                     case 1:
                     case 2:
@@ -1731,19 +1736,19 @@ class TalentTypeChange extends AdminController {
                 break;
             case 3:
                 $where[] = ["type", "=", $this->user["type"]];
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 $whereRaw = "firstDepPassTime is not null or (checkCompanyIds is null and highProcess >=1)";
                 break;
             case 4:
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "in", [-1, 35]];
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 break;
             case 5:
                 $where[] = ["type", "=", $this->user["type"]];
                 $where[] = ["checkState", "=", 35];
                 $where[] = ["isPublic", "=", 6];
-                $where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
+                //$where[] = ["createTime", ">=", "2022-10-01 00:00:00"];
                 break;
         }
         if ($process != 2) {

+ 8 - 1
app/common/api/VerifyApi.php

@@ -202,6 +202,14 @@ class VerifyApi {
         return Talent::findOrEmpty($id)->toArray();
     }
 
+    public static function getPassOneByIdCard($idCard) {
+        $where = [];
+        $where[] = ["card_number", "=", $idCard];
+        $where[] = ["checkState", "=", TalentState::CERTIFICATED];
+        $where[] = ["delete", "=", 0];
+        return Talent::where($where)->order("talent_arrange asc")->find();
+    }
+
     /**
      * 获得新的需要重审的部门集合(如果$oriReCheckCompanyIds为空,返回认定条件审核部门集合$talentConditionCompanyIds)
      * @param type $oriReCheckCompanyIds 原来的需要再审核的部门id集合
@@ -1379,5 +1387,4 @@ class VerifyApi {
         $twiceIdentifyPersons = getJsonConfig("../sys_config.json", "twice_indentify_person");
         return $twiceIdentifyPersons;
     }
-
 }

+ 6 - 2
app/enterprise/controller/TalentTypeChange.php

@@ -299,7 +299,12 @@ class TalentTypeChange extends EnterpriseController {
             $response->msg = "只能修改总院驳回的数据";
             return $response;
         }
-        $talentInfo = \app\common\api\VerifyApi::getOne($info["talentId"]);
+
+        if (strlen($info["talentId"]) == 19) {
+            $talentInfo = \app\common\api\VerifyApi::getPassOneByIdCard($info["idCard"]);
+        } else {
+            $talentInfo = \app\common\api\VerifyApi::getOne($info["talentId"]);
+        }
         if (!$talentInfo || $talentInfo["checkState"] != \app\common\api\TalentState::CERTIFICATED || $talentInfo["delete"] == 1) {
             $response->msg = "系统错误,请联系管理员";
             return $response;
@@ -600,5 +605,4 @@ class TalentTypeChange extends EnterpriseController {
         }
         return true;
     }
-
 }