|
@@ -19,6 +19,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$tpl = null;
|
|
|
$process = $this->request->param('process');
|
|
|
$assigns = [];
|
|
|
+ $assigns["enterprises"] = \app\common\api\EnterpriseApi::getSimpleList();
|
|
|
switch ($process) {
|
|
|
case -1:
|
|
|
$tpl = "dept_before"; //移除部门初审
|
|
@@ -171,6 +172,89 @@ class TalentTypeChange extends AdminController {
|
|
|
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() {
|
|
|
$id = $this->request->param("id");
|
|
|
$companyId = $this->request->param("companyId");
|
|
@@ -1269,8 +1353,11 @@ class TalentTypeChange extends AdminController {
|
|
|
}
|
|
|
|
|
|
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");
|
|
@@ -1338,23 +1425,34 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["isPublic", "=", 6];
|
|
|
break;
|
|
|
}
|
|
|
- $list = ttcModel::where($where)->select()->toArray();
|
|
|
+ $list = ttcModel::where($where)->whereRaw($whereRaw)->select()->toArray();
|
|
|
$list = $this->translateToChinese($list, $process);
|
|
|
- $column = [
|
|
|
- "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原公布入选来源", "原入选来源县市", "原入选名单批次", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
|
|
|
- "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新公布入选来源", "新入选来源县市", "新入选名单批次",
|
|
|
+ $columns = [
|
|
|
+ "姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
|
|
|
+ "原泉州高层次人才证书发证日期", "原泉州高层次人才证书的有效期", "原引进方式", "原公布入选月份", "原人才编号", "新申报年度", "新申报来源", "新入选来源地级市", "新入选来源县市区",
|
|
|
"新人才层次", "新认定条件", "新认定条件证书取得时间", "新认定条件过期时间", "新认定条件名称",
|
|
|
"新泉州高层次人才证书发证日期", "新泉州高层次人才证书的有效期", "新引进方式", "新公布入选月份", "新人才编号",
|
|
|
"审核状态", "公示状态"
|
|
|
];
|
|
|
- $title = [
|
|
|
- "talentName", "idCard", "enterpriseName", "streetName", "oldYear", "oldSourceName", "oldOurCitySourceName", "oldFromCityName", "newQzBath", "oldTalentArrangeName", "oldIdentifyConditionCH", "oldIdentifyGetTime", "oldIdentifyOutTime", "oldIdentifyConditionName",
|
|
|
- "oldCertificateStartTime", "oldCertificateOutTime", "oldIntroductionModeName", "oldIdentifyMonth", "oldCertificateNO", "newYear", "newSourceName", "newOurCitySourceName", "newFromCityName", "newQzBath",
|
|
|
- "newTalentArrangeName", "newIdentifyConditionCH", "newIdentifyGetTime", "newIdentifyOutTime", "newIdentifyConditionName",
|
|
|
- "newCertificateStartTime", "newCertificateOutTime", "newIntroductionModeName", "newIdentifyMonth", "newCertificateNO",
|
|
|
- "checkStateName", "isPublicName"
|
|
|
- ];
|
|
|
- $fileName = "人才层次变更导出";
|
|
|
+ $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) {
|
|
@@ -1362,7 +1460,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["talentName", "like", "%{$data["talentName"]}%"];
|
|
|
}
|
|
|
if (\StrUtil::isNotEmpAndNull($data["enterpriseName"])) {
|
|
|
- $where[] = ["enterpriseName", "like", "%{$data["enterpriseName"]}%"];
|
|
|
+ $where[] = ["enterpriseId", "=", $data["enterpriseName"]];
|
|
|
}
|
|
|
if (\StrUtil::isNotEmpAndNull($data["idCard"])) {
|
|
|
$where[] = ["idCard", "like", "%{$data["idCard"]}%"];
|