ソースを参照

人才层次变更增加超级部门设置,设置后可查看当前类型下所有部门审核数据

sugangqiang 1 年間 前
コミット
db617a351d

+ 57 - 21
app/admin/controller/TalentTypeChange.php

@@ -89,8 +89,12 @@ class TalentTypeChange extends AdminController {
                 break;
             case 2:
                 //$where[] = ["ttc.type", "=", $this->user["type"]];
-                $companyId = $this->user["companyId"];
-                $where[] = ["td.companyId", "=", $companyId];
+                if (ttcApi::chkUserInSuperDeptUsers()) {
+                    $where[] = ["ttc.type", "=", $this->user["type"]];
+                } else {
+                    $companyId = $this->user["companyId"];
+                    $where[] = ["td.companyId", "=", $companyId];
+                }
                 $where[] = ["td.type", "=", ProjectState::LEVELCHANGE];
                 switch ($params["checkState"]) {
                     case 1:
@@ -379,6 +383,10 @@ class TalentTypeChange extends AdminController {
                 }
                 break;
             case 2:
+                if ($this->user["companyId"] != $companyId) {
+                    $response->msg = "非审核部门,审核失败";
+                    return $response;
+                }
                 if ($info["checkState"] != MainState::NEED_DEP_CHECK) {
                     $response->msg = "该申报不在审核范围内,无法审核";
                 } else {
@@ -635,6 +643,10 @@ class TalentTypeChange extends AdminController {
                     Db::table("un_talent_type_change")->update($data);
                     break;
                 case 2:
+                    if ($this->user["companyId"] != $companyId) {
+                        $response->msg = "非审核部门,审核失败";
+                        return $response;
+                    }
                     $where = [];
                     $where[] = ["mainId", "=", $id];
                     $where[] = ["companyId", "=", $companyId];
@@ -1673,9 +1685,13 @@ class TalentTypeChange extends AdminController {
                 $where[] = ["checkState", "not in", [3, 5]];
                 break;
             case 2:
-                $where[] = ["ttc.type", "=", $this->user["type"]];
-                $companyId = $this->user["companyId"];
-                $where[] = ["td.companyId", "=", $companyId];
+                //$where[] = ["ttc.type", "=", $this->user["type"]];
+                if (ttcApi::chkUserInSuperDeptUsers()) {
+                    $where[] = ["ttc.type", "=", $this->user["type"]];
+                } else {
+                    $companyId = $this->user["companyId"];
+                    $where[] = ["td.companyId", "=", $companyId];
+                }
                 $where[] = ["td.type", "=", ProjectState::LEVELCHANGE];
                 switch ($checkState) {
                     case 1:
@@ -1710,26 +1726,46 @@ class TalentTypeChange extends AdminController {
             } else {
                 $list = ttcModel::where($where)->select()->toArray();
             }
+            $columns = [
+                "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
+                "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新入选来源地级市", "新入选来源县市区",
+                "新人才层次", "新认定条件", "新认定条件证书取得时间", "新认定条件过期时间", "新认定条件名称",
+                "新泉州高层次人才证书发证日期", "新泉州高层次人才证书的有效期", "新引进方式", "新公布入选月份", "新人才编号",
+                "审核状态", "公示状态"
+            ];
+        } else {
+            $columns = [
+                "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
+                "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新入选来源地级市", "新入选来源县市区",
+                "新人才层次", "新认定条件", "新认定条件证书取得时间", "新认定条件过期时间", "新认定条件名称",
+                "新泉州高层次人才证书发证日期", "新泉州高层次人才证书的有效期", "新引进方式", "新公布入选月份", "新人才编号",
+                "审核单位", "审核状态", "公示状态"
+            ];
         }
         $list = $this->translateToChinese($list, $process);
-        $columns = [
-            "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
-            "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新入选来源地级市", "新入选来源县市区",
-            "新人才层次", "新认定条件", "新认定条件证书取得时间", "新认定条件过期时间", "新认定条件名称",
-            "新泉州高层次人才证书发证日期", "新泉州高层次人才证书的有效期", "新引进方式", "新公布入选月份", "新人才编号",
-            "审核状态", "公示状态"
-        ];
         $rows = [];
         foreach ($list as $item) {
-            $rows[] = [
-                $item["talentName"], $item["idCard"], $item["enterpriseName"], $item["streetName"], $item["oldYear"], $item["oldSourceName"], $item["oldFromCityName"], $item["oldFromCountyName"],
-                $item["oldTalentArrangeName"], $item["oldIdentifyConditionCH"], $item["oldIdentifyGetTime"], $item["oldIdentifyOutTime"], $item["oldIdentifyConditionName"],
-                $item["oldCertificateStartTime"], $item["oldCertificateOutTime"], $item["oldIntroductionModeName"], $item["oldIdentifyMonth"], $item["oldCertificateNO"],
-                $item["newYear"], $item["newSourceName"], $item["newFromCityName"], $item["newFromCountyName"],
-                $item["newTalentArrangeName"], $item["newIdentifyConditionCH"], $item["newIdentifyGetTime"], $item["newIdentifyOutTime"], $item["newIdentifyConditionName"],
-                $item["newCertificateStartTime"], $item["newCertificateOutTime"], $item["newIntroductionModeName"], $item["newIdentifyMonth"], $item["newCertificateNO"],
-                $item["checkStateName"], $item["isPublicName"]
-            ];
+            if ($item["companyId"]) {
+                $rows[] = [
+                    $item["talentName"], $item["idCard"], $item["enterpriseName"], $item["streetName"], $item["oldYear"], $item["oldSourceName"], $item["oldFromCityName"], $item["oldFromCountyName"],
+                    $item["oldTalentArrangeName"], $item["oldIdentifyConditionCH"], $item["oldIdentifyGetTime"], $item["oldIdentifyOutTime"], $item["oldIdentifyConditionName"],
+                    $item["oldCertificateStartTime"], $item["oldCertificateOutTime"], $item["oldIntroductionModeName"], $item["oldIdentifyMonth"], $item["oldCertificateNO"],
+                    $item["newYear"], $item["newSourceName"], $item["newFromCityName"], $item["newFromCountyName"],
+                    $item["newTalentArrangeName"], $item["newIdentifyConditionCH"], $item["newIdentifyGetTime"], $item["newIdentifyOutTime"], $item["newIdentifyConditionName"],
+                    $item["newCertificateStartTime"], $item["newCertificateOutTime"], $item["newIntroductionModeName"], $item["newIdentifyMonth"], $item["newCertificateNO"],
+                    getCacheById("Company", $item["companyId"], "name"), $item["checkStateName"], $item["isPublicName"]
+                ];
+            } else {
+                $rows[] = [
+                    $item["talentName"], $item["idCard"], $item["enterpriseName"], $item["streetName"], $item["oldYear"], $item["oldSourceName"], $item["oldFromCityName"], $item["oldFromCountyName"],
+                    $item["oldTalentArrangeName"], $item["oldIdentifyConditionCH"], $item["oldIdentifyGetTime"], $item["oldIdentifyOutTime"], $item["oldIdentifyConditionName"],
+                    $item["oldCertificateStartTime"], $item["oldCertificateOutTime"], $item["oldIntroductionModeName"], $item["oldIdentifyMonth"], $item["oldCertificateNO"],
+                    $item["newYear"], $item["newSourceName"], $item["newFromCityName"], $item["newFromCountyName"],
+                    $item["newTalentArrangeName"], $item["newIdentifyConditionCH"], $item["newIdentifyGetTime"], $item["newIdentifyOutTime"], $item["newIdentifyConditionName"],
+                    $item["newCertificateStartTime"], $item["newCertificateOutTime"], $item["newIntroductionModeName"], $item["newIdentifyMonth"], $item["newCertificateNO"],
+                    $item["checkStateName"], $item["isPublicName"]
+                ];
+            }
         }
         $filename = "人才层次变更导出";
         if ($rows) {

+ 13 - 0
app/common/api/TalentTypeChangeApi.php

@@ -44,4 +44,17 @@ class TalentTypeChangeApi {
         return $newIdentifyCondtion;
     }
 
+    private static function getSuperPrivsForDeptVerify() {
+        $config = getJsonConfig("../sys_config.json", "super_privs_for_talent_type_change_dept_verify");
+        return $config;
+    }
+
+    public static function chkUserInSuperDeptUsers() {
+        $config = self::getSuperPrivsForDeptVerify();
+        $companyId = session("user")["companyId"];
+        $company = getCacheById("Company", $companyId);
+        $account = session("user")["account"];
+        return in_array($company["code"], $config["companys"]) || in_array($account, $config["users"]);
+    }
+
 }

+ 4 - 0
sys_config.json

@@ -6,6 +6,10 @@
         "companys": ["super", "人社局人才服务科"],
         "users": []
     },
+    "super_privs_for_talent_type_change_dept_verify": {
+        "companys": ["super", "人社局人才服务科"],
+        "users": []
+    },
     "gj_special_person": {
         "350102196812170650": {
             "realname": "李明",