|
@@ -18,6 +18,7 @@ use app\common\api\MenuApi;
|
|
|
use app\admin\model\Menu;
|
|
|
use app\admin\model\SysRelation;
|
|
|
use app\common\api\CompanyApi;
|
|
|
+use app\common\state\ProjectState;
|
|
|
|
|
|
/**
|
|
|
* Description of Talent
|
|
@@ -34,9 +35,9 @@ class Talent extends AdminController {
|
|
|
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 {
|
|
|
- $last_log = TalentLogApi::getLastLog($id, \app\common\state\ProjectState::TALENT, 0, ["active", "=", 0]);
|
|
|
+ $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, 0, ["active", "=", 0]);
|
|
|
if ($last_log["step"] == 3 && $last_log["companyId"] != $this->user["companyId"]) {
|
|
|
- $last_log = TalentLogApi::getLastLog($id, \app\common\state\ProjectState::TALENT, $this->user["companyId"], ["active", "=", 0]);
|
|
|
+ $last_log = TalentLogApi::getLastLog($id, ProjectState::TALENT, $this->user["companyId"], ["active", "=", 0]);
|
|
|
}
|
|
|
if ($last_log["state"] == 10 && $last_log["new_state"] == 10) {
|
|
|
|
|
@@ -143,14 +144,6 @@ class Talent extends AdminController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 初审-修改驳回字段
|
|
|
- * @auth {{/talentInfo/updateFieldsAndFiles}}
|
|
|
- */
|
|
|
- public function updateFieldsAndFiles() {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 初审-审核不通过
|
|
|
* @auth {{/talentInfo/setNotPass}}
|
|
@@ -1447,7 +1440,85 @@ class Talent extends AdminController {
|
|
|
}
|
|
|
|
|
|
public function findFieldsAndFiles() {
|
|
|
-
|
|
|
+ $id = $this->request["id"];
|
|
|
+ $talentInfo = VerifyApi::getOne($id);
|
|
|
+ $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT);
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ if ($talentInfo["checkState"] == TalentState::SCND_SAVE && $lastLog["state"] == TalentState::FST_VERIFY_REJECT) {
|
|
|
+ if (session("user")["type"] == 2) {
|
|
|
+ $fields = DictApi::getTalentFields_IC();
|
|
|
+ } else {
|
|
|
+ $fields = DictApi::getTalentFields(4, $talent_info["isImport"]);
|
|
|
+ }
|
|
|
+
|
|
|
+ $field_tmp = [];
|
|
|
+ if ($fields) {
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $enterprise = \app\common\model\Enterprise::findOrEmpty($talentInfo["enterprise_id"]);
|
|
|
+ $condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
|
|
|
+ $where = [];
|
|
|
+ $whr = [];
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["type", "=", $enterprise["type"]];
|
|
|
+ $where[] = ["isConditionFile", "<>", 1];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ if ($condition && $condition["bindFileTypes"]) {
|
|
|
+ $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->whereOr([$where, $whr])->select();
|
|
|
+ } else {
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->select();
|
|
|
+ }
|
|
|
+ $responseObj->code = 200;
|
|
|
+ $responseObj->id = $id;
|
|
|
+ $responseObj->fileList = $files;
|
|
|
+ $responseObj->fieldList = $field_tmp;
|
|
|
+ $responseObj->select = [
|
|
|
+ "files" => array_filter(explode(",", $talentInfo["modify_files"])),
|
|
|
+ "fields" => array_filter(explode(",", $talentInfo["modify_fields"]))
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ $responseObj->msg = "不是驳回状态不可以编辑驳回内容";
|
|
|
+ }
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初审-修改驳回字段
|
|
|
+ * @auth {{/talentInfo/updateFieldsAndFiles}}
|
|
|
+ */
|
|
|
+ public function updateFieldsAndFiles() {
|
|
|
+ $id = $this->request["id"];
|
|
|
+ $fields = array_filter(explode(",", $this->request["fields"]));
|
|
|
+ $files = array_filter(explode(",", $this->request["files"]));
|
|
|
+
|
|
|
+ $talentInfo = VerifyApi::getOne($id);
|
|
|
+ $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT);
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ if ($talentInfo["checkState"] == TalentState::SCND_SAVE && $lastLog["state"] == TalentState::FST_VERIFY_REJECT) {
|
|
|
+ if (!$fields && !$files) {
|
|
|
+ $responseObj->msg = "请选择可修改的字段或附件!";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ $data["id"] = $id;
|
|
|
+ $data["modify_fields"] = $fields ? implode(",", $fields) : null;
|
|
|
+ $data["modify_files"] = $files ? implode(",", $files) : null;
|
|
|
+ TalentModel::update($data);
|
|
|
+ $responseObj->code = 200;
|
|
|
+ $responseObj->msg = "驳回字段修改成功";
|
|
|
+ return json($responseObj);
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
+ $responseObj->msg = $e->getMessage();
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $responseObj->msg = "不是驳回状态不可以编辑驳回内容";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function baseVerifyListExport() {
|