Procházet zdrojové kódy

修复撤销复审产生的问题

sugangqiang před 1 rokem
rodič
revize
f63c48f3f1

+ 7 - 3
app/admin/controller/Talent.php

@@ -1552,8 +1552,12 @@ class Talent extends AdminController {
             $returnObj->msg = "当前对象不是复核通过状态,无法撤销";
             return json($returnObj);
         }
-        $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT, 0, ["active", "=", 1]);
-        if (!in_array($lastLog["last_state"], [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]) || $lastLog["state"] != TalentState::REVERIFY_PASS) {
+        $where = [];
+        $where[] = ["last_state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+        $where[] = ["state", "=", TalentState::REVERIFY_PASS];
+        $where[] = ["active", "=", 1];
+        $lastLog = TalentLogApi::getLastLogEx($id, ProjectState::TALENT, 0, $where);
+        if ($lastLog["state"] != TalentState::REVERIFY_PASS && $lastLog["active"] != 1) {
             $returnObj->msg = "当前对象不是复核通过状态,无法撤销";
             return json($returnObj);
         }
@@ -1565,7 +1569,7 @@ class Talent extends AdminController {
             $upd["id"] = $id;
             $upd["checkState"] = $lastLog["last_state"];
             if (TalentModel::update($upd)) {
-                TalentLogApi::write(ProjectState::TALENT, $id, $lastLog["last_state"], "撤销原因:" . $msg, 1);
+                TalentLogApi::write(ProjectState::TALENT, $id, [TalentState::REVERIFY_CANCEL, $lastLog["last_state"]], "撤销原因:" . $msg, 1);
             }
             $returnObj->msg = "撤销成功";
             $returnObj->code = 200;

+ 1 - 1
app/command/ReVerifyChecker.php

@@ -29,7 +29,7 @@ class ReVerifyChecker extends Command {
     }
 
     protected function execute(Input $input, Output $output) {
-        $whereRaw = sprintf("(tl.state in (14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
+        $whereRaw = sprintf("(tl.state in (-14,14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
         //$whereRaw = sprintf("(ti.checkState in (14,15,16)) or (ti.checkState=12 and ti.pass_dept_check=0) or (ti.checkState=10 and ti.pass_dept_check=1) or (ti.checkState=10 and (tc.companyIds is null or tc.companyIds = ''))");
         $where[] = ["ti.checkState", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
         $where[] = ["e.type", "=", 1]; //只对晋江人才相关部门发送短信

+ 3 - 0
app/common/api/DictApi.php

@@ -336,6 +336,9 @@ class DictApi {
     public static function getTalentInfoStateName($state, $step = 0, $last_state = 0) {
         $str = "";
         switch ($state) {
+            case -14:
+                $str = '<span class="label label-success">待复审</span>';
+                break;
             case -2:
                 $str = '<span class="label label-danger">初审失败</span>';
                 break;

+ 7 - 7
app/common/api/VerifyApi.php

@@ -457,14 +457,14 @@ class VerifyApi {
             }
         }
         if ($process == 5) {
-            $whereRaw = sprintf("(tl.state in (14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
+            $whereRaw = sprintf("(tl.state in (-14,14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
             switch ($params["checkState"]) {
                 case 1://待复审(首次提交)
-                    $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                    $where[] = ["tl.state", "in", [TalentState::REVERIFY_CANCEL, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
                     $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                     break;
                 case 2://待复审(重新提交)
-                    $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                    $where[] = ["tl.state", "in", [TalentState::REVERIFY_CANCEL, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
                     $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                     break;
                 case 3://复审通过
@@ -478,7 +478,7 @@ class VerifyApi {
                     break;
                 default:
                     if ($type == 2) {
-                        $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                        $where[] = ["tl.state", "in", [TalentState::REVERIFY_CANCEL, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
                     }
                     break;
             }
@@ -869,14 +869,14 @@ class VerifyApi {
                     }
                     break;
                 case 5:
-                    $whereRaw = sprintf("(tl.state in (14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
+                    $whereRaw = sprintf("(tl.state in (-14,14,15,16)) or (tl.state=12 and ti.pass_dept_check=0) or (tl.state=10 and ti.pass_dept_check=1) or (tl.state=10 and (tc.companyIds is null or tc.companyIds = ''))");
                     switch ($params["checkState"]) {
                         case 1://待复审(首次提交)
-                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                            $where[] = ["tl.state", "in", [TalentState::REVERIFY_CANCEL, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
                             $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                             break;
                         case 2://待复审(重新提交)
-                            $where[] = ["tl.state", "in", [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
+                            $where[] = ["tl.state", "in", [TalentState::REVERIFY_CANCEL, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS]];
                             $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                             break;
                         case 3://复审通过