|
@@ -12,6 +12,7 @@ use app\common\state\CommonConst;
|
|
|
use app\common\state\ProjectState;
|
|
|
use app\common\api\TalentLogApi;
|
|
|
use app\common\model\TalentChecklog;
|
|
|
+use app\common\api\TalentTypeChangeApi as ttcApi;
|
|
|
|
|
|
class TalentTypeChange extends AdminController {
|
|
|
|
|
@@ -71,7 +72,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$where = [];
|
|
|
$this->setTalentTypeChange($where, $params);
|
|
|
$this->setTypeChangeCheckStateCondition($where, $params, $process);
|
|
|
- $whereRaw = "length(talentId) <> 19";
|
|
|
+ //$whereRaw = "length(talentId) <> 19";
|
|
|
if (in_array($this->user["type"], [1, 2, 5, 6])) {
|
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
|
}
|
|
@@ -104,8 +105,8 @@ class TalentTypeChange extends AdminController {
|
|
|
}
|
|
|
|
|
|
$levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
|
- $count = ttcModel::whereRaw($whereRaw)->where($where)->count();
|
|
|
- $list = ttcModel::whereRaw($whereRaw)->where($where)->limit($offset, $limit)->order("createTime {$order}")->select()->toArray();
|
|
|
+ $count = ttcModel::where($where)->count();
|
|
|
+ $list = ttcModel::where($where)->limit($offset, $limit)->order("createTime {$order}")->select()->toArray();
|
|
|
foreach ($list as $key => $item) {
|
|
|
if ($item["beforeCheckCompany"]) {
|
|
|
$list[$key]["beforeCheckCompanyName"] = getCacheById("Company", $item["beforeCheckCompany"]);
|
|
@@ -135,7 +136,7 @@ class TalentTypeChange extends AdminController {
|
|
|
}
|
|
|
|
|
|
public function toCommonCheck($id, $process) {
|
|
|
- $info = ttcModel::find($id);
|
|
|
+ $info = ttcApi::getOne($id);
|
|
|
$arrangeMap = DictApi::selectByParentCode("talent_arrange");
|
|
|
$importMap = DictApi::selectByParentCode("import_way");
|
|
|
$info["oldTalentArrangeName"] = $arrangeMap[$info["oldTalentArrange"]];
|
|
@@ -177,7 +178,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$response->code = 500;
|
|
|
$params = $this->request->param();
|
|
|
$id = $params["id"];
|
|
|
- $info = ttcModel::find($id);
|
|
|
+ $info = ttcApi::getOne($id);
|
|
|
if (!$info) {
|
|
|
$response->msg = "请选择需要修改的对象";
|
|
|
return $response;
|
|
@@ -261,15 +262,19 @@ class TalentTypeChange extends AdminController {
|
|
|
$process = $this->request->param("process");
|
|
|
$response = new \stdClass();
|
|
|
$response->code = 500;
|
|
|
- $whr = [];
|
|
|
- $whr[] = ["id", "=", $id];
|
|
|
- $whr[] = ["type", "=", $this->user["type"]];
|
|
|
- $whr[] = ["delete", "=", 0];
|
|
|
- $info = ttcModel::where($whr)->find();
|
|
|
- if (!$info || strlen($info["talentId"]) == 19) {
|
|
|
+ $info = ttcApi::getOne($id);
|
|
|
+ if (!$info || $info["delete"] == 1 || $info["type"] != $this->user["type"]) {
|
|
|
$response->msg = "没有对应的人才变更记录";
|
|
|
return $response;
|
|
|
}
|
|
|
+ if (!$info["talentId"]) {
|
|
|
+ $response->msg = "没有对应的人才信息";
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+ if (!$info["newIdentifyCondition"]) {
|
|
|
+ $response->msg = "没有对应的认定条件";
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
$where = [];
|
|
|
$where[] = ["step", "=", $process];
|
|
|
$where[] = ["active", "=", 0];
|
|
@@ -437,7 +442,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$log["id"] = $lastLog["id"];
|
|
|
$log["active"] = 1;
|
|
|
$log["state"] = 8;
|
|
|
- $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($checkState);
|
|
|
+ $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($data["checkState"]);
|
|
|
$log["updateUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
|
|
|
$log["updateTime"] = date("Y-m-d H:i:s");
|
|
|
Db::table("new_talent_checklog")->update($log);
|
|
@@ -465,7 +470,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$log["id"] = $lastLog["id"];
|
|
|
$log["active"] = 1;
|
|
|
$log["state"] = 8;
|
|
|
- $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($checkState);
|
|
|
+ $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($data["checkState"]);
|
|
|
$log["updateUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
|
|
|
$log["updateTime"] = date("Y-m-d H:i:s");
|
|
|
Db::table("new_talent_checklog")->update($log);
|
|
@@ -518,7 +523,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$log["id"] = $lastLog["id"];
|
|
|
$log["active"] = 1;
|
|
|
$log["state"] = 8;
|
|
|
- $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($checkState);
|
|
|
+ $log["stateChange"] = MainState::getStateDesc($old["checkState"]) . "->" . MainState::getStateDesc($data["checkState"]);
|
|
|
$log["updateUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
|
|
|
$log["updateTime"] = date("Y-m-d H:i:s");
|
|
|
Db::table("new_talent_checklog")->update($log);
|
|
@@ -579,8 +584,8 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["checkState", "in", [35]];
|
|
|
break;
|
|
|
}
|
|
|
- $whereRaw = "length(talentId)<>19";
|
|
|
- $list = ttcModel::where($where)->whereRaw($whereRaw)->field("id,idCard,talentName,enterpriseId,checkState")->select()->toArray();
|
|
|
+ //$whereRaw = "length(talentId)<>19";
|
|
|
+ $list = ttcModel::where($where)->field("id,idCard,talentName,enterpriseId,checkState")->select()->toArray();
|
|
|
//查询企业信息
|
|
|
$enterprises = \app\common\model\Enterprise::column("name", "id");
|
|
|
foreach ($list as $key => $item) {
|
|
@@ -739,8 +744,12 @@ class TalentTypeChange extends AdminController {
|
|
|
$ids_arr = array_filter(explode(",", $params["ids"]));
|
|
|
$columns = ["序号", "姓名", "工作单位", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
|
if ($ids_arr) {
|
|
|
- $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();
|
|
|
+ $where[] = ["id", "in", $ids_arr];
|
|
|
+ $list = ttcModel::where($where)->select()->toArray();
|
|
|
+
|
|
|
+ $oldIdentifyConditions = [];
|
|
|
+ $newIdentifyConditions = [];
|
|
|
+
|
|
|
$rows = [];
|
|
|
$talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
|
for ($i = 0; $i < count($list); $i++) {
|
|
@@ -763,8 +772,20 @@ class TalentTypeChange extends AdminController {
|
|
|
if ($item["checkState"] == MainState::PASS) {
|
|
|
$stateName = "审核通过";
|
|
|
}
|
|
|
+ $identifyConditionZH = "";
|
|
|
+ if (strlen($item["newIdentifyCondition"]) == 19) {
|
|
|
+ if (!$oldIdentifyConditions) {
|
|
|
+ $oldIdentifyConditions = Db::table("un_identify_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $oldIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ if (!$newIdentifyConditions) {
|
|
|
+ $newIdentifyConditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $newIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ }
|
|
|
$row = [
|
|
|
- $i + 1, $item["talentName"], $item["enterpriseName"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
+ $i + 1, $item["talentName"], $item["enterpriseName"], $identifyConditionZH, $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
];
|
|
|
$rows[] = $row;
|
|
|
}
|
|
@@ -861,13 +882,17 @@ class TalentTypeChange extends AdminController {
|
|
|
if (!strtotime($startTime) || !strtotime($endTime))
|
|
|
return json(["msg" => "时间格式错误"]);
|
|
|
$where = [];
|
|
|
- $where[] = ["ttc.type", "=", $this->user["type"]];
|
|
|
+ $where[] = ["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();
|
|
|
+ $list = ttcModel::where($where)->order("publicBatch")->select()->toArray();
|
|
|
if (!$list) {
|
|
|
$response->msg = "所选时间段内无公示数据";
|
|
|
return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
}
|
|
|
+
|
|
|
+ $oldIdentifyConditions = [];
|
|
|
+ $newIdentifyConditions = [];
|
|
|
+
|
|
|
$rows = [];
|
|
|
$i = 1;
|
|
|
$talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
@@ -891,8 +916,20 @@ class TalentTypeChange extends AdminController {
|
|
|
if ($item["checkState"] == MainState::PASS) {
|
|
|
$stateName = "审核通过";
|
|
|
}
|
|
|
+ $identifyConditionZH = "";
|
|
|
+ if (strlen($item["newIdentifyCondition"]) == 19) {
|
|
|
+ if (!$oldIdentifyConditions) {
|
|
|
+ $oldIdentifyConditions = Db::table("un_identify_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $oldIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ if (!$newIdentifyConditions) {
|
|
|
+ $newIdentifyConditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $newIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ }
|
|
|
$row = [
|
|
|
- $i + 1, $item["publicBatch"], $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
+ $i + 1, $item["publicBatch"], $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $identifyConditionZH, $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
];
|
|
|
$rows[] = $row;
|
|
|
}
|
|
@@ -1091,12 +1128,15 @@ class TalentTypeChange extends AdminController {
|
|
|
*/
|
|
|
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();
|
|
|
+ $where[] = ["id", "in", explode(",", $ids)];
|
|
|
+ $list = ttcModel::where($where)->select()->toArray();
|
|
|
if (!$list) {
|
|
|
$response->msg = "系统错误,请联系管理员";
|
|
|
return $response;
|
|
|
}
|
|
|
+ $oldIdentifyConditions = [];
|
|
|
+ $newIdentifyConditions = [];
|
|
|
+
|
|
|
$columns = ["序号", "批次", "姓名", "工作单位", "申请认定时间", "本人具备的认定条件", "拟认定人才层次", "审核状态", "备注"];
|
|
|
$rows = [];
|
|
|
$levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
@@ -1121,8 +1161,21 @@ class TalentTypeChange extends AdminController {
|
|
|
$stateName = "审核通过";
|
|
|
}
|
|
|
|
|
|
+ $identifyConditionZH = "";
|
|
|
+ if (strlen($obj["newIdentifyCondition"]) == 19) {
|
|
|
+ if (!$oldIdentifyConditions) {
|
|
|
+ $oldIdentifyConditions = Db::table("un_identify_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $oldIdentifyConditions[$obj["newIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ if (!$newIdentifyConditions) {
|
|
|
+ $newIdentifyConditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $newIdentifyConditions[$obj["newIdentifyCondition"]];
|
|
|
+ }
|
|
|
+
|
|
|
$rows[] = [
|
|
|
- $i + 1, $obj["publicBatch"], $obj["talentName"], $obj["enterpriseName"], $obj["newIdentifyMonth"], $obj["identifyConditionZH"], $levelMap[$obj["newTalentArrange"]], $stateName, $description
|
|
|
+ $i + 1, $obj["publicBatch"], $obj["talentName"], $obj["enterpriseName"], $obj["newIdentifyMonth"], $identifyConditionZH, $levelMap[$obj["newTalentArrange"]], $stateName, $description
|
|
|
];
|
|
|
}
|
|
|
$filename = "人才层次变更公布名单导出";
|
|
@@ -1144,13 +1197,17 @@ class TalentTypeChange extends AdminController {
|
|
|
if (!strtotime($startTime) || !strtotime($endTime))
|
|
|
return json(["msg" => "时间格式错误"]);
|
|
|
$where = [];
|
|
|
- $where[] = ["ttc.type", "=", $this->user["type"]];
|
|
|
+ $where[] = ["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();
|
|
|
+ $list = ttcModel::where($where)->order("newIdentifyMonth")->select()->toArray();
|
|
|
if (!$list) {
|
|
|
$response->msg = "所选时间段内无公布数据";
|
|
|
return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
}
|
|
|
+
|
|
|
+ $oldIdentifyConditions = [];
|
|
|
+ $newIdentifyConditions = [];
|
|
|
+
|
|
|
$rows = [];
|
|
|
$i = 1;
|
|
|
$talentArranges = DictApi::selectByParentCode("talent_arrange");
|
|
@@ -1174,8 +1231,22 @@ class TalentTypeChange extends AdminController {
|
|
|
if ($item["checkState"] == MainState::PASS) {
|
|
|
$stateName = "审核通过";
|
|
|
}
|
|
|
+
|
|
|
+ $identifyConditionZH = "";
|
|
|
+ if (strlen($item["newIdentifyCondition"]) == 19) {
|
|
|
+ if (!$oldIdentifyConditions) {
|
|
|
+ $oldIdentifyConditions = Db::table("un_identify_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $oldIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ if (!$newIdentifyConditions) {
|
|
|
+ $newIdentifyConditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ }
|
|
|
+ $identifyConditionZH = $newIdentifyConditions[$item["newIdentifyCondition"]];
|
|
|
+ }
|
|
|
+
|
|
|
$row = [
|
|
|
- $i + 1, $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $item["identifyConditionZH"], $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
+ $i + 1, $item["talentName"], $item["enterpriseName"], $item["newIdentifyMonth"], $identifyConditionZH, $talentArranges[$item["newTalentArrange"]], $stateName, $description
|
|
|
];
|
|
|
$rows[] = $row;
|
|
|
}
|
|
@@ -1268,6 +1339,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["id", "in", $ids];
|
|
|
$changeList = ttcModel::where($where)->select()->toArray();
|
|
|
$year = date("Y");
|
|
|
+ $translateOldAndNewIdentifyConditionMap = Db::table("un_identify_condition")->alias("o")->leftJoin("new_talent_condition n", "n.name=o.name and n.type=o.type")->where("o.type", $this->user["type"])->column("n.id", "o.id");
|
|
|
foreach ($changeList as $change) {
|
|
|
if ($change["checkState"] != MainState::PASS || $change["isPublic"] != 5) {
|
|
|
Db::rollback();
|
|
@@ -1285,7 +1357,11 @@ class TalentTypeChange extends AdminController {
|
|
|
}
|
|
|
$data["id"] = $change["talentId"];
|
|
|
$data["talent_arrange"] = $change["newTalentArrange"];
|
|
|
- $data["talent_condition"] = $change["newIdentifyCondition"];
|
|
|
+ $identifyCondition = $change["newIdentifyCondition"];
|
|
|
+ if (strlen($identifyCondition) == 19) {
|
|
|
+ $identifyCondition = $translateOldAndNewIdentifyConditionMap[$identifyCondition];
|
|
|
+ }
|
|
|
+ $data["talent_condition"] = $identifyCondition;
|
|
|
$data["identifyConditionName"] = $change["newIdentifyConditionName"];
|
|
|
$data["source"] = $change["newSource"];
|
|
|
$data["source_city"] = $change["newFromCity"];
|
|
@@ -1357,7 +1433,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$response->code = 500;
|
|
|
$where = [];
|
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
|
- $whereRaw = "length(talentId) <> 19";
|
|
|
+ //$whereRaw = "length(talentId) <> 19";
|
|
|
$request = $this->request;
|
|
|
$talentName = \StrUtil::getRequestDecodeParam($request, "talentName");
|
|
|
$idCard = \StrUtil::getRequestDecodeParam($request, "idCard");
|
|
@@ -1425,7 +1501,7 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["isPublic", "=", 6];
|
|
|
break;
|
|
|
}
|
|
|
- $list = ttcModel::where($where)->whereRaw($whereRaw)->select()->toArray();
|
|
|
+ $list = ttcModel::where($where)->select()->toArray();
|
|
|
$list = $this->translateToChinese($list, $process);
|
|
|
$columns = [
|
|
|
"姓名", "证件号码", "工作单位", "所属街道", "原申报年度", "原申报来源", "原入选来源地级市", "原入选来源县市区", "原人才层次", "原认定条件", "原认定条件证书取得时间", "原认定条件过期时间", "原认定条件名称",
|
|
@@ -1552,7 +1628,8 @@ class TalentTypeChange extends AdminController {
|
|
|
$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");
|
|
|
+ $newIdentifyConditions = Db::table("new_talent_condition")->where("type", $this->user["type"])->column("name", "id");
|
|
|
+ $oldIdentifyConditions = Db::table("un_identify_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");
|
|
@@ -1563,8 +1640,16 @@ class TalentTypeChange extends AdminController {
|
|
|
$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"]];
|
|
|
+ if (strlen($talentTypeChange["oldIdentifyCondition"]) == 19) {
|
|
|
+ $talentTypeChange["oldIdentifyConditionCH"] = $oldIdentifyConditions[$talentTypeChange["oldIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ $talentTypeChange["oldIdentifyConditionCH"] = $newIdentifyConditions[$talentTypeChange["oldIdentifyCondition"]];
|
|
|
+ }
|
|
|
+ if (strlen($talentTypeChange["newIdentifyCondition"]) == 19) {
|
|
|
+ $talentTypeChange["newIdentifyConditionCH"] = $oldIdentifyConditions[$talentTypeChange["newIdentifyCondition"]];
|
|
|
+ } else {
|
|
|
+ $talentTypeChange["newIdentifyConditionCH"] = $newIdentifyConditions[$talentTypeChange["newIdentifyCondition"]];
|
|
|
+ }
|
|
|
switch ($talentTypeChange["isPublic"]) {
|
|
|
case 1:
|
|
|
$talentTypeChange["isPublicName"] = "待核查征信";
|