|
@@ -17,6 +17,7 @@ use app\enterprise\validate\TalentInfo;
|
|
|
use app\common\state\ProjectState;
|
|
|
use app\common\api\BatchApi;
|
|
|
use app\common\state\CommonConst;
|
|
|
+use app\common\api\TalentConditionApi;
|
|
|
|
|
|
// 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5保存补充材料未提交 6提交补充材料进入初审 7初审通过 8初审驳回 9部门审核通过 10部门审核驳回 11复核通过 12复核驳回 13复核失败
|
|
|
|
|
@@ -137,7 +138,7 @@ class Talent extends EnterpriseController {
|
|
|
$info["talent_type_list"] = DictApi::findChildDictByCode("talent_type");
|
|
|
}
|
|
|
if ($info["talent_condition"]) {
|
|
|
- $info["isSalary"] = \app\common\api\TalentConditionApi::getOne($info["talent_condition"])["isSalary"] ?: 0;
|
|
|
+ $info["isSalary"] = TalentConditionApi::getOne($info["talent_condition"])["isSalary"] ?: 0;
|
|
|
}
|
|
|
return view($tpl, ["year" => $batch, "checkState" => $checkState, "row" => $info]);
|
|
|
}
|
|
@@ -1772,6 +1773,82 @@ class Talent extends EnterpriseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function findFieldsAndFiles() {
|
|
|
+ $id = $this->request["id"];
|
|
|
+ $talentInfo = TalentApi::getOne($id);
|
|
|
+ $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT);
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ if ($talentInfo["checkState"] == TalentState::FST_SAVE && $lastLog["state"] == TalentState::BASE_REJECT) {
|
|
|
+ $fields = DictApi::getTalentFields_WJ();
|
|
|
+ $field_tmp = [];
|
|
|
+ if ($fields) {
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
|
|
|
+ $where = [];
|
|
|
+ $whr = [];
|
|
|
+ $where[] = ["project", "=", 1];
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
+ $where[] = ["type", "=", CommonConst::ENTERPRISE_WJ];
|
|
|
+ $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])->order("sn asc")->select();
|
|
|
+ } else {
|
|
|
+ $files = \think\facade\Db::table("new_common_filetype")->where($where)->order("sn asc")->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 = TalentApi::getOne($id);
|
|
|
+ $lastLog = TalentLogApi::getLastLog($id, ProjectState::TALENT);
|
|
|
+ $responseObj = new \stdClass();
|
|
|
+ if ($talentInfo["checkState"] == TalentState::FST_SAVE && $lastLog["state"] == TalentState::BASE_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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private function sendMsg($enterprise_id, $description = "") {
|
|
|
$ep = EnterpriseApi::getOne($enterprise_id);
|
|
|
if ($ep->agentPhone) {
|
|
@@ -1821,7 +1898,7 @@ class Talent extends EnterpriseController {
|
|
|
$field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
}
|
|
|
}
|
|
|
- $condition = \app\common\api\TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
+ $condition = TalentConditionApi::getOne($talent_info["talent_condition"]);
|
|
|
$where = [];
|
|
|
$whr = [];
|
|
|
$where[] = ["project", "=", 1];
|