Jelajahi Sumber

增加待办事项提示(部门并审、复审)

sugangqiang 2 tahun lalu
induk
melakukan
c40a2f127f

+ 51 - 5
app/admin/controller/Index.php

@@ -25,18 +25,64 @@ class Index extends AdminController {
 
         $codes = \app\common\api\MenuApi::getCodesByRoleId($this->user["roleid"]);
         $backLogCount = 0;
-        if (in_array("talentInfo_first", $codes)) {
-            $where[] = ["e.type", "=", session("user")["type"]];
+        $userType = session("user")["type"];
+        $companyId = session("user")["companyId"];
+        if (in_array("talentInfo_firstCheck", $codes)) {
+            $where[] = ["e.type", "=", $userType];
             $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
             $where[] = ["tl.state", "in", [TalentState::SCND_SUBMIT, TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT]];
             $count = Talent::alias("ti")
                             ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                             ->leftJoin("(select mainId,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
                             ->where($where)->count();
-            $backlog = ["title" => "【人才认定申报】待初审", "url" => "$('a.J_menuItem[href=\"/admin/talent/fst_verify\"]').click()", "count" => $count];
-            $vars["backlog"][] = $backlog;
-            $backLogCount += $count;
+            if ($count > 0) {
+                $backlog = ["title" => "【人才认定申报】待初审", "url" => "$('a.J_menuItem[href=\"/admin/talent/fst_verify\"]').click()", "count" => $count];
+                $vars["backlog"][] = $backlog;
+                $backLogCount += $count;
+            }
         }
+        if (in_array("talentInfo_depCheck", $codes)) {
+            $where = [];
+            $where[] = ["e.type", "=", $userType];
+            if (\app\common\api\VerifyApi::chkUserInSuperDeptUsers()) {
+                $where[] = ["ti.checkState", "=", TalentState::FST_VERIFY_PASS];
+                $where[] = ["ti.pass_dept_check", "=", 0];
+                $count = Talent::alias("ti")
+                                ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                                ->where($where)->count();
+            } else {
+                $where[] = ["tl.active", "=", 0];
+                $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                $count = Talent::alias("ti")
+                                ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
+                                ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                                ->leftJoin("(select mainId,active,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,companyId,mainId,`type`)) in (select md5(concat(max(createTime),companyId,mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step`=3 and companyId='{$companyId}' and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
+                                ->where($where)
+                                ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])->count();
+            }
+            if ($count > 0) {
+                $backlog = ["title" => "【人才认定申报】待部门并审", "url" => "$('a.J_menuItem[href=\"/admin/talent/dept_verify\"]').click()", "count" => $count];
+                $vars["backlog"][] = $backlog;
+                $backLogCount += $count;
+            }
+        }
+        if (in_array("talentInfo_thirdCheck", $codes)) {
+            $whereRaw = sprintf("((ti.checkState=%d and ti.pass_dept_check=0) or (ti.checkState=%d and ti.pass_dept_check=1) or (ti.checkState=%d and (tc.companyIds is null or tc.companyIds = ''))) and e.type=%d"
+                    , TalentState::DEPT_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::FST_VERIFY_PASS, $userType);
+
+            $count = Talent::alias("ti")
+                            ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                            ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
+                            ->whereRaw($whereRaw)->count();
+            if ($count > 0) {
+                $backlog = ["title" => "【人才认定申报】待复审", "url" => "$('a.J_menuItem[href=\"/admin/talent/re_verify\"]').click()", "count" => $count];
+                $vars["backlog"][] = $backlog;
+                $backLogCount += $count;
+            }
+        }
+
+
+
         $vars["backLogCount"] = $backLogCount;
         return view("", $vars);
     }

+ 1 - 1
app/command/DeptVerifyChecker.php

@@ -48,7 +48,7 @@ class DeptVerifyChecker extends Command {
         for ($i = 0; $i < count($jjrc_list); $i++) {
             $jjrc_counts[$jjrc_list[$i]] += 1;
         }
-        $codes = ["talentInfo_dep"];
+        $codes = ["talentInfo_depCheck"];
         $menuIds = MenuApi::getMenuIdsByCodes($codes);
 
         $where = [];

+ 1 - 1
app/command/FstVerifyChecker.php

@@ -46,7 +46,7 @@ class FstVerifyChecker extends Command {
                         ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                         ->leftJoin("(select mainId,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
                         ->where($where)->count();
-        $codes = ["talentInfo_first"];
+        $codes = ["talentInfo_firstCheck"];
         $menuIds = MenuApi::getMenuIdsByCodes($codes);
 
         $where = [];

+ 1 - 1
app/command/ReVerifyChecker.php

@@ -37,7 +37,7 @@ class ReVerifyChecker extends Command {
                         ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                         ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) from `new_talent_checklog` where `type`=1 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ti.id")
                         ->where($where)->whereRaw($whereRaw)->group("e.type")->field("count(*) as count,e.type")->select()->toArray();
-        $codes = ["talentInfo_third"];
+        $codes = ["talentInfo_thirdCheck"];
         $menuIds = MenuApi::getMenuIdsByCodes($codes);
         $where = [];
         $where[] = ["menuid", "in", $menuIds];