|
@@ -18,6 +18,8 @@ class TalentTypeChange extends AdminController {
|
|
public function gotoIndex() {
|
|
public function gotoIndex() {
|
|
$tpl = null;
|
|
$tpl = null;
|
|
$process = $this->request->param('process');
|
|
$process = $this->request->param('process');
|
|
|
|
+ $assigns = [];
|
|
|
|
+ $assigns["enterprises"] = \app\common\api\EnterpriseApi::getSimpleList();
|
|
switch ($process) {
|
|
switch ($process) {
|
|
case -1:
|
|
case -1:
|
|
$tpl = "dept_before"; //移除部门初审
|
|
$tpl = "dept_before"; //移除部门初审
|
|
@@ -33,14 +35,31 @@ class TalentTypeChange extends AdminController {
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
$tpl = "prepare"; //预备库
|
|
$tpl = "prepare"; //预备库
|
|
-
|
|
|
|
|
|
+ $msgBody = [];
|
|
|
|
+ switch ($this->user["type"]) {
|
|
|
|
+ case 1:
|
|
|
|
+ $msgBody["typeName"] = "晋江市优秀人才层次变更";
|
|
|
|
+ $msgBody["address"] = "聚才网/人才晋江微信公众号";
|
|
|
|
+ $msgBody["dep"] = "中共晋江市委人才办、晋江市纪委监委驻市人力资源和社会保障局纪检监察组或晋江市公共就业和人才服务中心";
|
|
|
|
+ $msgBody["phone"] = "0595-85633128";
|
|
|
|
+ $msgBody["email"] = "jjrc85661234@163.com";
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ $msgBody["typeName"] = "晋江市集成电路产业优秀人才层次变更";
|
|
|
|
+ $msgBody["address"] = "福建(晋江)集成电路产业园官方网站及微信公众号";
|
|
|
|
+ $msgBody["dep"] = "集成电路产业园区";
|
|
|
|
+ $msgBody["phone"] = "0595-82250007、0595-82250001";
|
|
|
|
+ $msgBody["email"] = "jjjcdr@163.com";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $assigns["message"] = $msgBody;
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
$tpl = "library"; //正式库
|
|
$tpl = "library"; //正式库
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- return view($tpl);
|
|
|
|
|
|
+ return view($tpl, $assigns);
|
|
}
|
|
}
|
|
|
|
|
|
public function list() {
|
|
public function list() {
|
|
@@ -56,6 +75,7 @@ class TalentTypeChange extends AdminController {
|
|
if (in_array($this->user["type"], [1, 2, 5, 6])) {
|
|
if (in_array($this->user["type"], [1, 2, 5, 6])) {
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
}
|
|
}
|
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
switch ($process) {
|
|
switch ($process) {
|
|
case -1:
|
|
case -1:
|
|
$company = \app\common\api\CompanyApi::getOne($this->user["companyId"]);
|
|
$company = \app\common\api\CompanyApi::getOne($this->user["companyId"]);
|
|
@@ -85,7 +105,7 @@ class TalentTypeChange extends AdminController {
|
|
|
|
|
|
$levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
$levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
$count = ttcModel::whereRaw($whereRaw)->where($where)->count();
|
|
$count = ttcModel::whereRaw($whereRaw)->where($where)->count();
|
|
- $list = ttcModel::whereRaw($whereRaw)->where($where)->limit($offset, $limit)->order("createTime {$order}")->select();
|
|
|
|
|
|
+ $list = ttcModel::whereRaw($whereRaw)->where($where)->limit($offset, $limit)->order("createTime {$order}")->select()->toArray();
|
|
foreach ($list as $key => $item) {
|
|
foreach ($list as $key => $item) {
|
|
if ($item["beforeCheckCompany"]) {
|
|
if ($item["beforeCheckCompany"]) {
|
|
$list[$key]["beforeCheckCompanyName"] = getCacheById("Company", $item["beforeCheckCompany"]);
|
|
$list[$key]["beforeCheckCompanyName"] = getCacheById("Company", $item["beforeCheckCompany"]);
|
|
@@ -152,6 +172,89 @@ class TalentTypeChange extends AdminController {
|
|
return view("", ["info" => $info]);
|
|
return view("", ["info" => $info]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function findFieldsAndFiles() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $id = $params["id"];
|
|
|
|
+ $info = ttcModel::find($id);
|
|
|
|
+ if (!$info) {
|
|
|
|
+ $response->msg = "请选择需要修改的对象";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ if ($info["checkState"] != MainState::FIRST_REJECT) {
|
|
|
|
+ $response->msg = "只能修改初审驳回的数据";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $talentInfo = \app\common\api\VerifyApi::getOne($info["talentId"]);
|
|
|
|
+ if (!$talentInfo || $talentInfo["checkState"] != \app\common\api\TalentState::CERTIFICATED || $talentInfo["delete"] == 1) {
|
|
|
|
+ $response->msg = "系统错误,请联系管理员";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $fields = DictApi::getTalentTypeChangeFields($this->user["type"]);
|
|
|
|
+
|
|
|
|
+ $field_tmp = [];
|
|
|
|
+ if ($fields) {
|
|
|
|
+ foreach ($fields as $key => $field) {
|
|
|
|
+ $field_tmp[] = ["key" => $key, "value" => $field];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $condition = TalentConditionApi::getOne($info["newIdentifyCondition"]);
|
|
|
|
+ $where = [];
|
|
|
|
+ $whr = [];
|
|
|
|
+ $where[] = ["project", "=", ProjectState::LEVELCHANGE];
|
|
|
|
+ $where[] = ["active", "=", 1];
|
|
|
|
+ $where[] = ["type", "=", $info["type"]];
|
|
|
|
+ $where[] = ["isConditionFile", "<>", 1];
|
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
|
+ if ($condition && $condition["bindFileTypes"]) {
|
|
|
|
+ $whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
|
+ $files = Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select();
|
|
|
|
+ } else {
|
|
|
|
+ $files = Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
|
+ }
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ $response->id = $id;
|
|
|
|
+ $response->fileList = $files;
|
|
|
|
+ $response->fieldList = $field_tmp;
|
|
|
|
+ $response->select = [
|
|
|
|
+ "files" => array_filter(explode(",", $info["files"])),
|
|
|
|
+ "fields" => array_filter(explode(",", $info["fields"]))
|
|
|
|
+ ];
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function updateFieldsAndFiles() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $info = ttcModel::find($params["id"]);
|
|
|
|
+ if (!$info) {
|
|
|
|
+ $response->msg = "请选择需要修改的对象";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ if ($info["checkState"] != MainState::FIRST_REJECT) {
|
|
|
|
+ $response->msg = "只能修改初审驳回的数据";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $fields = array_filter(explode(",", $params["fields"]));
|
|
|
|
+ $files = array_filter(explode(",", $params["files"]));
|
|
|
|
+ if (!$fields && !$files) {
|
|
|
|
+ $response->msg = "请选择驳回的字段或者附件";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $data["id"] = $params["id"];
|
|
|
|
+ $data["fields"] = $fields ? implode(",", $fields) : "";
|
|
|
|
+ $data["files"] = $files ? implode(",", $files) : "";
|
|
|
|
+ if (ttcModel::update($data)) {
|
|
|
|
+ $response->msg = "修改成功";
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ } else {
|
|
|
|
+ $response->msg = "修改失败";
|
|
|
|
+ }
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+
|
|
public function validateIsCheck() {
|
|
public function validateIsCheck() {
|
|
$id = $this->request->param("id");
|
|
$id = $this->request->param("id");
|
|
$companyId = $this->request->param("companyId");
|
|
$companyId = $this->request->param("companyId");
|
|
@@ -285,6 +388,7 @@ class TalentTypeChange extends AdminController {
|
|
$response->code = 200;
|
|
$response->code = 200;
|
|
return $response;
|
|
return $response;
|
|
} catch (\think\db\exception\DbException $e) {
|
|
} catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
$response->msg = "审核失败:" . $e->getMessage();
|
|
$response->msg = "审核失败:" . $e->getMessage();
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
@@ -428,6 +532,7 @@ class TalentTypeChange extends AdminController {
|
|
$response->code = 200;
|
|
$response->code = 200;
|
|
return $response;
|
|
return $response;
|
|
} catch (\think\db\exception\DbException $e) {
|
|
} catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
$response->msg = "提交审核失败:" . $e->getMessage();
|
|
$response->msg = "提交审核失败:" . $e->getMessage();
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
@@ -571,6 +676,7 @@ class TalentTypeChange extends AdminController {
|
|
Db::commit();
|
|
Db::commit();
|
|
return $response;
|
|
return $response;
|
|
} catch (\think\db\exception\DbException $e) {
|
|
} catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
$response->msg = "核查征信失败:" . $e->getMessage();
|
|
$response->msg = "核查征信失败:" . $e->getMessage();
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
@@ -595,7 +701,6 @@ class TalentTypeChange extends AdminController {
|
|
$list = ttcModel::where($where)->select()->toArray();
|
|
$list = ttcModel::where($where)->select()->toArray();
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
try {
|
|
try {
|
|
- $updList = [];
|
|
|
|
$logList = [];
|
|
$logList = [];
|
|
foreach ($list as $key => $item) {
|
|
foreach ($list as $key => $item) {
|
|
$data = ["id" => $item["id"], "isPublic" => 2, "outMsg" => ""];
|
|
$data = ["id" => $item["id"], "isPublic" => 2, "outMsg" => ""];
|
|
@@ -620,6 +725,7 @@ class TalentTypeChange extends AdminController {
|
|
$response->msg = "核查征信通过成功";
|
|
$response->msg = "核查征信通过成功";
|
|
return $response;
|
|
return $response;
|
|
} catch (\think\db\exception\DbException $e) {
|
|
} catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
$response->msg = "核查征信通过失败:" . $e->getMessage();
|
|
$response->msg = "核查征信通过失败:" . $e->getMessage();
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
@@ -628,13 +734,13 @@ class TalentTypeChange extends AdminController {
|
|
/**
|
|
/**
|
|
* 公示预览
|
|
* 公示预览
|
|
*/
|
|
*/
|
|
- public function publicExport() {
|
|
|
|
|
|
+ public function publicPreview() {
|
|
$params = $this->request->param();
|
|
$params = $this->request->param();
|
|
$ids_arr = array_filter(explode(",", $params["ids"]));
|
|
$ids_arr = array_filter(explode(",", $params["ids"]));
|
|
$columns = ["序号", "姓名", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
$columns = ["序号", "姓名", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
if ($ids_arr) {
|
|
if ($ids_arr) {
|
|
- $where[] = ["id", "in", $ids_arr];
|
|
|
|
- $list = ttcModel::where($where)->select()->toArray();
|
|
|
|
|
|
+ $where[] = ["ttc.id", "in", $ids_arr];
|
|
|
|
+ $list = ttcModel::alias("ttc")->leftJoin("new_talent_condition tc", "ttc.newIdentifyCondition=tc.id")->field("ttc.*,tc.name as identifyConditionZH")->where($where)->select()->toArray();
|
|
$rows = [];
|
|
$rows = [];
|
|
$talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
$talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
for ($i = 0; $i < count($list); $i++) {
|
|
for ($i = 0; $i < count($list); $i++) {
|
|
@@ -642,7 +748,6 @@ class TalentTypeChange extends AdminController {
|
|
$whereLastLog = [];
|
|
$whereLastLog = [];
|
|
$whereLastLog[] = ["step", "=", 3];
|
|
$whereLastLog[] = ["step", "=", 3];
|
|
$whereLastLog[] = ["state", "<>", 8];
|
|
$whereLastLog[] = ["state", "<>", 8];
|
|
- $talent_condition = TalentConditionApi::getOne($item["newIdentifyCondition"]);
|
|
|
|
$description = $item["description"];
|
|
$description = $item["description"];
|
|
$stateName = "";
|
|
$stateName = "";
|
|
if ($item["checkState"] == MainState::NOTPASS) {
|
|
if ($item["checkState"] == MainState::NOTPASS) {
|
|
@@ -659,7 +764,7 @@ class TalentTypeChange extends AdminController {
|
|
$stateName = "审核通过";
|
|
$stateName = "审核通过";
|
|
}
|
|
}
|
|
$row = [
|
|
$row = [
|
|
- $i + 1, $item["talentName"], $item["enterpriseName"], $talent_condition["name"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
|
|
|
+ $i + 1, $item["talentName"], $item["enterpriseName"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
];
|
|
];
|
|
$rows[] = $row;
|
|
$rows[] = $row;
|
|
}
|
|
}
|
|
@@ -671,12 +776,691 @@ class TalentTypeChange extends AdminController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 公示
|
|
|
|
+ */
|
|
|
|
+ public function publicBatch() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ //查询需要公示的数据(勾选)
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $ids = array_filter(explode(",", $params["ids"]));
|
|
|
|
+ $publicBatch = $params["batch"];
|
|
|
|
+ $isMessage = $params["isMessage"] == 1 ? true : false;
|
|
|
|
+ if (!$publicBatch || strlen($publicBatch) != 6 || !is_numeric($publicBatch)) {
|
|
|
|
+ $response->msg = "公示批次错误";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["ttc.id", "in", $ids];
|
|
|
|
+ $list = ttcModel::alias("ttc")->leftJoin("un_enterprise e", "e.id=ttc.enterpriseId")->where($where)->field("ttc.*,e.agentPhone")->select()->toArray();
|
|
|
|
+ $logList = [];
|
|
|
|
+ $phones = [];
|
|
|
|
+ $success = 0;
|
|
|
|
+ $failure = 0;
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ try {
|
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
|
+ $obj = $list[$i];
|
|
|
|
+ $data = [];
|
|
|
|
+ $data["id"] = $obj["id"];
|
|
|
|
+ if ($obj["checkState"] == MainState::PASS && $obj["isPublic"] == 2) {
|
|
|
|
+ $data["publicBatch"] = $publicBatch;
|
|
|
|
+ $data["isPublic"] = 3;
|
|
|
|
+ Db::table("un_talent_type_change")->update($data);
|
|
|
|
+ $logList[] = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::LEVELCHANGE,
|
|
|
|
+ "mainId" => $obj["id"],
|
|
|
|
+ "companyId" => $this->user["companyId"],
|
|
|
|
+ "active" => 1,
|
|
|
|
+ "state" => MainState::BASIC_PASS,
|
|
|
|
+ "step" => 5,
|
|
|
|
+ "stateChange" => "<span class='label label-success'>待公示</span>-><span class='label label-primary'>公示中</span>",
|
|
|
|
+ "description" => "",
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"])
|
|
|
|
+ ];
|
|
|
|
+ $phones[$obj["enterpriseId"]] = $obj["agentPhone"];
|
|
|
|
+ $success++;
|
|
|
|
+ } else {
|
|
|
|
+ $failure++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $effect = Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
|
+ Db::commit();
|
|
|
|
+ if ($phones && $isMessage && $effect) {
|
|
|
|
+ $tpl_content = sprintf("【晋江市人才服务平台】您好!您提交申请的%s已完成初步审核,现通过%s将审核结果予以公示,公示时间%s至%s。公示期间如有异议,请及时向%s反映。电话%s,电子邮箱%s。",
|
|
|
|
+ $params["typeName"], $params["address"], $params["publicStartTime"], $params["publicEndTime"], $params["dep"], $params["phone"], $params["email"]);
|
|
|
|
+ foreach ($phones as $enterpriseId => $phone) {
|
|
|
|
+ queue("app\job\Messenger", ["type" => 5, "userId" => $enterpriseId, "phone" => $phone, "template" => $tpl_content]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $response->msg = "公示成功";
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ return $response;
|
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "公示失败:" . $e->getMessage();
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 公示导出
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public function publicExport() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $columns = ["序号", "公示批次", "姓名", "工作单位", "申请认定时间", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
|
|
+ $startTime = $params["startTime"];
|
|
|
|
+ $endTime = $params["endTime"];
|
|
|
|
+ if (!strtotime($startTime) || !strtotime($endTime))
|
|
|
|
+ return json(["msg" => "时间格式错误"]);
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["ttc.type", "=", $this->user["type"]];
|
|
|
|
+ $where[] = ["publicBatch", "between", [$startTime, $endTime]];
|
|
|
|
+ $list = ttcModel::alias("ttc")->leftJoin("new_talent_condition tc", "ttc.newIdentifyCondition=tc.id")->field("ttc.*,tc.name as identifyConditionZH")->where($where)->order("publicBatch")->select()->toArray();
|
|
|
|
+ if (!$list) {
|
|
|
|
+ $response->msg = "所选时间段内无公示数据";
|
|
|
|
+ return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
|
+ }
|
|
|
|
+ $rows = [];
|
|
|
|
+ $i = 1;
|
|
|
|
+ $talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
|
+ $item = $list[$i];
|
|
|
|
+ $whereLastLog = [];
|
|
|
|
+ $whereLastLog[] = ["step", "=", 3];
|
|
|
|
+ $whereLastLog[] = ["state", "<>", 8];
|
|
|
|
+ $description = $item["description"];
|
|
|
|
+ $stateName = "";
|
|
|
|
+ if ($item["checkState"] == MainState::NOTPASS) {
|
|
|
|
+ $lastLog = TalentLogApi::getLastLogEx($item["id"], ProjectState::LEVELCHANGE, 0, $whereLastLog);
|
|
|
|
+ if ($lastLog && $lastLog["state"] == MainState::NOTPASS) {
|
|
|
|
+ $description = $lastLog["description"];
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($item["outMsg"])) {
|
|
|
|
+ $description = !$item["description"] ? "" : $item["description"] . $item["outMsg"];
|
|
|
|
+ }
|
|
|
|
+ $stateName = "审核不通过";
|
|
|
|
+ }
|
|
|
|
+ if ($item["checkState"] == MainState::PASS) {
|
|
|
|
+ $stateName = "审核通过";
|
|
|
|
+ }
|
|
|
|
+ $row = [
|
|
|
|
+ $i + 1, $item["publicBatch"], $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
|
+ ];
|
|
|
|
+ $rows[] = $row;
|
|
|
|
+ }
|
|
|
|
+ if ($rows) {
|
|
|
|
+ $filename = "人才层次变更公示导出";
|
|
|
|
+ export($columns, $rows, $filename);
|
|
|
|
+ exit();
|
|
|
|
+ }
|
|
|
|
+ $response->msg = "所选时间段内无公示数据";
|
|
|
|
+ return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 公示再审核
|
|
|
|
+ */
|
|
|
|
+ public function afterCheck() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+
|
|
|
|
+ $obj = $this->request->param();
|
|
|
|
+ if (!$obj) {
|
|
|
|
+ $response->msg = "系统错误,请联系管理员";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $old = ttcModel::find($obj["id"]);
|
|
|
|
+ if ($old["isPublic"] != 3) {
|
|
|
|
+ $response->msg = "当前记录不是公示中状态,无法审核";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $desc = null;
|
|
|
|
+ $state = $obj["checkState"];
|
|
|
|
+ $data = [];
|
|
|
|
+ $data["id"] = $obj["id"];
|
|
|
|
+ if ($obj["checkState"] == MainState::BASIC_REJECT) {
|
|
|
|
+ $data["checkState"] = MainState::THIRD_REJECT;
|
|
|
|
+ $data["isPublic"] = 1;
|
|
|
|
+ $data["outMsg"] = "";
|
|
|
|
+ $desc = "(公示再审核驳回)审核状态:" . MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc(MainState::THIRD_REJECT) .
|
|
|
|
+ ";公示状态:<span class='label label-success'>公示中</span>-><span class='label label-primary'>待核查征信</span>;审核意见:" . $obj["checkMsg"];
|
|
|
|
+ } else {
|
|
|
|
+ $data["checkState"] = MainState::OBJECTION;
|
|
|
|
+ $data["checkMsg"] = $obj["checkMsg"];
|
|
|
|
+ $desc = "(公示再审核通过)审核状态:" . MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc(MainState::OBJECTION) .
|
|
|
|
+ ";公示状态:<span class='label label-success'>公示中</span>-><span class='label label-primary'>待公布</span>";
|
|
|
|
+ }
|
|
|
|
+ //添加日志
|
|
|
|
+ $log = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::LEVELCHANGE,
|
|
|
|
+ "mainId" => $obj["id"],
|
|
|
|
+ "companyId" => $this->user["companyId"],
|
|
|
|
+ "active" => 1,
|
|
|
|
+ "state" => $state,
|
|
|
|
+ "step" => 6,
|
|
|
|
+ "stateChange" => $desc,
|
|
|
|
+ "description" => $obj["checkMsg"],
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"])
|
|
|
|
+ ];
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ try {
|
|
|
|
+ Db::table("un_talent_type_change")->update($data);
|
|
|
|
+ Db::table("new_talent_checklog")->insert($log);
|
|
|
|
+ Db::commit();
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ $response->msg = "审核成功";
|
|
|
|
+ return $response;
|
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "审核失败:" . $e->getMessage();
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 公示通过
|
|
|
|
+ */
|
|
|
|
+ public function publicPass($ids) {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["id", "in", explode(",", $ids)];
|
|
|
|
+ $list = ttcModel::where($where)->select()->toArray();
|
|
|
|
+ if (!$list) {
|
|
|
|
+ $response->msg = "系统错误,请联系管理员";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ //添加日志
|
|
|
|
+ $logList = [];
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ foreach ($list as $obj) {
|
|
|
|
+ //添加日志
|
|
|
|
+ $logList[] = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::LEVELCHANGE,
|
|
|
|
+ "mainId" => $obj["id"],
|
|
|
|
+ "companyId" => $this->user["companyId"],
|
|
|
|
+ "active" => 1,
|
|
|
|
+ "state" => 3,
|
|
|
|
+ "step" => 6,
|
|
|
|
+ "stateChange" => "<span class='label label-success'>公示中</span>-><span class='label label-primary'>待公布</span>",
|
|
|
|
+ "description" => "",
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"])
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ $data["isPublic"] = 4;
|
|
|
|
+ try {
|
|
|
|
+ $res1 = Db::table("un_talent_type_change")->where($where)->update($data);
|
|
|
|
+ $res2 = Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
|
+ if ($res1 && $res2) {
|
|
|
|
+ Db::commit();
|
|
|
|
+ $response->msg = "批量公示通过成功";
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $response->msg = "批量公示通过失败,没有可更新内容";
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return $response;
|
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "批量公示通过失败:" . $e->getMessage();
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 公布
|
|
|
|
+ */
|
|
|
|
+ public function publish($ids, $batch) {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["id", "in", explode(",", $ids)];
|
|
|
|
+ $list = ttcModel::where($where)->select()->toArray();
|
|
|
|
+ if (!$list) {
|
|
|
|
+ $response->msg = "系统错误,请联系管理员";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ //添加日志
|
|
|
|
+ $logList = [];
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ try {
|
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
|
+ $obj = $list[$i];
|
|
|
|
+ $desc = "";
|
|
|
|
+ $stateChange = "";
|
|
|
|
+ $data = [];
|
|
|
|
+ $data["id"] = $obj["id"];
|
|
|
|
+ if ($obj["checkState"] == MainState::NOTPASS) {
|
|
|
|
+ $stateChange = "<span class='label label-success'>待公布</span>->" . MainState::getStateDesc(MainState::NOTPASS);
|
|
|
|
+ $desc = "审核不通过";
|
|
|
|
+ } else {
|
|
|
|
+ $stateChange = "<span class='label label-success'>待公布</span>-><span class='label label-primary'>待发证</span>";
|
|
|
|
+ $desc = "批量公布";
|
|
|
|
+ }
|
|
|
|
+ //添加日志
|
|
|
|
+ $logList[] = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::LEVELCHANGE,
|
|
|
|
+ "mainId" => $obj["id"],
|
|
|
|
+ "companyId" => $this->user["companyId"],
|
|
|
|
+ "active" => 1,
|
|
|
|
+ "state" => 3,
|
|
|
|
+ "step" => 7,
|
|
|
|
+ "stateChange" => $stateChange,
|
|
|
|
+ "description" => $desc,
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"])
|
|
|
|
+ ];
|
|
|
|
+ if (\StrUtil::isEmpOrNull($obj["newCertificateOutTime"])) {
|
|
|
|
+ $startDate = date("Y-m-d");
|
|
|
|
+ $expiredDate = date("Y-m-d", strtotime("+6 years -1 days {$startDate}"));
|
|
|
|
+ $data["newIdentifyOutTime"] = $expiredDate;
|
|
|
|
+ $data["newCertificateOutTime"] = $expiredDate;
|
|
|
|
+ $data["newCertificateStartTime"] = $startDate;
|
|
|
|
+ }
|
|
|
|
+ $data["isPublic"] = 5;
|
|
|
|
+ $data["newIdentifyMonth"] = $batch;
|
|
|
|
+ Db::table("un_talent_type_change")->update($data);
|
|
|
|
+ }
|
|
|
|
+ Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
|
+ Db::commit();
|
|
|
|
+ $response->msg = "公布成功";
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ return $response;
|
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "公布失败:" . $e->getMessage();
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 公布预览导出
|
|
|
|
+ */
|
|
|
|
+ public function publishExportBefore($ids) {
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["ttc.id", "in", explode(",", $ids)];
|
|
|
|
+ $list = ttcModel::alias("ttc")->leftJoin("new_talent_condition tc", "ttc.newIdentifyCondition=tc.id")->field("ttc.*,tc.name as identifyConditionZH")->where($where)->select()->toArray();
|
|
|
|
+ if (!$list) {
|
|
|
|
+ $response->msg = "系统错误,请联系管理员";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $columns = ["序号", "批次", "姓名", "工作单位", "申请认定时间", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
|
|
+ $rows = [];
|
|
|
|
+ $levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
|
+ $obj = $list[$i];
|
|
|
|
+ $description = $obj["description"];
|
|
|
|
+ $stateName = "";
|
|
|
|
+ $whereLastLog = [];
|
|
|
|
+ $whereLastLog[] = ["step", "=", 3];
|
|
|
|
+ $whereLastLog[] = ["state", "<>", 8];
|
|
|
|
+ if ($obj["checkState"] == MainState::NOTPASS) {
|
|
|
|
+ $lastLog = TalentLogApi::getLastLogEx($obj["id"], ProjectState::LEVELCHANGE, 0, $whereLastLog);
|
|
|
|
+ if ($lastLog && $lastLog["state"] == MainState::NOTPASS) {
|
|
|
|
+ $description = $lastLog["description"];
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($obj["outMsg"])) {
|
|
|
|
+ $description = !$obj["description"] ? "" : $obj["description"] . $obj["outMsg"];
|
|
|
|
+ }
|
|
|
|
+ $stateName = "审核不通过";
|
|
|
|
+ }
|
|
|
|
+ if ($obj["checkState"] == MainState::PASS) {
|
|
|
|
+ $stateName = "审核通过";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $rows[] = [
|
|
|
|
+ $i + 1, $obj["publicBatch"], $obj["talentName"], $obj["enterpriseName"], $obj["newIdentifyMonth"], $obj["identifyConditionZH"], $levelMap[$obj["newTalentArrange"]], $stateName, $description
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ $filename = "人才层次变更公布名单导出";
|
|
|
|
+ if ($rows) {
|
|
|
|
+ export($columns, $rows, $filename);
|
|
|
|
+ exit();
|
|
|
|
+ }
|
|
|
|
+ echo "<script>parent.layer.alert('没有可以导出的数据');</script>";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function publishExport() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $columns = ["序号", "姓名", "工作单位", "公布入选月份", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"];
|
|
|
|
+ $startTime = $params["startTime"];
|
|
|
|
+ $endTime = $params["endTime"];
|
|
|
|
+ if (!strtotime($startTime) || !strtotime($endTime))
|
|
|
|
+ return json(["msg" => "时间格式错误"]);
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["ttc.type", "=", $this->user["type"]];
|
|
|
|
+ $where[] = ["newIdentifyMonth", "between", [$startTime, $endTime]];
|
|
|
|
+ $list = ttcModel::alias("ttc")->leftJoin("new_talent_condition tc", "ttc.newIdentifyCondition=tc.id")->field("ttc.*,tc.name as identifyConditionZH")->where($where)->order("newIdentifyMonth")->select()->toArray();
|
|
|
|
+ if (!$list) {
|
|
|
|
+ $response->msg = "所选时间段内无公布数据";
|
|
|
|
+ return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
|
+ }
|
|
|
|
+ $rows = [];
|
|
|
|
+ $i = 1;
|
|
|
|
+ $talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
|
+ $item = $list[$i];
|
|
|
|
+ $whereLastLog = [];
|
|
|
|
+ $whereLastLog[] = ["step", "=", 3];
|
|
|
|
+ $whereLastLog[] = ["state", "<>", 8];
|
|
|
|
+ $description = $item["description"];
|
|
|
|
+ $stateName = "";
|
|
|
|
+ if ($item["checkState"] == MainState::NOTPASS) {
|
|
|
|
+ $lastLog = TalentLogApi::getLastLogEx($item["id"], ProjectState::LEVELCHANGE, 0, $whereLastLog);
|
|
|
|
+ if ($lastLog && $lastLog["state"] == MainState::NOTPASS) {
|
|
|
|
+ $description = $lastLog["description"];
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($item["outMsg"])) {
|
|
|
|
+ $description = !$item["description"] ? "" : $item["description"] . $item["outMsg"];
|
|
|
|
+ }
|
|
|
|
+ $stateName = "审核不通过";
|
|
|
|
+ }
|
|
|
|
+ if ($item["checkState"] == MainState::PASS) {
|
|
|
|
+ $stateName = "审核通过";
|
|
|
|
+ }
|
|
|
|
+ $row = [
|
|
|
|
+ $i + 1, $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
|
+ ];
|
|
|
|
+ $rows[] = $row;
|
|
|
|
+ }
|
|
|
|
+ if ($rows) {
|
|
|
|
+ $filename = "人才层次变更公布导出";
|
|
|
|
+ export($columns, $rows, $filename);
|
|
|
|
+ exit();
|
|
|
|
+ }
|
|
|
|
+ $response->msg = "所选时间段内无公示数据";
|
|
|
|
+ return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 撤销公布
|
|
|
|
+ */
|
|
|
|
+ public function canclePublish($id) {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ if (\StrUtil::isEmpOrNull($id)) {
|
|
|
|
+ $response->msg = "请选择需要撤销公布的数据";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ $info = ttcModel::find($id);
|
|
|
|
+ if ($info["isPublic"] != 5) {
|
|
|
|
+ $response->msg = "该数据未处于待发证状态,无法撤销";
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ $data["id"] = $id;
|
|
|
|
+ $data["isPublic"] = 4;
|
|
|
|
+ $data["newIdentifyMonth"] = "";
|
|
|
|
+ //添加日志
|
|
|
|
+ $log = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::LEVELCHANGE,
|
|
|
|
+ "mainId" => $id,
|
|
|
|
+ "companyId" => $this->user["companyId"],
|
|
|
|
+ "active" => 1,
|
|
|
|
+ "state" => 3,
|
|
|
|
+ "step" => 55,
|
|
|
|
+ "stateChange" => "<span class='label label-success'>待发证</span>-><span class='label label-primary'>待公布</span>",
|
|
|
|
+ "description" => "撤销公布",
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"])
|
|
|
|
+ ];
|
|
|
|
+ $res1 = Db::table("new_talent_checklog")->insert($log);
|
|
|
|
+ $res2 = Db::table("un_talent_type_change")->update($data);
|
|
|
|
+ if ($res1 && $res2) {
|
|
|
|
+ Db::commit();
|
|
|
|
+ $response->code = 200;
|
|
|
|
+ $response->msg = "撤销公布成功";
|
|
|
|
+ } else {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "撤销公布失败";
|
|
|
|
+ }
|
|
|
|
+ return $response;
|
|
|
|
+ } catch (\think\db\exception\DbException $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $response->msg = "撤销公布失败:" . $e->getMessage();
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 发证
|
|
|
|
+ */
|
|
|
|
+ public function sendCard() {
|
|
|
|
+ $lockFile = fopen("send_certificate.lock", "a");
|
|
|
|
+ if (flock($lockFile, LOCK_EX | LOCK_NB)) {//文件锁(独占)
|
|
|
|
+//查询所有待发放人才码的数据
|
|
|
|
+ $params = $this->request->param();
|
|
|
|
+ $ids = array_filter(explode(",", $params["ids"]));
|
|
|
|
+//晋江市优秀人才证书:当前年份+层次+四位递增数字
|
|
|
|
+//集成电路优秀人才证书:IC+当前年份+递增四位数,如IC20190001
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ $talent_max_no = [];
|
|
|
|
+ $logList = [];
|
|
|
|
+ $logList2 = [];
|
|
|
|
+ $user = $this->user;
|
|
|
|
+ $_prefix_type = "";
|
|
|
|
+ $subindex = 5;
|
|
|
|
+ switch ($user["type"]) {
|
|
|
|
+ case CommonConst::ENTERPRISE_JC:
|
|
|
|
+ $_prefix_type = "IC";
|
|
|
|
+ $subindex += strlen($_prefix_type);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
|
+ $changeList = ttcModel::where($where)->select()->toArray();
|
|
|
|
+ $year = date("Y");
|
|
|
|
+ foreach ($changeList as $change) {
|
|
|
|
+ if ($change["checkState"] != MainState::PASS || $change["isPublic"] != 5) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return json(["msg" => "只能对公布通过的对象发放人才码,请核查待发放人才码名单后再重新发放人才码"]);
|
|
|
|
+ }
|
|
|
|
+ $no_prefix = $_prefix_type . $year . $change["newTalentArrange"];
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["certificateNo", "like", $no_prefix . "%"];
|
|
|
|
+ $max_no = $talent_max_no[$change["newTalentArrange"]] ?: Db::table("new_talent_info")->where($where)->max("certificateNo", false);
|
|
|
|
+ if (!$max_no) {
|
|
|
|
+ $max_no = $no_prefix . "0001";
|
|
|
|
+ } else {
|
|
|
|
+ $new_no = intval(substr($max_no, $subindex)) + 1;
|
|
|
|
+ $max_no = $no_prefix . str_pad($new_no, 4, "0", STR_PAD_LEFT);
|
|
|
|
+ }
|
|
|
|
+ $data["id"] = $change["talentId"];
|
|
|
|
+ $data["talent_arrange"] = $change["newTalentArrange"];
|
|
|
|
+ $data["talent_condition"] = $change["newIdentifyCondition"];
|
|
|
|
+ $data["identifyConditionName"] = $change["newIdentifyConditionName"];
|
|
|
|
+ $data["source"] = $change["newSource"];
|
|
|
|
+ $data["source_city"] = $change["newFromCity"];
|
|
|
|
+ $data["source_county"] = $change["newFromCounty"];
|
|
|
|
+ $data["annual_salary"] = $change["newAnnualSalary"];
|
|
|
|
+ $data["import_way"] = $change["newIntroductionMode"];
|
|
|
|
+ $data["apply_year"] = $change["newYear"];
|
|
|
|
+ $data["identifyGetTime"] = $change["newIdentifyGetTime"];
|
|
|
|
+ $data["identifyExpireTime"] = $change["newIdentifyOutTime"];
|
|
|
|
+ $data["certificateNo"] = $max_no;
|
|
|
|
+ $data["certificateGetTime"] = $change["newCertificateStartTime"];
|
|
|
|
+ $data["certificateExpireTime"] = $change["newCertificateOutTime"];
|
|
|
|
+ $data["identifyMonth"] = $change["newIdentifyMonth"];
|
|
|
|
+ $data["isEffect"] = 1;
|
|
|
|
+ Db::table("new_talent_info")->update($data);
|
|
|
|
+
|
|
|
|
+ //写入日志
|
|
|
|
+ $talentLog["id"] = getStringId();
|
|
|
|
+ $talentLog["active"] = 1;
|
|
|
|
+ $talentLog["step"] = 20;
|
|
|
|
+ $talentLog["type"] = ProjectState::TALENT;
|
|
|
|
+ $talentLog["mainId"] = $change["talentId"];
|
|
|
|
+ $talentLog["description"] = "人才层次变更通过,同步到人才库";
|
|
|
|
+ $talentLog["createUser"] = sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]);
|
|
|
|
+ $talentLog["createTime"] = date("Y-m-d H:i:s");
|
|
|
|
+ $logList2[] = $talentLog;
|
|
|
|
+
|
|
|
|
+ $updChangeData["id"] = $change["id"];
|
|
|
|
+ $updChangeData["isPublic"] = 6;
|
|
|
|
+ $updChangeData["newCertificateNO"] = $max_no;
|
|
|
|
+ Db::table("un_talent_type_change")->update($updChangeData);
|
|
|
|
+ //写入日志
|
|
|
|
+ $log["id"] = getStringId();
|
|
|
|
+ $log["state"] = 3;
|
|
|
|
+ $log["type"] = ProjectState::LEVELCHANGE;
|
|
|
|
+ $log["step"] = 8;
|
|
|
|
+ $log["mainId"] = $change["id"];
|
|
|
|
+ $log["companyId"] = $user["companyId"];
|
|
|
|
+ $log["active"] = 1;
|
|
|
|
+ $log["stateChange"] = "<span class='label label-success'>待发证</span>-><span class='label label-primary'>已发证</span>";
|
|
|
|
+ $log["description"] = "人才码为:" . $max_no;
|
|
|
|
+ $log["createUser"] = sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]);
|
|
|
|
+ $log["createTime"] = date("Y-m-d H:i:s");
|
|
|
|
+ $logList[] = $log;
|
|
|
|
+ }
|
|
|
|
+ Db::table("new_talent_checklog")->insertAll($logList2);
|
|
|
|
+ Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
|
+ Db::commit();
|
|
|
|
+ if ($user["type"] == 2) {
|
|
|
|
+ //办法上只写电路人才,所以暂时只给电路增加基础分
|
|
|
|
+ $_ids = array_column($changeList, "talentId");
|
|
|
|
+ for ($i = 0; $i < count($_ids); $i++) {
|
|
|
|
+ queue("app\job\Talent", ["type" => 4, "id" => $_ids[$i]]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return json(["code" => 200, "msg" => "发放人才码成功"]);
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ return json(["msg" => "发放人才码失败:" . $e->getMessage()]);
|
|
|
|
+ }
|
|
|
|
+ flock($lockFile, LOCK_UN);
|
|
|
|
+ } else {
|
|
|
|
+ return json(["msg" => "同一时间只能有一个管理员进行发放人才码操作"]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function commonExport() {
|
|
|
|
+ $response = new \stdClass();
|
|
|
|
+ $response->code = 500;
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["type", "=", $this->user["type"]];
|
|
|
|
+ $whereRaw = "length(talentId) <> 19";
|
|
|
|
+ $request = $this->request;
|
|
|
|
+ $talentName = \StrUtil::getRequestDecodeParam($request, "talentName");
|
|
|
|
+ $idCard = \StrUtil::getRequestDecodeParam($request, "idCard");
|
|
|
|
+ $enterpriseName = \StrUtil::getRequestDecodeParam($request, "enterpriseName");
|
|
|
|
+ $oldTalentArrange = \StrUtil::getRequestDecodeParam($request, "oldTalentArrange");
|
|
|
|
+ $oldIdentifyCondition = \StrUtil::getRequestDecodeParam($request, "oldIdentifyCondition");
|
|
|
|
+ $newTalentArrange = \StrUtil::getRequestDecodeParam($request, "newTalentArrange");
|
|
|
|
+ $newIdentifyCondition = \StrUtil::getRequestDecodeParam($request, "newIdentifyCondition");
|
|
|
|
+ $checkStateStr = \StrUtil::getRequestDecodeParam($request, "checkState");
|
|
|
|
+ $isPublicStr = \StrUtil::getRequestDecodeParam($request, "isPublic");
|
|
|
|
+ $process = intval(\StrUtil::getRequestDecodeParam($request, "process"));
|
|
|
|
+ $oldIdentifyMonth = \StrUtil::getRequestDecodeParam($request, "oldIdentifyMonth");
|
|
|
|
+ $newIdentifyMonth = \StrUtil::getRequestDecodeParam($request, "newIdentifyMonth");
|
|
|
|
+ $oldYearStr = \StrUtil::getRequestDecodeParam($request, "oldYear");
|
|
|
|
+ $newYearStr = \StrUtil::getRequestDecodeParam($request, "newYear");
|
|
|
|
+ $checkState = null;
|
|
|
|
+ $isPublic = null;
|
|
|
|
+ $oldYear = null;
|
|
|
|
+ $newYear = null;
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($checkStateStr)) {
|
|
|
|
+ $checkState = intval($checkStateStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($isPublicStr)) {
|
|
|
|
+ $isPublic = intval($isPublicStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($oldYearStr)) {
|
|
|
|
+ $oldYear = intval($oldYearStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($newYearStr)) {
|
|
|
|
+ $newYear = intval($newYearStr);
|
|
|
|
+ }
|
|
|
|
+ $filters = [
|
|
|
|
+ "talentName" => $talentName,
|
|
|
|
+ "idCard" => $idCard,
|
|
|
|
+ "enterpriseName" => $enterpriseName,
|
|
|
|
+ "oldTalentArrange" => $oldTalentArrange,
|
|
|
|
+ "oldIdentifyCondition" => $oldIdentifyCondition,
|
|
|
|
+ "newTalentArrange" => $newTalentArrange,
|
|
|
|
+ "newIdentifyCondition" => $newIdentifyCondition,
|
|
|
|
+ "checkState" => $checkState,
|
|
|
|
+ "isPublic" => $isPublic,
|
|
|
|
+ "oldYear" => $oldYear,
|
|
|
|
+ "newYear" => $newYear,
|
|
|
|
+ "oldIdentifyMonth" => $oldIdentifyMonth,
|
|
|
|
+ "newIdentifyMonth" => $newIdentifyMonth,
|
|
|
|
+ ];
|
|
|
|
+ $this->setTalentTypeChange($where, $filters);
|
|
|
|
+ $this->setTypeChangeCheckStateCondition($where, $filters, $process);
|
|
|
|
+ switch ($process) {
|
|
|
|
+ case -1:
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ $where[] = ["checkState", "not in", [3, 5]];
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ $where[] = ["checkState", "in", [-1, 35]];
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ $where[] = ["checkState", "in", [-1, 35]];
|
|
|
|
+ break;
|
|
|
|
+ case 5:
|
|
|
|
+ $where[] = ["checkState", "=", 35];
|
|
|
|
+ $where[] = ["isPublic", "=", 6];
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $list = ttcModel::where($where)->whereRaw($whereRaw)->select()->toArray();
|
|
|
|
+ $list = $this->translateToChinese($list, $process);
|
|
|
|
+ $columns = [
|
|
|
|
+ "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
|
|
|
|
+ "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新入选来源地级市", "新入选来源县市区",
|
|
|
|
+ "新人才层次", "新认定条件", "新认定条件证书取得时间", "新认定条件过期时间", "新认定条件名称",
|
|
|
|
+ "新泉州高层次人才证书发证日期", "新泉州高层次人才证书的有效期", "新引进方式", "新公布入选月份", "新人才编号",
|
|
|
|
+ "审核状态", "公示状态"
|
|
|
|
+ ];
|
|
|
|
+ $rows = [];
|
|
|
|
+ foreach ($list as $item) {
|
|
|
|
+ $rows[] = [
|
|
|
|
+ $item["talentName"], $item["idCard"], $item["enterpriseName"], $item["streetName"], $item["oldYear"], $item["oldSourceName"], $item["oldFromCityName"], $item["oldFromCountyName"],
|
|
|
|
+ $item["oldTalentArrangeName"], $item["oldIdentifyConditionCH"], $item["oldIdentifyGetTime"], $item["oldIdentifyOutTime"], $item["oldIdentifyConditionName"],
|
|
|
|
+ $item["oldCertificateStartTime"], $item["oldCertificateOutTime"], $item["oldIntroductionModeName"], $item["oldIdentifyMonth"], $item["oldCertificateNO"],
|
|
|
|
+ $item["newYear"], $item["newSourceName"], $item["newFromCityName"], $item["newFromCountyName"],
|
|
|
|
+ $item["newTalentArrangeName"], $item["newIdentifyConditionCH"], $item["newIdentifyGetTime"], $item["newIdentifyOutTime"], $item["newIdentifyConditionName"],
|
|
|
|
+ $item["newCertificateStartTime"], $item["newCertificateOutTime"], $item["newIntroductionModeName"], $item["newIdentifyMonth"], $item["newCertificateNO"],
|
|
|
|
+ $item["checkStateName"], $item["isPublicName"]
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ $filename = "人才层次变更导出";
|
|
|
|
+ if ($rows) {
|
|
|
|
+ export($columns, $rows, $filename);
|
|
|
|
+ exit();
|
|
|
|
+ } else {
|
|
|
|
+ echo "<script>parent.layer.alert('没有可以导出的数据');window.history.go(-1);</script>";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private function setTalentTypeChange(&$where, $data) {
|
|
private function setTalentTypeChange(&$where, $data) {
|
|
if (\StrUtil::isNotEmpAndNull($data["talentName"])) {
|
|
if (\StrUtil::isNotEmpAndNull($data["talentName"])) {
|
|
$where[] = ["talentName", "like", "%{$data["talentName"]}%"];
|
|
$where[] = ["talentName", "like", "%{$data["talentName"]}%"];
|
|
}
|
|
}
|
|
if (\StrUtil::isNotEmpAndNull($data["enterpriseName"])) {
|
|
if (\StrUtil::isNotEmpAndNull($data["enterpriseName"])) {
|
|
- $where[] = ["enterpriseName", "like", "%{$data["enterpriseName"]}%"];
|
|
|
|
|
|
+ $where[] = ["enterpriseId", "=", $data["enterpriseName"]];
|
|
}
|
|
}
|
|
if (\StrUtil::isNotEmpAndNull($data["idCard"])) {
|
|
if (\StrUtil::isNotEmpAndNull($data["idCard"])) {
|
|
$where[] = ["idCard", "like", "%{$data["idCard"]}%"];
|
|
$where[] = ["idCard", "like", "%{$data["idCard"]}%"];
|
|
@@ -762,4 +1546,95 @@ class TalentTypeChange extends AdminController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private function translateToChinese($list, $process) {
|
|
|
|
+ //获取字典表人才层次
|
|
|
|
+ $sourceMap = DictApi::selectByParentCode("source");
|
|
|
|
+ $levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
|
|
+ $importWayMap = DictApi::selectByParentCode("import_way");
|
|
|
|
+ $streetMap = DictApi::selectByParentCode("street");
|
|
|
|
+ $conditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
|
+ $whereEp = [];
|
|
|
|
+ $whereEp[] = ["id", "in", array_column($list, "enterpriseId")];
|
|
|
|
+ $enterpriseList = \app\common\model\Enterprise::where($whereEp)->column("street", "id");
|
|
|
|
+ foreach ($list as &$talentTypeChange) {
|
|
|
|
+ $talentTypeChange["oldSourceName"] = $sourceMap[$talentTypeChange["oldSource"]] ?: "无";
|
|
|
|
+ $talentTypeChange["newSourceName"] = $sourceMap[$talentTypeChange["newSource"]] ?: "无";
|
|
|
|
+ $talentTypeChange["oldTalentArrangeName"] = $levelMap[$talentTypeChange["oldTalentArrange"]];
|
|
|
|
+ $talentTypeChange["newTalentArrangeName"] = $levelMap[$talentTypeChange["newTalentArrange"]];
|
|
|
|
+ $talentTypeChange["oldIntroductionModeName"] = $importWayMap[$talentTypeChange["oldIntroductionMode"]];
|
|
|
|
+ $talentTypeChange["newIntroductionModeName"] = $importWayMap[$talentTypeChange["newIntroductionMode"]];
|
|
|
|
+ $talentTypeChange["oldIdentifyConditionCH"] = $conditions[$talentTypeChange["oldIdentifyCondition"]];
|
|
|
|
+ $talentTypeChange["newIdentifyConditionCH"] = $conditions[$talentTypeChange["newIdentifyCondition"]];
|
|
|
|
+ switch ($talentTypeChange["isPublic"]) {
|
|
|
|
+ case 1:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "待核查征信";
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "待公示";
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "公示中";
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "待发布";
|
|
|
|
+ break;
|
|
|
|
+ case 5:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "待发证";
|
|
|
|
+ break;
|
|
|
|
+ case 6:
|
|
|
|
+ $talentTypeChange["isPublicName"] = "已发证";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $talentTypeChange["streetName"] = $streetMap[$enterpriseList[$talentTypeChange["enterpriseId"]]];
|
|
|
|
+ if ($process != null) {
|
|
|
|
+ switch ($process) {
|
|
|
|
+ case -1:
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ if ($talentTypeChange["checkState"] == -1) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "审核不通过";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 1) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "待提交";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 10) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已驳回";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 15 || $talentTypeChange["checkState"] >= 25) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "待提交";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 7) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = ($talentTypeChange["highProcess"] != null && $talentTypeChange["highProcess"] >= 1) ? "重新提交" : "待审核";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 20) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = ($talentTypeChange["highProcess"] != null && $talentTypeChange["highProcess"] >= 1) ? "上级驳回" : "待审核";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ if ($talentTypeChange["depState"] == 1)
|
|
|
|
+ $talentTypeChange["checkStateName"] = "待审核";
|
|
|
|
+ if ($talentTypeChange["depState"] == 2)
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已驳回";
|
|
|
|
+ if ($talentTypeChange["depState"] == 3)
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已通过";
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ if ($talentTypeChange["checkState"] == -1) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "审核不通过";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 25) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = ($talentTypeChange["highProcess"] != null && $talentTypeChange["highProcess"] >= 3) ? "重新提交" : "待审核";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 30 || $talentTypeChange["checkState"] <= 20) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已驳回";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 35) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已通过";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ if ($talentTypeChange["checkState"] == -1) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "审核不通过";
|
|
|
|
+ } else if ($talentTypeChange["checkState"] == 35) {
|
|
|
|
+ $talentTypeChange["checkStateName"] = "已通过";
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }unset($talentTypeChange);
|
|
|
|
+ return $list;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|