Browse Source

"部门并审将所有状态统一表述并分类(含搜索栏,列表、导出记录):
1.待部门并审(首次提交)
2.待部门并审(重新提交)
3.部门并审通过
4.部门并审驳回"

sugangqiang 2 years ago
parent
commit
d667b8547e

+ 6 - 2
app/admin/view/talent/dept_verify.html

@@ -106,9 +106,13 @@
                                     </div>
                                     <select class="form-control" id="checkState">
                                         <option value="">---请选择---</option>
-                                        <option value="1">待审核</option>
+                                        <!--<option value="1">待审核</option>
                                         <option value="2">已驳回</option>
-                                        <option value="3">已通过</option>
+                                        <option value="3">已通过</option>-->
+                                        <option value="1">待部门并审(首次提交)</option>
+                                        <option value="2">待部门并审(重新提交)</option>
+                                        <option value="3">部门并审通过</option>
+                                        <option value="4">部门并审驳回</option>
                                     </select>
                                 </div>                            
                             </div>

+ 61 - 28
app/common/api/VerifyApi.php

@@ -158,16 +158,22 @@ class VerifyApi {
             $where[] = ["tc.companyIds", "like", "%" . $params["company_id"] . "%"];
         }
         switch ($params["checkState"]) {
-            case 1:
+            case 1://待部门并审(首次提交)
                 $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
                 $where[] = ["ti.pass_dept_check", "=", 0];
+                $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                 break;
-            case 2:
-                $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
+            case 2://待部门并审(重新提交)
+                $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                $where[] = ["ti.pass_dept_check", "=", 0];
+                $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                 break;
-            case 3:
+            case 3://部门并审通过
                 $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_PASS];
                 break;
+            case 4://部门并审驳回
+                $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
+                break;
             default:
                 $whereRaw = sprintf("(tl.state=%d and ti.pass_dept_check=0) or (tl.state=%d) or (tl.state=%d)", TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT);
                 break;
@@ -180,15 +186,17 @@ class VerifyApi {
                         ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
                         ->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")
+                        ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                         ->where($where)
                         ->where($whereRaw)->count();
         $list = 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,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")
+                        ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                         ->where($where)
                         ->where($whereRaw)
-                        ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tc.companyIds")
+                        ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tc.companyIds,tl2.resubmit")
                         ->limit($offset, $limit)->order("ti.createTime " . $order)
                         ->select()->toArray();
         foreach ($list as &$item) {
@@ -218,21 +226,24 @@ class VerifyApi {
         $limit = $params["limit"] ?: 10;
         $companyId = session("user")["companyId"];
         switch ($params["checkState"]) {
-            case 1:
-                //待审核
+            case 1://待部门并审(首次提交)
                 $where[] = ["tl.active", "=", 0];
                 $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                 break;
-            case 2:
-                //已驳回
-                $where[] = ["tl.active", "=", 1];
-                $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
+            case 2://待部门并审(重新提交)
+                $where[] = ["tl.active", "=", 0];
+                $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                 break;
-            case 3:
-                //已通过
+            case 3://部门并审通过
                 $where[] = ["tl.active", "=", 1];
                 $where[] = ["tl.new_state", "=", TalentState::DEPT_VERIFY_PASS];
                 break;
+            case 4://部门并审驳回
+                $where[] = ["tl.active", "=", 1];
+                $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
+                break;
             default:
                 $where = 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);
                 break;
@@ -244,15 +255,17 @@ class VerifyApi {
                         ->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")
+                        ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                         ->where($where)
                         ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])->count();
         $list = 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")
+                        ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                         ->where($where)
                         ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
-                        ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName")
+                        ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',tl.new_state as 'newState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag,tc.name as talentConditionName,tl2.resubmit,tl.active as deptActive")
                         ->limit($offset, $limit)->order("ti.createTime " . $order)
                         ->select()->toArray();
         foreach ($list as &$item) {
@@ -430,13 +443,13 @@ class VerifyApi {
                             ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                             ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
                             ->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")
-                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
+                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
                             ->whereRaw($whereRaw)->where($where)->count();
             $list = Talent::alias("ti")
                             ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                             ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
                             ->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")
-                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
+                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
                             ->whereRaw($whereRaw)
                             ->where($where)
                             ->limit($offset, $limit)
@@ -733,34 +746,43 @@ class VerifyApi {
                             case 1:
                                 $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
                                 $where[] = ["ti.pass_dept_check", "=", 0];
+                                $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                                 break;
                             case 2:
-                                $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
+                                $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                                $where[] = ["ti.pass_dept_check", "=", 0];
+                                $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                                 break;
                             case 3:
                                 $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_PASS];
                                 break;
+                            case 4:
+                                $where[] = ["tl.state", "=", TalentState::DEPT_VERIFY_REJECT];
+                                break;
                             default:
                                 $whereRaw = sprintf("(tl.state=%d and ti.pass_dept_check=0) or (tl.state=%d) or (tl.state=%d)", TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::DEPT_VERIFY_REJECT);
                                 break;
                         }
                     } else {
                         switch ($params["checkState"]) {
-                            case 1:
-                                //待审核
+                            case 1://待部门并审(首次提交)
                                 $where[] = ["tl.active", "=", 0];
                                 $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                                $where[] = ["tl2.resubmit", "EXP", Db::raw("is null")];
                                 break;
-                            case 2:
-                                //已驳回
-                                $where[] = ["tl.active", "=", 1];
-                                $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
+                            case 2://待部门并审(重新提交)
+                                $where[] = ["tl.active", "=", 0];
+                                $where[] = ["tl.state", "=", TalentState::FST_VERIFY_PASS];
+                                $where[] = ["tl2.resubmit", "EXP", Db::raw("is not null")];
                                 break;
-                            case 3:
-                                //已通过
+                            case 3://部门并审通过
                                 $where[] = ["tl.active", "=", 1];
                                 $where[] = ["tl.new_state", "=", TalentState::DEPT_VERIFY_PASS];
                                 break;
+                            case 4://部门并审驳回
+                                $where[] = ["tl.active", "=", 1];
+                                $where[] = ["tl.new_state", "=", TalentState::SCND_SUBMIT];
+                                break;
                             default:
                                 $where = 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);
                                 break;
@@ -810,11 +832,13 @@ class VerifyApi {
         $fields[] = "tl.last_state";
         $fields[] = "tc.companyIds";
         if ($process == 4) {
+            $fields[] = "tl2.resubmit";
             if ($company_info["code"] == "super" || $company_info["code"] == "rsj") {
                 $list = 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,description,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")
+                                ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                                 ->where($where)
                                 ->where($whereRaw)
                                 ->field($fields)
@@ -827,6 +851,7 @@ class VerifyApi {
                                 ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
                                 ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                                 ->leftJoin("(select mainId,active,description,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")
+                                ->leftJoin(sprintf("(select id as resubmit,mainId from new_talent_checklog where state in(%d,%d) and step is null and `type`=1 and `active`=1 group by mainId) as tl2", TalentState::DEPT_VERIFY_REJECT, TalentState::REVERIFY_REJECT), "`tl2`.mainId=`ti`.id")
                                 ->where($where)
                                 ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
                                 ->field($fields)
@@ -838,7 +863,7 @@ class VerifyApi {
                             ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
                             ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
                             ->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")
-                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=15 and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
+                            ->leftJoin("(select id as resubmit,mainId from new_talent_checklog where state=" . TalentState::REVERIFY_REJECT . " and `type`=1 and `active`=1 group by mainId) as tl2", "`tl2`.mainId=`ti`.id")
                             ->whereRaw($whereRaw)
                             ->where($where)
                             ->field($fields)
@@ -901,7 +926,11 @@ class VerifyApi {
             } else if ($item["state"] == TalentState::FST_VERIFY_PASS) {
                 if ($item["deptCheckState"]) {
                     if ($item["acitve"] == 0 && $item["state"] == TalentState::FST_VERIFY_PASS) {
-                        $item["checkState"] = "待部门并审";
+                        if ($item["resubmit"]) {
+                            $item["checkState"] = "待部门并审(重新提交)";
+                        } else {
+                            $item["checkState"] = "待部门并审(首次提交)";
+                        }
                     }
                     if ($item["active"] == 1 && $item["new_state"] == TalentState::DEPT_VERIFY_PASS) {
                         $item["checkState"] = "部门并审通过";
@@ -925,7 +954,11 @@ class VerifyApi {
                         if ($process == 3) {
                             $item["checkState"] = "初审通过(待部门并审)";
                         } else {
-                            $item["checkState"] = "待部门并审";
+                            if ($item["resubmit"]) {
+                                $item["checkState"] = "待部门并审(重新提交)";
+                            } else {
+                                $item["checkState"] = "待部门并审(首次提交)";
+                            }
                         }
                     }
                 }

+ 16 - 10
public/static/modular/talentIdentify/talentInfo/talentInfo_base.js

@@ -64,19 +64,21 @@ TalentInfo.initColumn = function () {
         },
         {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
         {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
-        {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
+        {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
             formatter: function (value, row, index) {
                 if (typeof row.deptCheckState != "undefined") {
-                    if (row.deptCheckState == 12) {
-                        return "<span class='label label-primary'>部门并审通过</span>"
-                    } else if (row.deptCheckState == 9) {
-                        if (row.lastState == 13) {
-                            return "<span class='label label-success'>待重新审核</span>"
+                    if (row.deptActive == 0 && row.realState == 10) {
+                        if (row.resubmit) {
+                            return "<span class='label label-success'>待部门并审(重新提交)</span>";
                         } else {
-                            return "<span class='label label-danger'>部门并审驳回</span>"
+                            return "<span class='label label-success'>待部门并审(首次提交)</span>";
                         }
-                    } else {
-                        return "<span class='label label-success'>待部门并审</span>"
+                    }
+                    if (row.deptActive == 1 && row.newState == 12) {
+                        return "<span class='label label-primary'>部门并审通过</span>";
+                    }
+                    if (row.deptActive == 1 && row.newState == 9) {
+                        return "<span class='label label-danger'>部门并审驳回</span>";
                     }
                 } else {
                     if (value == 2) {
@@ -102,7 +104,11 @@ TalentInfo.initColumn = function () {
                             return "<span class='label label-success'>初审通过(待部门并审)</span>"
                         }
                         if (process == 4) {
-                            return "<span class='label label-success'>待部门并审</span>";
+                            if (row.resubmit) {
+                                return "<span class='label label-success'>待部门并审(重新提交)</span>";
+                            } else {
+                                return "<span class='label label-success'>待部门并审(首次提交)</span>";
+                            }
                         }
                         if (row.resubmit) {
                             return "<span class='label label-success'>待复审(重新提交)</span>";