|  | @@ -30,7 +30,7 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          $params = $request->param();
 | 
	
		
			
				|  |  |          $id = $params["id"];
 | 
	
		
			
				|  |  |          $info = VerifyApi::getTalentInfoById($id);
 | 
	
		
			
				|  |  | -        if (in_array($info["checkState"], [-1, 2])) {
 | 
	
		
			
				|  |  | +        if (in_array($info["checkState"], [TalentState::BASE_VERIFY_FAIL, TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::BASE_REVERIFY_REJECT, TalentState::BASE_REVERIFY_FAIL])) {
 | 
	
		
			
				|  |  |              return view("talentInfo_base_check", ["info" => $info]);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              return view("talentInfo_common_check", ["info" => $info]);
 | 
	
	
		
			
				|  | @@ -76,6 +76,16 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          return json(VerifyApi::getList($params));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    public function base_reverify() {
 | 
	
		
			
				|  |  | +        $enterprises = EnterpriseApi::getSimpleList();
 | 
	
		
			
				|  |  | +        return view("", ["enterprises" => $enterprises]);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public function base_reverify_list() {
 | 
	
		
			
				|  |  | +        $params = $this->request->param();
 | 
	
		
			
				|  |  | +        return json(VerifyApi::getList($params));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 部门初审
 | 
	
		
			
				|  |  |       * @auth {{/talentInfo/gotoIndex/-1}}
 | 
	
	
		
			
				|  | @@ -673,7 +683,7 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          $params = $request->param();
 | 
	
		
			
				|  |  |          if ($params["checkState"] == 3) {
 | 
	
		
			
				|  |  |  //审核成功
 | 
	
		
			
				|  |  | -            $log_checkState = $checkState = TalentState::BASE_VERIFY_PASS; //初审成功
 | 
	
		
			
				|  |  | +            $log_checkState = $checkState = TalentState::BASE_VERIFY_PASS; //基础信息审核成功
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |  //审核驳回并记录需要修改的字段和上传文件
 | 
	
		
			
				|  |  |              $checkState = TalentState::FST_SAVE; //退回提交材料阶段
 | 
	
	
		
			
				|  | @@ -703,6 +713,49 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          return $this->commonSubmitCheck($talent_info, 1);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 基本条件复审-提交未保存
 | 
	
		
			
				|  |  | +     * @param \think\Request $request
 | 
	
		
			
				|  |  | +     * @param type $talent_info
 | 
	
		
			
				|  |  | +     * @return type json
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private function baseReCheck(\think\Request $request, $talent_info) {
 | 
	
		
			
				|  |  | +        $params = $request->param();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if ($params["checkState"] == 3) {
 | 
	
		
			
				|  |  | +//审核成功
 | 
	
		
			
				|  |  | +            $log_checkState = $checkState = TalentState::BASE_REVERIFY_PASS; //基础信息复审成功
 | 
	
		
			
				|  |  | +        } else if ($params["checkState"] == 2) {
 | 
	
		
			
				|  |  | +//审核驳回并记录需要修改的字段和上传文件
 | 
	
		
			
				|  |  | +            $checkState = TalentState::FST_SUBMIT; //退回待基础审核状态
 | 
	
		
			
				|  |  | +            $log_checkState = TalentState::BASE_REVERIFY_REJECT; //日志记录拒绝状态
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            $log_checkState = $checkState = TalentState::BASE_REVERIFY_FAIL; //审核失败
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        $log = TalentLogApi::getLastLog($talent_info["id"], 1);
 | 
	
		
			
				|  |  | +        if (!$log)
 | 
	
		
			
				|  |  | +            return json(["msg" => "日志数据异常,保存失败"]);
 | 
	
		
			
				|  |  | +        if ($log["active"] == 0) {
 | 
	
		
			
				|  |  | +            TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $params["checkMsg"]);
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            TalentLogApi::write(1, $talent_info["id"], [$log_checkState, $checkState], $params["checkMsg"]);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        $data["id"] = $talent_info["id"];
 | 
	
		
			
				|  |  | +        $data["modify_files"] = $params["files"];
 | 
	
		
			
				|  |  | +        $data["modify_fields"] = $params["fields"];
 | 
	
		
			
				|  |  | +        TalentModel::update($data);
 | 
	
		
			
				|  |  | +        return json(["code" => 200, "msg" => "保存成功"]);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 基本条件复审-提交审核
 | 
	
		
			
				|  |  | +     * @param type $talent_info
 | 
	
		
			
				|  |  | +     * @return type json
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private function baseReSubmitCheck($talent_info) {
 | 
	
		
			
				|  |  | +        return $this->commonSubmitCheck($talent_info, 2);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 初审-提交未保存
 | 
	
		
			
				|  |  |       * @param \think\Request $request
 | 
	
	
		
			
				|  | @@ -716,11 +769,11 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |              $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
 | 
	
		
			
				|  |  |              $data["pass_dept_check"] = 0;
 | 
	
		
			
				|  |  |          } else if ($params["checkState"] == 4) {
 | 
	
		
			
				|  |  | -            if ($talent_info["highProcess"] < 3)
 | 
	
		
			
				|  |  | +            if ($talent_info["highProcess"] < 4)
 | 
	
		
			
				|  |  |                  return json(["msg" => "只有曾经通过部门并审,初审时才可以选择直接跳过部门并审阶段"]);
 | 
	
		
			
				|  |  |  //审核成功,并设置越过部门并审。附加条件:最高进度曾经通过部门并审3(包含部门并审)
 | 
	
		
			
				|  |  |              $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功
 | 
	
		
			
				|  |  | -            $data["pass_dept_check"] = $talent_info["highProcess"] >= 3 ? 1 : 0;
 | 
	
		
			
				|  |  | +            $data["pass_dept_check"] = $talent_info["highProcess"] >= 4 ? 1 : 0;
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |  //审核驳回并记录需要修改的字段和上传文件
 | 
	
		
			
				|  |  |              $checkState = TalentState::SCND_SAVE; //退回材料编辑状态
 | 
	
	
		
			
				|  | @@ -747,7 +800,7 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |       * @return type json
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      private function fstSubmitCheck($talent_info) {
 | 
	
		
			
				|  |  | -        $nowProcess = 2;
 | 
	
		
			
				|  |  | +        $nowProcess = 3;
 | 
	
		
			
				|  |  |          $log = TalentLogApi::getLastLog($talent_info["id"], 1);
 | 
	
		
			
				|  |  |          if (!$log || $log["active"] == 1)
 | 
	
		
			
				|  |  |              return json(["msg" => "请先保存审核状态,再提交审核"]);
 | 
	
	
		
			
				|  | @@ -873,7 +926,7 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          $over = $pass_companyIds ? count($pass_companyIds) : 0; //完成度,如果重审之前已有通过审核的部门,不用再审,直接按通过算
 | 
	
		
			
				|  |  |          $error = 0; //失败数
 | 
	
		
			
				|  |  | -        $nowProcess = 3;
 | 
	
		
			
				|  |  | +        $nowProcess = 4;
 | 
	
		
			
				|  |  |          if (!$dept_log)
 | 
	
		
			
				|  |  |              return json(["msg" => "未匹配日志,审核失败"]);
 | 
	
		
			
				|  |  |          if ($dept_log["state"] == $dept_log["new_state"])
 | 
	
	
		
			
				|  | @@ -965,14 +1018,14 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |       * @return type json
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      private function reSubmitCheck($talent_info) {
 | 
	
		
			
				|  |  | -        return $this->commonSubmitCheck($talent_info, 4);
 | 
	
		
			
				|  |  | +        return $this->commonSubmitCheck($talent_info, 5);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private function commonSubmitCheck($talent_info, $nowProcess) {
 | 
	
		
			
				|  |  |          $log = TalentLogApi::getLastLog($talent_info["id"], 1);
 | 
	
		
			
				|  |  |          if (!$log || $log["active"] == 1)
 | 
	
		
			
				|  |  |              return json(["msg" => "请先保存审核状态,再提交审核"]);
 | 
	
		
			
				|  |  | -        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::BASE_REVERIFY_PASS, TalentState::FST_VERIFY_PASS, TalentState::REVERIFY_PASS])) {
 | 
	
		
			
				|  |  |              $data["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"];
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1118,6 +1171,8 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if ($checkState == TalentState::FST_SUBMIT) {
 | 
	
		
			
				|  |  |              return $this->baseCheck($request, $talent_info);
 | 
	
		
			
				|  |  | +        } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
 | 
	
		
			
				|  |  | +            return $this->baseReCheck($request, $talent_info);
 | 
	
		
			
				|  |  |          } else if ($checkState == TalentState::SCND_SUBMIT) {
 | 
	
		
			
				|  |  |              return $this->fstCheck($request, $talent_info);
 | 
	
		
			
				|  |  |          } else if ($checkState == TalentState::FST_VERIFY_PASS) {
 | 
	
	
		
			
				|  | @@ -1147,6 +1202,8 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if ($checkState == TalentState::FST_SUBMIT) {
 | 
	
		
			
				|  |  |              return $this->baseSubmitCheck($talent_info);
 | 
	
		
			
				|  |  | +        } else if ($checkState == TalentState::BASE_VERIFY_PASS) {
 | 
	
		
			
				|  |  | +            return $this->baseReSubmitCheck($talent_info);
 | 
	
		
			
				|  |  |          } else if ($checkState == TalentState::SCND_SUBMIT) {
 | 
	
		
			
				|  |  |              return $this->fstSubmitCheck($talent_info);
 | 
	
		
			
				|  |  |          } else if ($checkState == TalentState::FST_VERIFY_PASS) {
 | 
	
	
		
			
				|  | @@ -1172,11 +1229,11 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |          $talent_info = VerifyApi::getOne($id);
 | 
	
		
			
				|  |  |          if ($talent_info) {
 | 
	
		
			
				|  |  |              $checkState = $talent_info["checkState"];
 | 
	
		
			
				|  |  | -// 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5保存补充材料未提交 6提交补充材料进入初审 7初审通过 8初审驳回 9部门审核通过 10部门审核驳回 11复核通过 12复核驳回 13复核失败
 | 
	
		
			
				|  |  | +// 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5基审复核通过 6基审复核驳回 7基审复核失败 8保存补充材料未提交 9提交补充材料进入初审 10初审通过 11初审驳回 12部门审核通过 13部门审核驳回 14复核通过 15复核驳回 16复核失败
 | 
	
		
			
				|  |  |              $process = 0;
 | 
	
		
			
				|  |  | -            if (in_array($checkState, [2, 6, 7, 9])) {
 | 
	
		
			
				|  |  | +            if (in_array($checkState, [TalentState::FST_SUBMIT, TalentState::BASE_VERIFY_PASS, TalentState::SCND_SUBMIT, TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS])) {
 | 
	
		
			
				|  |  |                  switch ($checkState) {
 | 
	
		
			
				|  |  | -                    case 2:
 | 
	
		
			
				|  |  | +                    case TalentState::FST_SUBMIT:
 | 
	
		
			
				|  |  |                          $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
 | 
	
		
			
				|  |  |                          $fields = DictApi::getTalentFields(1);
 | 
	
		
			
				|  |  |                          $field_tmp = [];
 | 
	
	
		
			
				|  | @@ -1191,26 +1248,41 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |                          $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
 | 
	
		
			
				|  |  |                          $process = 1;
 | 
	
		
			
				|  |  |                          break;
 | 
	
		
			
				|  |  | -                    case 6:
 | 
	
		
			
				|  |  | -                        $fields = DictApi::getTalentFields(2);
 | 
	
		
			
				|  |  | +                    case TalentState::BASE_VERIFY_PASS:
 | 
	
		
			
				|  |  | +                        $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
 | 
	
		
			
				|  |  | +                        $fields = DictApi::getTalentFields(1);
 | 
	
		
			
				|  |  | +                        $field_tmp = [];
 | 
	
		
			
				|  |  | +                        foreach ($fields as $key => $field) {
 | 
	
		
			
				|  |  | +                            $field_tmp[] = ["key" => $key, "value" => $field];
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        $where[] = ["project", "=", 1];
 | 
	
		
			
				|  |  | +                        $where[] = ["step", "=", 1];
 | 
	
		
			
				|  |  | +                        $where[] = ["active", "=", 1];
 | 
	
		
			
				|  |  | +                        $where[] = ["type", "=", $enterprise["type"]];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
 | 
	
		
			
				|  |  |                          $process = 2;
 | 
	
		
			
				|  |  |                          break;
 | 
	
		
			
				|  |  | -                    case 7:
 | 
	
		
			
				|  |  | +                    case TalentState::SCND_SUBMIT:
 | 
	
		
			
				|  |  | +                        $fields = DictApi::getTalentFields(2);
 | 
	
		
			
				|  |  | +                        $process = 3;
 | 
	
		
			
				|  |  | +                        break;
 | 
	
		
			
				|  |  | +                    case TalentState::FST_VERIFY_PASS:
 | 
	
		
			
				|  |  |                          $tc = TalentConditionApi::getOne($talent_info["talent_condition"]);
 | 
	
		
			
				|  |  |                          if ($tc["companyIds"] && $talent_info["pass_dept_check"] != 1) {
 | 
	
		
			
				|  |  | -                            $process = 3;
 | 
	
		
			
				|  |  | +                            $process = 4;
 | 
	
		
			
				|  |  |                              $fields = DictApi::getTalentFields(3);
 | 
	
		
			
				|  |  |                          } else {
 | 
	
		
			
				|  |  | -                            $process = 4;
 | 
	
		
			
				|  |  | +                            $process = 5;
 | 
	
		
			
				|  |  |                              $fields = DictApi::getTalentFields(2);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          break;
 | 
	
		
			
				|  |  | -                    case 9:
 | 
	
		
			
				|  |  | -                        $process = 4;
 | 
	
		
			
				|  |  | +                    case TalentState::DEPT_VERIFY_PASS:
 | 
	
		
			
				|  |  | +                        $process = 5;
 | 
	
		
			
				|  |  |                          $fields = DictApi::getTalentFields(2);
 | 
	
		
			
				|  |  |                          break;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if ($checkState != 2) {
 | 
	
		
			
				|  |  | +                if ($checkState != TalentState::FST_SUBMIT) {
 | 
	
		
			
				|  |  |                      $enterprise = \app\common\model\Enterprise::findOrEmpty($talent_info["enterprise_id"]);
 | 
	
		
			
				|  |  |                      //$fields = DictApi::getTalentFields(2);
 | 
	
		
			
				|  |  |                      $field_tmp = [];
 | 
	
	
		
			
				|  | @@ -1227,7 +1299,7 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |                      $where[] = ["active", "=", 1];
 | 
	
		
			
				|  |  |                      $where[] = ["type", "=", $enterprise["type"]];
 | 
	
		
			
				|  |  |                      $where[] = ["isConditionFile", "<>", 1];
 | 
	
		
			
				|  |  | -                    if ($process == 3) {
 | 
	
		
			
				|  |  | +                    if ($process == 4) {
 | 
	
		
			
				|  |  |                          $where = [];
 | 
	
		
			
				|  |  |                          $cwfts = explode(";", $condition["companyWithFileType"]);
 | 
	
		
			
				|  |  |                          foreach ($cwfts as $cwft) {
 | 
	
	
		
			
				|  | @@ -1269,19 +1341,19 @@ class Talent extends AdminController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public function fstVerifyListExport() {
 | 
	
		
			
				|  |  | -        $this->commonExport(2);
 | 
	
		
			
				|  |  | +        $this->commonExport(3);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public function deptVerifyListExport() {
 | 
	
		
			
				|  |  | -        $this->commonExport(3);
 | 
	
		
			
				|  |  | +        $this->commonExport(4);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public function reVerifyListExport() {
 | 
	
		
			
				|  |  | -        $this->commonExport(4);
 | 
	
		
			
				|  |  | +        $this->commonExport(5);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public function preListExport() {
 | 
	
		
			
				|  |  | -        $this->commonExport(5);
 | 
	
		
			
				|  |  | +        $this->commonExport(6);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private function commonExport($process) {
 |