sugangqiang 2 years ago
parent
commit
9cfa751162

+ 139 - 27
app/admin/controller/Talent.php

@@ -9,6 +9,7 @@ use app\common\api\TalentState;
 use app\enterprise\model\Talent as TalentModel;
 use app\enterprise\model\Talent as TalentModel;
 use app\common\api\TalentConditionApi;
 use app\common\api\TalentConditionApi;
 use app\common\api\DictApi;
 use app\common\api\DictApi;
+use app\common\api\EnterpriseApi;
 
 
 /**
 /**
  * Description of Talent
  * Description of Talent
@@ -19,7 +20,7 @@ class Talent extends AdminController {
 
 
     public function selectNeedCheckData() {
     public function selectNeedCheckData() {
         $params = $this->request->param();
         $params = $this->request->param();
-        return json(VerifyApi::getPublicList($params));
+        return json(["code" => 200, "obj" => VerifyApi::getPublicList($params)]);
     }
     }
 
 
     public function common_check() {
     public function common_check() {
@@ -164,16 +165,75 @@ class Talent extends AdminController {
      * 预备人才库-征信通过
      * 预备人才库-征信通过
      * @auth {{/talentInfo/hczxPass}}
      * @auth {{/talentInfo/hczxPass}}
      */
      */
-    public function pre_zx_pass() {
-        
+    public function hczxPass() {
+        $params = $this->request->param();
+        $ids = $params["ids"];
+        $ids = array_filter(explode(",", $ids));
+
+        $msg = "征信通过";
+        $state = 2; //征信核查
+        $pass = true;
+
+        $total = count($ids);
+        $error = 0;
+        $success = 0;
+        foreach ($ids as $id) {
+            $talent_info = VerifyApi::getOne($id);
+            if ($talent_info["isPublic"] != 1 || $talent_info["checkState"] != TalentState::REVERIFY_PASS) {
+                $error++;
+                continue;
+            }
+            if (VerifyApi::setPublic($id, $state, $pass, $msg)) {
+                $success++;
+            } else {
+                $error++;
+            }
+        }
+        return json(["code" => 200, "msg" => sprintf("核查征信成功:共提交%d个人才,通过%d个,失败%d个", $total, $success, $error)]);
     }
     }
 
 
     /**
     /**
      * 预备人才库-征信失信
      * 预备人才库-征信失信
      * @auth {{/talentInfo/hczxReject}}
      * @auth {{/talentInfo/hczxReject}}
      */
      */
-    public function pre_zx_reject() {
-        
+    public function hczxReject() {
+        $params = $this->request->param();
+        $id = $params["id"];
+        $msg = "征信失信:" . $params["outMsg"];
+        $state = 2; //征信核查
+        $pass = false;
+        $talent_info = VerifyApi::getOne($id);
+        if ($talent_info["isPublic"] != 1 || $talent_info["checkState"] != TalentState::REVERIFY_PASS) {
+            return json(["msg" => "当前记录不是待核查征信状态,无法核查"]);
+        }
+        VerifyApi::setPublic($id, $state, $pass, $msg);
+        return json(["code" => 200, "msg" => "已设置征信失信"]);
+    }
+
+    public function exportPublic() {
+        $params = $this->request->param();
+        $ids_arr = array_filter(explode(",", $params["ids"]));
+        $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
+        if ($ids_arr) {
+            $where[] = ["id", "in", $ids_arr];
+            $list = TalentModel::where($where)->order("talent_arrange asc,enterprise_id asc")->select();
+            $rows = [];
+            $i = 1;
+            $talentArranges = DictApi::selectByParentCode("talent_arrange");
+            foreach ($list as $item) {
+                $talent_condition = TalentConditionApi::getOne($item["talent_condition"]);
+                $enterprise = EnterpriseApi::getOne($item["enterprise_id"]);
+                $row = [
+                    $i, $item["apply_year"], $item["name"], $item["sex"] == 1 ? "男" : "女", $enterprise["name"], $talent_condition["name"], $talentArranges[$item["talent_arrange"]], $item["checkState"] == 11 ? "审核通过" : "审核不通过", $enterprise["description"]
+                ];
+                $rows[] = $row;
+                $i++;
+            }
+        }
+        if ($rows) {
+            $filename = "优秀人才公示预览导出";
+            export($columns, $rows, $filename);
+        }
     }
     }
 
 
     /**
     /**
@@ -184,14 +244,6 @@ class Talent extends AdminController {
         
         
     }
     }
 
 
-    /**
-     * 预备人才库-公示通过
-     * @auth {{/talentInfo/publicPass}}
-     */
-    public function pre_public_pass() {
-        
-    }
-
     /**
     /**
      * 预备人才库-公布
      * 预备人才库-公布
      * @auth {{/talentInfo/preparePublish}}
      * @auth {{/talentInfo/preparePublish}}
@@ -281,8 +333,13 @@ class Talent extends AdminController {
     private function fstCheck(\think\Request $request, $talent_info) {
     private function fstCheck(\think\Request $request, $talent_info) {
         $params = $request->param();
         $params = $request->param();
         if ($params["checkState"] == 3) {
         if ($params["checkState"] == 3) {
-            //审核成功
+            //审核成功,并取消设置越过部门并审
+            $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
+            $data["pass_dept_check"] = 0;
+        } else if ($params["checkState"] == 4) {
+            //审核成功,并设置越过部门并审。附加条件:最高进度曾经超过初审2(包含初审,因为再次初审也就证明从上面驳回过,这步是防止前端改checkState=4进来)
             $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
             $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
+            $data["pass_dept_check"] = $talent_info["highProcess"] >= 2 ? 1 : 0;
         } else {
         } else {
             //审核驳回并记录需要修改的字段和上传文件
             //审核驳回并记录需要修改的字段和上传文件
             $checkState = TalentState::SCND_SAVE; //退回材料编辑状态
             $checkState = TalentState::SCND_SAVE; //退回材料编辑状态
@@ -316,16 +373,16 @@ class Talent extends AdminController {
         if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
         if (in_array($log["new_state"], [TalentState::BASE_VERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
             $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
             $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
         }
         }
+        if ($log["new_state"] == TalentState::FST_VERIFY_PASS && $talent_info["pass_dept_check"] == 0) {
+            $data["first_dept_check_time"] = date("Y-m-d H:i:s");
+            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
+            $companyIds = array_filter(explode(",", $condition["companyIds"]));
+            TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
+        }
         $data["id"] = $talent_info["id"];
         $data["id"] = $talent_info["id"];
         $data["checkState"] = $log["new_state"];
         $data["checkState"] = $log["new_state"];
-        $data["first_dept_check_time"] = date("Y-m-d H:i:s");
         TalentModel::update($data);
         TalentModel::update($data);
         TalentLogApi::setActive($log["id"], 1);
         TalentLogApi::setActive($log["id"], 1);
-        $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
-        $companyIds = array_filter(explode(",", $condition["companyIds"]));
-        if ($log["new_state"] == TalentState::FST_VERIFY_PASS) {
-            TalentLogApi::writeDeptLogs($talent_info["id"], $companyIds, TalentState::FST_VERIFY_PASS);
-        }
         return json(["code" => 200, "msg" => "审核成功"]);
         return json(["code" => 200, "msg" => "审核成功"]);
     }
     }
 
 
@@ -336,6 +393,9 @@ class Talent extends AdminController {
      * @return type json
      * @return type json
      */
      */
     private function deptCheck(\think\Request $request, $talent_info, $companys) {
     private function deptCheck(\think\Request $request, $talent_info, $companys) {
+        if ($talent_info["pass_dept_check"] == 1)
+            return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
+
         $params = $request->param();
         $params = $request->param();
         if ($params["checkState"] == 3) {
         if ($params["checkState"] == 3) {
             //审核成功
             //审核成功
@@ -368,6 +428,9 @@ class Talent extends AdminController {
      * @return type json
      * @return type json
      */
      */
     private function deptSubmitCheck($talent_info, $companys) {
     private function deptSubmitCheck($talent_info, $companys) {
+        if ($talent_info["pass_dept_check"] == 1)
+            return json(["msg" => "不在审核范围。(初审部门已经选择跳过部门并审阶段)"]);
+
         $dept_log = TalentLogApi::getLogByCompanyId($talent_info["id"], $this->user["companyId"], $talent_info["first_dept_check_time"]);
         $dept_log = TalentLogApi::getLogByCompanyId($talent_info["id"], $this->user["companyId"], $talent_info["first_dept_check_time"]);
 
 
         $over = 0; //完成度
         $over = 0; //完成度
@@ -490,7 +553,7 @@ class Talent extends AdminController {
         } else if ($checkState == TalentState::FST_VERIFY_PASS) {
         } else if ($checkState == TalentState::FST_VERIFY_PASS) {
             $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
             $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
             $companys = array_filter(explode(",", $condition["companyIds"]));
             $companys = array_filter(explode(",", $condition["companyIds"]));
-            if ($companys) {
+            if ($companys && $talent_info["pass_dept_check"] != 1) {
                 if (!in_array($this->user["companyId"], $companys))
                 if (!in_array($this->user["companyId"], $companys))
                     return json(["msg" => "你的部门不在并审部门列表"]);
                     return json(["msg" => "你的部门不在并审部门列表"]);
                 return $this->deptCheck($request, $talent_info, $companys);
                 return $this->deptCheck($request, $talent_info, $companys);
@@ -519,7 +582,7 @@ class Talent extends AdminController {
         } else if ($checkState == TalentState::FST_VERIFY_PASS) {
         } else if ($checkState == TalentState::FST_VERIFY_PASS) {
             $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
             $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
             $companys = array_filter(explode(",", $condition["companyIds"]));
             $companys = array_filter(explode(",", $condition["companyIds"]));
-            if ($companys) {
+            if ($companys && $talent_info["pass_dept_check"] != 1) {
                 if (!in_array($this->user["companyId"], $companys))
                 if (!in_array($this->user["companyId"], $companys))
                     return json(["msg" => "你的部门不在并审部门列表"]);
                     return json(["msg" => "你的部门不在并审部门列表"]);
                 return $this->deptSubmitCheck($talent_info, $companys);
                 return $this->deptSubmitCheck($talent_info, $companys);
@@ -562,8 +625,13 @@ class Talent extends AdminController {
                         $process = 2;
                         $process = 2;
                         break;
                         break;
                     case 7:
                     case 7:
+                        $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
+                        if ($tc["companyId"] && $talent_info["pass_dept_check"] != 1) {
+                            $process = 3;
+                        } else {
+                            $process = 4;
+                        }
                         $fields = DictApi::getTalentFields(3);
                         $fields = DictApi::getTalentFields(3);
-                        $process = 3;
                         break;
                         break;
                     case 9:
                     case 9:
                         $fields = DictApi::getTalentFields(3);
                         $fields = DictApi::getTalentFields(3);
@@ -604,6 +672,34 @@ class Talent extends AdminController {
         
         
     }
     }
 
 
+    public function exportHczx() {
+        $ids = $this->request->param("ids");
+        $ids_arr = array_filter(explode(",", $ids));
+        if (!$ids_arr) {
+            $res = ["code" => 500, "msg" => "没有选择导出的名单"];
+            echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
+        }
+        $where[] = ["ti.id", "in", $ids_arr];
+        $list = TalentModel::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->field("ti.name,ti.card_type,ti.card_number,e.name as enterpriseName,e.description")->where($where)->select();
+        if (!$list) {
+            $res = ["code" => 500, "msg" => "没有可以导出的内容"];
+            echo sprintf("<script>TalentInfo.callBack(%s);</script>", json_encode($res));
+        }
+        $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "备注"];
+        $rows = [];
+        $i = 1;
+        $card_types = DictApi::selectByParentCode("card_type");
+        foreach ($list as $item) {
+            $row = [
+                $i, $item["name"], $card_types[$item["card_type"]], $item["card_number"], $item["enterpriseName"], $item["description"]
+            ];
+            $rows[] = $row;
+            $i++;
+        }
+        $filename = "优秀人才核查征信名单导出";
+        export($columns, $rows, $filename);
+    }
+
     public function commonExport() {
     public function commonExport() {
         $params = $this->request->param();
         $params = $this->request->param();
         $fields = $params["export"];
         $fields = $params["export"];
@@ -633,13 +729,29 @@ class Talent extends AdminController {
     }
     }
 
 
     public function getPhones() {
     public function getPhones() {
-        $list = VerifyApi::getList($this->request);
-        $phones = array_column($list["rows"], "phone");
-        return json(["code" => 200, "obj" => implode(",", $phones)]);
+        $list = VerifyApi::getListByProcess($this->request->param("process"));
+        $result = [];
+        if ($list) {
+            foreach ($list as $item) {
+                if ($item["phone"] && $item["name"]) {
+                    $result[] = sprintf("%s:%s", $item["name"], $item["phone"]);
+                }
+            }
+        }
+        return json(["code" => 200, "obj" => implode(";", $result)]);
     }
     }
 
 
     public function getEnterprisePhones() {
     public function getEnterprisePhones() {
-        return json(["code" => 200, "obj" => $phones]);
+        $list = VerifyApi::getListByProcess($this->request->param("process"));
+        $result = [];
+        if ($list) {
+            foreach ($list as $item) {
+                if ($item["agentName"] && $item["agentPhone"]) {
+                    $result[] = sprintf("%s:%s", $item["agentName"], $item["agentPhone"]);
+                }
+            }
+        }
+        return json(["code" => 200, "obj" => implode(";", $result)]);
     }
     }
 
 
 }
 }

+ 2 - 2
app/admin/view/talent/base_verify.html

@@ -187,11 +187,11 @@
                                     <i class="fa fa-download"></i>&nbsp;下载
                                     <i class="fa fa-download"></i>&nbsp;下载
                                 </button>
                                 </button>
                             </if>
                             </if>
-                            <if condition="chkCommission('/admin/talent/modify_reject_fields','')">
+                            <!--<if condition="chkCommission('/admin/talent/modify_reject_fields','')">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.updateFieldsAndFiles()" id="">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.updateFieldsAndFiles()" id="">
                                     <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                                     <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                                 </button>
                                 </button>
-                            </if>
+                            </if>-->
                             <if condition="chkCommission('/admin/talent/setNotPass','')">
                             <if condition="chkCommission('/admin/talent/setNotPass','')">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.setNotPass()" id="">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.setNotPass()" id="">
                                     <i class="fa fa-mobile"></i>&nbsp;审核不通过
                                     <i class="fa fa-mobile"></i>&nbsp;审核不通过

+ 2 - 2
app/admin/view/talent/fst_verify.html

@@ -187,11 +187,11 @@
                                     <i class="fa fa-download"></i>&nbsp;下载
                                     <i class="fa fa-download"></i>&nbsp;下载
                                 </button>
                                 </button>
                             </if>
                             </if>
-                            <if condition="chkCommission('/admin/talent/modify_reject_fields','')">
+                            <!--<if condition="chkCommission('/admin/talent/modify_reject_fields','')">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.updateFieldsAndFiles()" id="">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.updateFieldsAndFiles()" id="">
                                     <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                                     <i class="fa fa-edit"></i>&nbsp;修改驳回字段
                                 </button>
                                 </button>
-                            </if>
+                            </if>-->
                             <if condition="chkCommission('/admin/talent/setNotPass','')">
                             <if condition="chkCommission('/admin/talent/setNotPass','')">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.setNotPass()" id="">
                                 <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.setNotPass()" id="">
                                     <i class="fa fa-mobile"></i>&nbsp;审核不通过
                                     <i class="fa fa-mobile"></i>&nbsp;审核不通过

+ 2 - 2
app/admin/view/talent/pre_list.html

@@ -532,8 +532,8 @@
                                 <div class="col-sm-3 spacing">
                                 <div class="col-sm-3 spacing">
                                     <select type="text" class="form-control input-sm"  id="pub_checkState" name="checkState" >
                                     <select type="text" class="form-control input-sm"  id="pub_checkState" name="checkState" >
                                         <option value="">请选择</option>
                                         <option value="">请选择</option>
-                                        <option value="-1">审核不通过</option>
-                                        <option value="35">已通过</option>
+                                        <option value="13">审核不通过</option>
+                                        <option value="11">已通过</option>
                                     </select>
                                     </select>
                                 </div>
                                 </div>
                             </div>
                             </div>

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

@@ -83,6 +83,9 @@ class TalentLogApi {
         if (is_array($state)) {
         if (is_array($state)) {
             $log["state"] = $state[0];
             $log["state"] = $state[0];
             $log["new_state"] = $state[1];
             $log["new_state"] = $state[1];
+            if ($state[2]) {
+                $log["step"] = $state[2];
+            }
         } else {
         } else {
             $log["state"] = $log["new_state"] = $state;
             $log["state"] = $log["new_state"] = $state;
         }
         }

+ 95 - 46
app/common/api/VerifyApi.php

@@ -91,21 +91,9 @@ class VerifyApi {
         $offset = trim($request->param("offset")) ?: 0;
         $offset = trim($request->param("offset")) ?: 0;
         $limit = trim($request->param("limit")) ?: 10;
         $limit = trim($request->param("limit")) ?: 10;
 
 
-        $process = $request->param("process");
-        switch ($process) {
-            case 1:
-                $where[] = ["ti.checkState", "=", 2];
-                break;
-            case 2:
-                $where[] = ["ti.checkState", "=", 6];
-                break;
-            case 3:
-                $where[] = ["ti.checkState", "=", 7];
-                break;
-            case 4:
-                $where[] = ["ti.checkState", "=", 9];
-                break;
-        }
+        $where[] = ["ti.checkState", "=", 7];
+        $where[] = ["ti.pass_dept_check", "=", 0];
+
         $companyId = session("user")["companyId"];
         $companyId = session("user")["companyId"];
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $count = Talent::alias("ti")
         $count = Talent::alias("ti")
@@ -129,37 +117,51 @@ class VerifyApi {
     }
     }
 
 
     public static function getPublicList($params) {
     public static function getPublicList($params) {
-        $type = $params["type"];
+        $order = $params["order"];
+        $offset = $params["offset"];
+        $limit = $params["limit"];
         $where = [];
         $where = [];
+        if ($params["name"]) {
+            $where[] = ["ti.name", "like", "%" . $params["name"] . "%"];
+        }
+        if ($params["sex"]) {
+            $where[] = ["ti.sex", "=", $params["sex"]];
+        }
+        if ($params["checkState"]) {
+            $where[] = ["ti.checkState", "=", $params["checkState"]];
+        }
+        $type = $params["type"];
         switch ($type) {
         switch ($type) {
             case 1:
             case 1:
             case 2:
             case 2:
-                $where[] = ["isPublic", 1];
-                $where[] = ["checkState", 11];
+                $where[] = ["ti.isPublic", "=", 1];
+                $where[] = ["ti.checkState", "in", [11, 13]];
                 break;
                 break;
             case 3:             //公示
             case 3:             //公示
             case 7:             //公示预览
             case 7:             //公示预览
-                $where[] = ["isPublic", 2];
-                $where[] = ["checkState", 11];
+                $where[] = ["ti.isPublic", "=", 2];
+                $where[] = ["ti.checkState", "in", [11, 13]];
                 break;
                 break;
             case 4:
             case 4:
-                $where[] = ["isPublic", 3];
-                $where[] = ["checkState", 11];
+                $where[] = ["ti.isPublic", "=", 3];
+                $where[] = ["ti.checkState", "in", [11, 13]];
                 break;
                 break;
             case 5:
             case 5:
             case 8:             //公布预览
             case 8:             //公布预览
-                $where[] = ["isPublic", 4];
-                $where[] = ["checkState", 11];
+                $where[] = ["ti.isPublic", "=", 4];
+                $where[] = ["ti.checkState", "in", [11, 13]];
                 break;
                 break;
             case 6:
             case 6:
-                $where[] = ["isPublic", 5];
-                $where[] = ["checkState", 11];
+                $where[] = ["ti.isPublic", "=", 5];
+                $where[] = ["ti.checkState", "in", [11, 13]];
                 break;
                 break;
         }
         }
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $count = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->count();
         $count = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->count();
         $list = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
         $list = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
-                        ->where($where)->limit($offset, $limit)->order("ti.createTime " . $order)->field("ti.*,e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")->select()->toArray();
+                        ->where($where)
+                        ->limit($offset, $limit)
+                        ->order("ti.createTime " . $order)->field("ti.*,e.name as enterpriseNname,e.type as enterprise_type,enterpriseTag")->select()->toArray();
         foreach ($list as &$item) {
         foreach ($list as &$item) {
             $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
             $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
@@ -177,28 +179,38 @@ class VerifyApi {
         if ($process == 3) {
         if ($process == 3) {
             return self::getDeptList($request);
             return self::getDeptList($request);
         }
         }
-        switch ($process) {
-            case 1:
-                $where[] = ["ti.checkState", "=", 2];
-                break;
-            case 2:
-                $where[] = ["ti.checkState", "=", 6];
-                break;
-            case 3:
-                $where[] = ["ti.checkState", "=", 7];
-                break;
-            case 4:
-                $where[] = ["ti.checkState", "=", 9];
-                break;
-            case 5:
-                $where[] = ["ti.checkState", "=", 11];
-                break;
+        if ($process == 4) {
+            $where = sprintf("(ti.checkState in (11,12,13)) or (ti.checkState=9 and ti.pass_dept_check=0) or (ti.checkState=7 and ti.pass_dept_check=1) or (ti.checkState=7 and (tc.companyIds is null or tc.companyIds = ''))");
+            $count = Talent::alias("ti")
+                            ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
+                            ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
+                            ->whereRaw($where)->count();
+            $list = Talent::alias("ti")
+                            ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
+                            ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
+                            ->whereRaw($where)
+                            ->limit($offset, $limit)
+                            ->order("ti.createTime " . $order)
+                            ->field("ti.*,e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")
+                            ->select()->toArray();
+        } else {
+            switch ($process) {
+                case 1:
+                    $where[] = ["ti.checkState", "in", [2, -1]];
+                    break;
+                case 2:
+                    $where[] = ["ti.checkState", "in", [6, -2]];
+                    break;
+                case 5:
+                    $where[] = ["ti.checkState", "=", 11];
+                    break;
+            }
+            $count = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->count();
+            $list = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
+                            ->where($where)->limit($offset, $limit)->order("ti.createTime " . $order)->field("ti.*,e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")->select()->toArray();
         }
         }
         $talent_arrange_kvs = DictApi::selectByParentCode("talent_arrange");
         $talent_arrange_kvs = DictApi::selectByParentCode("talent_arrange");
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
         $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
-        $count = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->count();
-        $list = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
-                        ->where($where)->limit($offset, $limit)->order("ti.createTime " . $order)->field("ti.*,e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")->select()->toArray();
         foreach ($list as &$item) {
         foreach ($list as &$item) {
             $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
             $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
             $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
@@ -270,4 +282,41 @@ class VerifyApi {
         return $list;
         return $list;
     }
     }
 
 
+    public static function getListByProcess($process) {
+        switch ($process) {
+            case 1:
+                $where[] = ["ti.checkState", "in", [2, -1]];
+                break;
+            case 2:
+                $where[] = ["ti.checkState", "in", [6, -2]];
+                break;
+            default:
+                return null;
+        }
+        return Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->field("ti.*,e.agentName,e.agentPhone")->select()->toArray();
+    }
+
+    public static function setPublic($mainId, $state, $pass, $msg, $type = 1) {
+        switch ($state) {
+            case 2:
+                if ($pass) {
+                    $data["id"] = $mainId;
+                    $data["isPublic"] = $state;
+                    $data["checkState"] = TalentState::REVERIFY_FAIL;
+                    Talent::update($data);
+                    TalentLogApi::write($type, $mainId, [TalentState::REVERIFY_PASS, TalentState::REVERIFY_PASS, 5], $msg, 1);
+                    return true;
+                } else {
+                    $data["id"] = $mainId;
+                    $data["isPublic"] = $state;
+                    $data["checkState"] = TalentState::REVERIFY_FAIL;
+                    Talent::update($data);
+                    TalentLogApi::write($type, $mainId, [TalentState::REVERIFY_FAIL, TalentState::REVERIFY_FAIL, 5], $msg, 1);
+                    return true;
+                }
+                break;
+        }
+        return false;
+    }
+
 }
 }

+ 12 - 17
app/common/controller/Api.php

@@ -85,14 +85,14 @@ class Api extends BaseController {
         $talentInfo = TalentApi::getOne($mainId);
         $talentInfo = TalentApi::getOne($mainId);
         $condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
         $condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
         $needDeptVerify = false;
         $needDeptVerify = false;
-        if ($condition["companyIds"])
+        if ($condition["companyIds"] && $talentInfo["pass_dept_check"] != 1)
             $needDeptVerify = true;
             $needDeptVerify = true;
         $list = TalentLogApi::getList($type, $mainId);
         $list = TalentLogApi::getList($type, $mainId);
         $new_list = [];
         $new_list = [];
         foreach ($list as $item) {
         foreach ($list as $item) {
-            switch ($item['category']){
+            switch ($item['category']) {
                 case 'enterprise_change':
                 case 'enterprise_change':
-                    switch ($item['step']){
+                    switch ($item['step']) {
                         case 100:
                         case 100:
                             $new_item["stepName"] = "<span class='label'>用户操作</span>";
                             $new_item["stepName"] = "<span class='label'>用户操作</span>";
                             break;
                             break;
@@ -106,7 +106,7 @@ class Api extends BaseController {
                             $new_item["stepName"] = "<span class='label label-info'>重置密码</span>";
                             $new_item["stepName"] = "<span class='label label-info'>重置密码</span>";
                             break;
                             break;
                     }
                     }
-                    switch ($item['state']){
+                    switch ($item['state']) {
                         case 1:
                         case 1:
                             $new_item["stateName"] = "<span class='label label-success'>待提交</span>";
                             $new_item["stateName"] = "<span class='label label-success'>待提交</span>";
                             break;
                             break;
@@ -151,7 +151,6 @@ class Api extends BaseController {
                         }
                         }
                     }
                     }
                     break;
                     break;
-
             }
             }
 
 
             $new_item["description"] = $item["description"];
             $new_item["description"] = $item["description"];
@@ -494,9 +493,9 @@ class Api extends BaseController {
         }
         }
     }
     }
 
 
-    public function changePwd(){
-        $password = \StrUtil::getRequestDecodeParam($this->request,'password');
-        $newPassword = \StrUtil::getRequestDecodeParam($this->request,'newPassword');
+    public function changePwd() {
+        $password = \StrUtil::getRequestDecodeParam($this->request, 'password');
+        $newPassword = \StrUtil::getRequestDecodeParam($this->request, 'newPassword');
         //数据校验(原密码与新密码不能为空)
         //数据校验(原密码与新密码不能为空)
         if (\StrUtil::isEmpOrNull($password)) {
         if (\StrUtil::isEmpOrNull($password)) {
             return json(['code' => 500, 'msg' => "请填写原密码!"]);
             return json(['code' => 500, 'msg' => "请填写原密码!"]);
@@ -508,13 +507,13 @@ class Api extends BaseController {
         try {
         try {
             validate(Enterprise::class)->batch(true)->scene('changePwd')->check(['password' => $password, 'password' => $newPassword]);
             validate(Enterprise::class)->batch(true)->scene('changePwd')->check(['password' => $password, 'password' => $newPassword]);
             $ep = EnterpriseApi::getOne(session("user")['uid']);
             $ep = EnterpriseApi::getOne(session("user")['uid']);
-            if(!$ep){
+            if (!$ep) {
                 return json(['code' => 500, 'msg' => "请刷新页面后重试!"]);
                 return json(['code' => 500, 'msg' => "请刷新页面后重试!"]);
             }
             }
-            if($ep->password != hash('md5',$password)){
+            if ($ep->password != hash('md5', $password)) {
                 return json(['code' => 500, 'msg' => "旧密码不正确!"]);
                 return json(['code' => 500, 'msg' => "旧密码不正确!"]);
             }
             }
-            $ep->password = hash('md5',$newPassword);
+            $ep->password = hash('md5', $newPassword);
             $ep->updateUser = session("user")['uid'];
             $ep->updateUser = session("user")['uid'];
             $ep->updateTime = date("Y-m-d H:i:s");
             $ep->updateTime = date("Y-m-d H:i:s");
             $ep->save();
             $ep->save();
@@ -530,19 +529,15 @@ class Api extends BaseController {
                 'step' => 100,
                 'step' => 100,
                 'stateChange' => null,
                 'stateChange' => null,
                 'description' => '用户修改密码',
                 'description' => '用户修改密码',
-                'createTime' => date("Y-m-d H:i:s",time()),
+                'createTime' => date("Y-m-d H:i:s", time()),
                 'createUser' => '用户'
                 'createUser' => '用户'
             ]);
             ]);
 
 
             return json(['code' => 200, 'msg' => "修改成功!"]);
             return json(['code' => 200, 'msg' => "修改成功!"]);
-
-
-        } catch (ValidateException $e){
+        } catch (ValidateException $e) {
             $error = $e->getError();
             $error = $e->getError();
             return json(['code' => 500, 'msg' => array_pop($error)]);
             return json(['code' => 500, 'msg' => array_pop($error)]);
         }
         }
-
-
     }
     }
 
 
 }
 }

+ 1 - 0
app/enterprise/controller/Talent.php

@@ -162,6 +162,7 @@ class Talent extends EnterpriseController {
                 $res = ["code" => 500, "msg" => "保存失败"];
                 $res = ["code" => 500, "msg" => "保存失败"];
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
                 echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
             }
             }
+            exit();
         }
         }
         $enterprise_info = \app\common\model\Enterprise::find($this->user["uid"]);
         $enterprise_info = \app\common\model\Enterprise::find($this->user["uid"]);
         $info["enterprise"] = $enterprise_info;
         $info["enterprise"] = $enterprise_info;

+ 5 - 3
public/static/modular/talentIdentify/talentInfo/talentInfo_base.js

@@ -48,7 +48,7 @@ TalentInfo.initColumn = function () {
                         return "<span class='label label-success'>待审核</span>"
                         return "<span class='label label-success'>待审核</span>"
                     }
                     }
                 }
                 }
-                if (value == 13) {
+                if (value == 13 || value == -1 || value == -2) {
                     return "<span class='label label-danger'>审核不通过</span>"
                     return "<span class='label label-danger'>审核不通过</span>"
                 }
                 }
                 if (value == 4) {
                 if (value == 4) {
@@ -394,7 +394,8 @@ TalentInfo.sourceCheckd = function (context) {
 }
 }
 
 
 TalentInfo.getPhones = function () {
 TalentInfo.getPhones = function () {
-    var ajax = new $ax("/admin/talent/getPhones", function (data) {
+    var process = $("#process").val();
+    var ajax = new $ax("/admin/talent/getPhones/process/" + process, function (data) {
         if (data.code == 200) {
         if (data.code == 200) {
             layer.open({
             layer.open({
                 type: 1,
                 type: 1,
@@ -416,7 +417,8 @@ TalentInfo.getPhones = function () {
 
 
 
 
 TalentInfo.getEnterprisePhones = function () {
 TalentInfo.getEnterprisePhones = function () {
-    var ajax = new $ax("/admin/talent/getEnterprisePhones", function (data) {
+    var process = $("#process").val();
+    var ajax = new $ax("/admin/talent/getEnterprisePhones/process/" + process, function (data) {
         if (data.code == 200) {
         if (data.code == 200) {
             layer.open({
             layer.open({
                 type: 1,
                 type: 1,

+ 3 - 1
public/static/modular/talentIdentify/talentInfo/talentInfo_common_check.js

@@ -273,8 +273,10 @@ TalentInfoInfoDlg.showFirstCheckModal = function () {
                     if (process <= 3) {
                     if (process <= 3) {
                         optionHtml = '<option value="">请选择</option>\n' +
                         optionHtml = '<option value="">请选择</option>\n' +
                                 '                            <option value="3">审核通过</option>\n' +
                                 '                            <option value="3">审核通过</option>\n' +
+                                (obj.highProcess >= 2 && process == 2 ? '<option value="4">审核通过(跳过部门并审)</option>\n' : "") +
                                 '                            <option value="2">审核驳回</option>\n';
                                 '                            <option value="2">审核驳回</option>\n';
                     }
                     }
+                    console.log(process);
                     if (process == 4) {
                     if (process == 4) {
                         optionHtml = '<option value="">请选择</option>\n' +
                         optionHtml = '<option value="">请选择</option>\n' +
                                 '                            <option value="3">审核通过</option>\n' +
                                 '                            <option value="3">审核通过</option>\n' +
@@ -522,7 +524,7 @@ TalentInfoInfoDlg.creatFieldCheckModal = function () {
                 '                        <div id="field" style="padding-top: 5px;display: none">\n' +
                 '                        <div id="field" style="padding-top: 5px;display: none">\n' +
                 '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
                 '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
                 '                            <div id="field_info">\n' +
                 '                            <div id="field_info">\n' +
-                '                                <ul style="overflow:hidden;">\n' +
+                '                                <ul style="overflow:hidden;list-style:none;">\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
                 '                                <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +

+ 6 - 11
public/static/modular/talentIdentify/talentInfo/talentInfo_prepare.js

@@ -56,11 +56,6 @@ TalentInfo.initColumn = function () {
         {title: '单位标签', field: 'enterprise_tag', visible: isShow, align: 'center', valign: 'middle', width: '100px'},
         {title: '单位标签', field: 'enterprise_tag', visible: isShow, align: 'center', valign: 'middle', width: '100px'},
         {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: '150px', 'class': 'uitd_showTip'},
         {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: '150px', 'class': 'uitd_showTip'},
         {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px'},
         {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px'},
-        {title: '人才证书有效期', field: 'certificateStartTime', visible: isShow, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px',
-            formatter: function (value, row, index) {
-                return Feng.isNotEmptyStr(row.certificateStartTime) && Feng.isNotEmptyStr(row.qzgccrcActiveTime) ? row.certificateStartTime + "至" + row.qzgccrcActiveTime : "";
-            }
-        },
         {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
         {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: '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', width: "100px",
@@ -259,7 +254,7 @@ TalentInfo.checkExport = function () {
     for (var i = 0; i < selected.length; i++) {
     for (var i = 0; i < selected.length; i++) {
         ids = ids + selected[i].id + ",";
         ids = ids + selected[i].id + ",";
     }
     }
-    window.location.href = Feng.ctxPath + "/talentInfo/exportHczx?ids=" + ids;
+    window.location.href = Feng.ctxPath + "/admin/talent/exportHczx?ids=" + ids;
 }
 }
 
 
 /**
 /**
@@ -276,7 +271,7 @@ TalentInfo.hczxPass = function () {
         ids = ids + selected[i].id + ",";
         ids = ids + selected[i].id + ",";
     }
     }
     var operation = function () {
     var operation = function () {
-        var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxPass", function (data) {
+        var ajax = new $ax("/admin/talent/hczxPass", function (data) {
             if (data.code == 200) {
             if (data.code == 200) {
                 Feng.success(data.msg);
                 Feng.success(data.msg);
                 TalentInfo.table.refresh();
                 TalentInfo.table.refresh();
@@ -319,7 +314,7 @@ TalentInfo.hczxReject = function () {
         return;
         return;
     }
     }
     var operation = function () {
     var operation = function () {
-        var ajax = new $ax(Feng.ctxPath + "/talentInfo/hczxReject", function (data) {
+        var ajax = new $ax("/admin/talent/hczxReject", function (data) {
             if (data.code == 200) {
             if (data.code == 200) {
                 Feng.success(data.msg);
                 Feng.success(data.msg);
                 TalentInfo.table.refresh();
                 TalentInfo.table.refresh();
@@ -380,7 +375,7 @@ TalentInfo.needPublicExport = function () {
     }
     }
     var operation = function () {
     var operation = function () {
         $("#exportCommonModal").modal("hide");
         $("#exportCommonModal").modal("hide");
-        window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/talentInfo/exportPublic?ids=" + ids));
+        window.location.href = encodeURI(encodeURI("/admin/talent/exportPublic?ids=" + ids));
     }
     }
     Feng.confirm("确定要公示预览吗?", operation);
     Feng.confirm("确定要公示预览吗?", operation);
 }
 }
@@ -559,12 +554,12 @@ TalentInfo.afterCheck = function () {
         if (TalentInfo.seItem.outMsg != null && TalentInfo.seItem.outMsg != '') {
         if (TalentInfo.seItem.outMsg != null && TalentInfo.seItem.outMsg != '') {
             Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
             Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
         }
         }
-        if (TalentInfo.seItem.checkState == -1) {
+        if (TalentInfo.seItem.checkState == 13) {
             var html = '<option value="">请选择</option>\n' +
             var html = '<option value="">请选择</option>\n' +
                     '       <option value="2">驳回/恢复</option>';
                     '       <option value="2">驳回/恢复</option>';
             $("#checkStateAfter").empty().append(html);
             $("#checkStateAfter").empty().append(html);
         }
         }
-        if (TalentInfo.seItem.checkState == 35) {
+        if (TalentInfo.seItem.checkState == 11) {
             var html = '<option value="">请选择</option>\n' +
             var html = '<option value="">请选择</option>\n' +
                     '       <option value="-1">审核不通过</option>' +
                     '       <option value="-1">审核不通过</option>' +
                     '       <option value="2">驳回</option>';
                     '       <option value="2">驳回</option>';