|
@@ -474,6 +474,260 @@ class LivingAllowance extends AdminController {
|
|
|
return json($response);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通用导出
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ public function commonExport() {
|
|
|
+ $response = new \stdClass();
|
|
|
+ $response->code = 500;
|
|
|
+
|
|
|
+ $request = $this->request;
|
|
|
+ $user = $this->user;
|
|
|
+ if (!in_array($user["type"], [1, 2])) {
|
|
|
+ $response->msg = "当前账号类型没有操作权限";
|
|
|
+ return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
+ }
|
|
|
+ $process = $request["process"];
|
|
|
+ $names = \StrUtil::getRequestDecodeParam($request, "names");
|
|
|
+ $values = \StrUtil::getRequestDecodeParam($request, "values");
|
|
|
+
|
|
|
+ $title = array_filter(explode(",", $names)); //exce标题
|
|
|
+ $keys = array_filter(explode(",", $values)); //标题对应的字段
|
|
|
+
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["type", "=", $user["type"]];
|
|
|
+ if ($_where = LivingAllowanceApi::setLivingAllowanceCheckStateCondition($request->param())) {
|
|
|
+ $where = array_merge($where, $_where);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($_where2 = LivingAllowanceApi::getWhereByParams($request->param())) {
|
|
|
+ $where = array_merge($where, $_where2);
|
|
|
+ }
|
|
|
+ if (in_array("declareTypeName", $keys)) {
|
|
|
+ $declareTypeMap = DictApi::selectByParentCode("un_master_education");
|
|
|
+ }
|
|
|
+ if (in_array("nationalityName", $keys)) {
|
|
|
+ $nationalityMap = DictApi::selectByParentCode("nationality");
|
|
|
+ }
|
|
|
+ if (in_array("nationName", $keys)) {
|
|
|
+ $nationaMap = DictApi::selectByParentCode("nation");
|
|
|
+ }
|
|
|
+ if (in_array("industryFieldNewName", $keys)) {
|
|
|
+ $industryFieldNewMap = DictApi::selectByParentCode("industry_field");
|
|
|
+ }
|
|
|
+ if (in_array("industryFieldName", $keys)) {
|
|
|
+ $industryFieldMap = DictApi::selectByParentCode("un_industryField");
|
|
|
+ }
|
|
|
+ if (in_array("streetName", $keys)) {
|
|
|
+ $streetMap = DictApi::selectByParentCode("street");
|
|
|
+ }
|
|
|
+ if (in_array("politicsName", $keys)) {
|
|
|
+ $politicsMap = DictApi::selectByParentCode("politics");
|
|
|
+ }
|
|
|
+ if (in_array("educationName", $keys)) {
|
|
|
+ $highEducationMap = DictApi::selectByParentCode("highest_degree");
|
|
|
+ }
|
|
|
+ if (in_array("introductionModeName", $keys)) {
|
|
|
+ $introductionModeMap = DictApi::selectByParentCode("un_introduction_mode");
|
|
|
+ }
|
|
|
+
|
|
|
+ $list = LaModel::where($_where)->select()->toArray();
|
|
|
+ $nationalityOldAndNew = [
|
|
|
+ "01" => "cn",
|
|
|
+ "02" => "cn_hk",
|
|
|
+ "03" => "cn_mc",
|
|
|
+ "04" => "cn_tw",
|
|
|
+ "05" => "us",
|
|
|
+ "06" => "en",
|
|
|
+ "07" => "jp",
|
|
|
+ "08" => "co",
|
|
|
+ "09" => "nl",
|
|
|
+ "10" => "sg",
|
|
|
+ "11" => "other"
|
|
|
+ ];
|
|
|
+ foreach ($list as $key => $item) {
|
|
|
+ if (in_array("declareTypeName", $keys)) {
|
|
|
+ $list[$key]["declareTypeName"] = $declareTypeMap[$item["declareType"]];
|
|
|
+ }
|
|
|
+ if (in_array("nationalityName", $keys)) {
|
|
|
+ $list[$key]["nationalityName"] = $nationalityMap[$item["nationality"]] ?: $nationalityMap[$nationalityOldAndNew[$item["nationality"]]];
|
|
|
+ }
|
|
|
+ if (in_array("nationName", $keys)) {
|
|
|
+ $list[$key]["nationName"] = $nationaMap[$item["nation"]];
|
|
|
+ }
|
|
|
+ if (in_array("industryFieldNewName", $keys)) {
|
|
|
+ $list[$key]["industryFieldNewName"] = $industryFieldNewMap[$item["industryFieldNew"]];
|
|
|
+ }
|
|
|
+ if (in_array("industryFieldName", $keys)) {
|
|
|
+ if ($item["industryFieldNew"]) {
|
|
|
+ $list[$key]["industryFieldName"] = DictApi::findByParentCodeAndCode($item["industryFieldNew"] . "_field", $item["industryField"])["name"];
|
|
|
+ } else {
|
|
|
+ $list[$key]["industryFieldName"] = $industryFieldMap[$item["industryField"]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (in_array("streetName", $keys)) {
|
|
|
+ $list[$key]["streetName"] = $streetMap[$item["address"]];
|
|
|
+ }
|
|
|
+ if (in_array("politicsName", $keys)) {
|
|
|
+ $list[$key]["politicsName"] = $politicsMap[$item["politics"]];
|
|
|
+ }
|
|
|
+ if (in_array("educationName", $keys)) {
|
|
|
+ $list[$key]["educationName"] = $highEducationMap[$item["highEducation"]];
|
|
|
+ }
|
|
|
+ if (in_array("introductionModeName", $keys)) {
|
|
|
+ $list[$key]["introductionModeName"] = $introductionModeMap[$item["introductionMode"]];
|
|
|
+ }
|
|
|
+ if (in_array("introductionMethodName", $keys)) {
|
|
|
+ $list[$key]["introductionMethodName"] = $item["introductionMethod"] == 1 ? "新引进" : "其他";
|
|
|
+ }
|
|
|
+ if (in_array("sexName", $keys)) {
|
|
|
+ $list[$key]["sexName"] = $item["sex"] == 1 ? "男" : "女";
|
|
|
+ }
|
|
|
+ if (in_array("cardTypeName", $keys)) {
|
|
|
+ switch ($item["cardType"]) {
|
|
|
+ case 1:
|
|
|
+ $list[$key]["cardTypeName"] = "身份证";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $list[$key]["cardTypeName"] = "通行证";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ $list[$key]["cardTypeName"] = "护照";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $list[$key]["cardTypeName"] = "未知";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (in_array("isPublicName", $keys)) {
|
|
|
+ switch ($item["isPublic"]) {
|
|
|
+ case 1:
|
|
|
+ $list[$key]["isPublicName"] = "待核查征信";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $list[$key]["isPublicName"] = "待公示";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ $list[$key]["isPublicName"] = "公示中";
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ $list[$key]["isPublicName"] = "待兑现";
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ $list[$key]["isPublicName"] = "已兑现";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (in_array("studyAbroadName", $keys)) {
|
|
|
+ $list[$key]["studyAbroadName"] = $item["studyAbroad"] == 1 ? "是" : "否";
|
|
|
+ }
|
|
|
+ if (in_array("recommendIsPayName", $keys)) {
|
|
|
+ if ($item["recommendIsPay"] == -1) {
|
|
|
+ $list[$key]["recommendIsPayName"] = "不予兑现";
|
|
|
+ }
|
|
|
+ if ($item["recommendIsPay"] == 0) {
|
|
|
+ $list[$key]["recommendIsPayName"] = "未知";
|
|
|
+ }
|
|
|
+ if ($item["recommendIsPay"] == 1) {
|
|
|
+ $list[$key]["recommendIsPayName"] = "待兑现";
|
|
|
+ }
|
|
|
+ if ($item["recommendIsPay"] == 2) {
|
|
|
+ $list[$key]["recommendIsPayName"] = "已兑现";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (in_array("isPayName", $keys)) {
|
|
|
+ if ($item["isPay"] == -1) {
|
|
|
+ $list[$key]["isPayName"] = "不予兑现";
|
|
|
+ }
|
|
|
+ if ($item["isPay"] == 0) {
|
|
|
+ $list[$key]["isPayName"] = "未知";
|
|
|
+ }
|
|
|
+ if ($item["isPay"] == 1) {
|
|
|
+ $list[$key]["isPayName"] = "待兑现";
|
|
|
+ }
|
|
|
+ if ($item["isPay"] == 2) {
|
|
|
+ $list[$key]["isPayName"] = "已兑现";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (in_array("creditStatusName", $keys)) {
|
|
|
+ if ($item["creditStatus"] == 1) {
|
|
|
+ $list[$key]["creditStatusName"] = "待核查征信";
|
|
|
+ }
|
|
|
+ if ($item["creditStatus"] == 2) {
|
|
|
+ $list[$key]["creditStatusName"] = "征信通过";
|
|
|
+ }
|
|
|
+ if ($item["creditStatus"] == 3) {
|
|
|
+ $list[$key]["creditStatusName"] = "征信失信";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($process && in_array("checkStateName", $keys)) {
|
|
|
+ switch ($process) {
|
|
|
+ case 1:
|
|
|
+ if ($item["checkState"] == -1) {
|
|
|
+ $list[$key]["checkStateName"] = "审核不通过";
|
|
|
+ } else if ($item["checkState"] == 1) {
|
|
|
+ $list[$key]["checkStateName"] = "待提交";
|
|
|
+ } else if ($item["checkState"] == 10) {
|
|
|
+ $list[$key]["checkStateName"] = "已驳回";
|
|
|
+ } else if ($item["checkState"] == 15 || $item["checkState"] >= 25 || $item["checkState"] >= 35) {
|
|
|
+ $list[$key]["checkStateName"] = "已通过";
|
|
|
+ } else if ($item["checkState"] == 7) {
|
|
|
+ $list[$key]["checkStateName"] = $item["highProcess"] >= 1 ? "重新提交" : "待审核";
|
|
|
+ } else if ($item["checkState"] == 20) {
|
|
|
+ $list[$key]["checkStateName"] = $item["highProcess"] >= 1 ? "上级驳回" : "待审核";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if ($item["checkState"] == -1) {
|
|
|
+ $list[$key]["checkStateName"] = "审核不通过";
|
|
|
+ } else if ($item["checkState"] == 25) {
|
|
|
+ $list[$key]["checkStateName"] = $item["highProcess"] >= 3 ? "重新提交" : "待审核";
|
|
|
+ } else if ($item["checkState"] == 30 || $item["checkState"] <= 20) {
|
|
|
+ $list[$key]["checkStateName"] = "已驳回";
|
|
|
+ } else if ($item["checkState"] == 35) {
|
|
|
+ $list[$key]["checkStateName"] = "已通过";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ if ($item["checkState"] == -1) {
|
|
|
+ $list[$key]["checkStateName"] = "审核不通过";
|
|
|
+ } else if ($item["checkState"] == 35) {
|
|
|
+ $list[$key]["checkStateName"] = "已通过";
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ $list[$key]["checkStateName"] = "已通过";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $fileName = "硕博人才生活补贴申报导出";
|
|
|
+ if ($process == 1) {
|
|
|
+ $fileName = "硕博人才生活补贴初审导出";
|
|
|
+ } else if ($process == 2) {
|
|
|
+ $fileName = "硕博人才生活补贴部门审核导出";
|
|
|
+ } else if ($process == 3) {
|
|
|
+ $fileName = "硕博人才生活补贴复核导出";
|
|
|
+ } else if ($process == 4) {
|
|
|
+ $fileName = "硕博人才生活补贴兑现导出";
|
|
|
+ }
|
|
|
+ $rows = [];
|
|
|
+ foreach ($list as $item) {
|
|
|
+ $row = [];
|
|
|
+ foreach ($keys as $k) {
|
|
|
+ $row[] = $item[$k];
|
|
|
+ }
|
|
|
+ $rows[] = $row;
|
|
|
+ }
|
|
|
+ if (!$rows) {
|
|
|
+ $response->msg = "没有可导出的内容";
|
|
|
+ return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
+ }
|
|
|
+ export($title, $rows, $fileName);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出核查征信名单
|
|
|
* @auth {{/talentInfo/exportHczx}}
|
|
@@ -508,6 +762,120 @@ class LivingAllowance extends AdminController {
|
|
|
export($title, $exportList, $fileName);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 公示预览
|
|
|
+ */
|
|
|
+ public function exportPublic() {
|
|
|
+ $response = new \stdClass();
|
|
|
+ $response->code = 500;
|
|
|
+ $user = $this->user;
|
|
|
+ $ids = array_filter(explode(",", $this->request->param("ids")));
|
|
|
+ $batch = date("Ym");
|
|
|
+ //查询需要公示的数据(勾选)
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
+ $list = LaModel::where($where)->order("enterpriseId")->select()->toArray();
|
|
|
+ $rows = [];
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
+ $obj = $list[$i];
|
|
|
+ $obj["sexName"] = $obj["sex"] == 1 ? "男" : "女";
|
|
|
+ $obj["sn"] = $i + 1;
|
|
|
+ if ($obj["checkState"] == LaState::LA_NOTPASS) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["mainId", "=", $obj["id"]];
|
|
|
+ $where[] = ["type", "=", ProjectState::LIVINGALLOWANCE];
|
|
|
+ $where[] = ["step", "=", 3];
|
|
|
+ $where[] = ["state", "<>", 8];
|
|
|
+ $log = TalentLog::where($where)->order("createTime desc")->find();
|
|
|
+ if ($log && $log["state"] == -1) {
|
|
|
+ $obj["description"] = $log["description"];
|
|
|
+ }
|
|
|
+ if ($obj["outMsg"]) {
|
|
|
+ $obj["description"] = ($log["description"] ? $log["description"] : "") . $obj["outMsg"];
|
|
|
+ }
|
|
|
+ $obj["stateName"] = "审核不通过";
|
|
|
+ }
|
|
|
+ if ($obj["checkState"] == LaState::LA_PASS) {
|
|
|
+ $obj["stateName"] = "审核通过";
|
|
|
+ }
|
|
|
+ $rows[] = [
|
|
|
+ $obj["sn"], $obj["name"], $obj["sexName"], $obj["enterpriseName"], $obj["stateName"], $obj["description"]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $title = ["序号", "姓名", "性别", "工作单位", "审核状态", "备注"];
|
|
|
+
|
|
|
+ $fileName = "硕博人才生活补贴申报第" . $batch . "批次公示导出";
|
|
|
+ $titleName = "";
|
|
|
+ if ($user["type"] == 1) {
|
|
|
+ $titleName = substr($batch, 0, 4) . "年" . substr($batch, 4, 6) . "月硕博人才生活补贴申报对象公示名单";
|
|
|
+ }
|
|
|
+ if ($user["type"] == 2) {
|
|
|
+ $titleName = substr($batch, 0, 4) . "年" . substr($batch, 4, 6) . "月硕博人才生活补贴申报对象公示名单";
|
|
|
+ }
|
|
|
+ export($title, $rows, $fileName, [], $titleName);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公示导出
|
|
|
+ */
|
|
|
+ public function publicExport() {
|
|
|
+ $response = new \stdClass();
|
|
|
+ $response->code = 500;
|
|
|
+ $user = $this->user;
|
|
|
+ if (!in_array($user["type"], [1, 2])) {
|
|
|
+ $response->msg = "当前账号类型没有操作权限";
|
|
|
+ return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
+ }
|
|
|
+ $startTime = $this->request["startTime"];
|
|
|
+ $endTime = $this->request["endTime"];
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["publicBatch", "between", [$startTime, $endTime]];
|
|
|
+ $where[] = ["type", "=", $user["type"]];
|
|
|
+ $list = LaModel::where($where)->order("publicBatch")->select()->toArray();
|
|
|
+ if (!$list) {
|
|
|
+ $response->msg = "所选时间段内无公示数据";
|
|
|
+ return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
+ }
|
|
|
+ $rows = [];
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
+ $obj = $list[$i];
|
|
|
+
|
|
|
+ $obj["sexName"] = $obj["sex"] == 1 ? "男" : "女";
|
|
|
+ $obj["sn"] = $i + 1;
|
|
|
+ if ($obj["checkState"] == LaState::LA_NOTPASS) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["mainId", "=", $obj["id"]];
|
|
|
+ $where[] = ["type", "=", ProjectState::LIVINGALLOWANCE];
|
|
|
+ $where[] = ["step", "=", 3];
|
|
|
+ $where[] = ["state", "<>", 8];
|
|
|
+ $log = TalentLog::where($where)->order("createTime desc")->find();
|
|
|
+ if ($log && $log["state"] == -1) {
|
|
|
+ $obj["description"] = $log["description"];
|
|
|
+ }
|
|
|
+ if ($obj["outMsg"]) {
|
|
|
+ $obj["description"] = ($log["description"] ? $log["description"] : "") . $obj["outMsg"];
|
|
|
+ }
|
|
|
+ $obj["stateName"] = "审核不通过";
|
|
|
+ }
|
|
|
+ if ($obj["checkState"] == LaState::LA_PASS) {
|
|
|
+ $obj["stateName"] = "审核通过";
|
|
|
+ }
|
|
|
+ $rows[] = [
|
|
|
+ $obj["sn"], $obj["publicBatch"], $obj["name"], $obj["sexName"], $obj["enterpriseName"], $obj["stateName"], $obj["description"]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $title = ["序号", "公示批次", "姓名", "性别", "工作单位", "审核状态", "备注"];
|
|
|
+ $fileName = "硕博人才生活补贴公示导出";
|
|
|
+ $titleName = "";
|
|
|
+ if ($user["type"] == 1) {
|
|
|
+ $titleName = $startTime . "至" . $endTime . "硕博人才生活补贴申报公示名单";
|
|
|
+ }
|
|
|
+ if ($user["type"] == 2) {
|
|
|
+ $titleName = $startTime . "至" + $endTime . "硕博人才生活补贴申报公示名单";
|
|
|
+ }
|
|
|
+ export($title, $rows, $fileName, [], $titleName);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导入征信核查结果
|
|
|
* @auth {{/talentInfo/importProject}}
|
|
@@ -736,7 +1104,7 @@ class LivingAllowance extends AdminController {
|
|
|
$data["recommendJudgmentDetails"] = "";
|
|
|
$desc = "(公示再审核驳回)审核状态:" . LaState::getStateDesc($old["checkState"]) . "->" . LaState::getStateDesc($data["checkState"]) .
|
|
|
";公示状态:<span class='label label-success'>公示中</span>-><span class='label label-primary'>待核查征信</span>";
|
|
|
- } else if (obj . getCheckState() == StateConst . RCRD_NOTPASS) {
|
|
|
+ } else if ($checkState == LaState::LA_NOTPASS) {
|
|
|
$data["isPublic"] = 4;
|
|
|
$data["recommendIsPay"] = -1;
|
|
|
$data["recommendAmount"] = 0;
|
|
@@ -799,9 +1167,18 @@ class LivingAllowance extends AdminController {
|
|
|
$obj = $upList[$i];
|
|
|
|
|
|
if ($obj["isPublic"] != 3) {
|
|
|
- $response->msg = sprintf("第%d条记录不是公示中状态,不能公示通过");
|
|
|
+ $response->msg = sprintf("第%d条记录不是公示中状态,不能公示通过", $i + 1);
|
|
|
return json($response);
|
|
|
}
|
|
|
+
|
|
|
+ $obj["isPublic"] = 4;
|
|
|
+ $obj["amount"] = $obj["recommendAmount"];
|
|
|
+ $obj["isPay"] = $obj["recommendIsPay"];
|
|
|
+ $obj["amountDesc"] = $obj["recommendAmountDesc"];
|
|
|
+ $obj["judgmentDetails"] = $obj["recommendJudgmentDetails"];
|
|
|
+ Db::table("md_living_allowance_info")->save($obj);
|
|
|
+
|
|
|
+ //添加日志
|
|
|
$newLog["id"] = getStringId();
|
|
|
$newLog["type"] = ProjectState::LIVINGALLOWANCE;
|
|
|
$newLog["mainId"] = $obj["id"];
|
|
@@ -812,15 +1189,7 @@ class LivingAllowance extends AdminController {
|
|
|
$newLog["description"] = "";
|
|
|
$newLog["createTime"] = date("Y-m-d H:i:s");
|
|
|
$newLog["createUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"]);
|
|
|
-
|
|
|
$newLogs[] = $newLog;
|
|
|
-
|
|
|
- $obj["isPublic"] = 4;
|
|
|
- $obj["amount"] = $obj["recommendAmount"];
|
|
|
- $obj["isPay"] = $obj["recommendIsPay"];
|
|
|
- $obj["amountDesc"] = $obj["recommendAmountDesc"];
|
|
|
- $obj["judgmentDetails"] = $obj["recommendJudgmentDetails"];
|
|
|
- Db::table("md_living_allowance_info")->save($obj);
|
|
|
}
|
|
|
Db::table("new_talent_checklog")->insertAll($newLogs);
|
|
|
Db::commit();
|
|
@@ -838,20 +1207,50 @@ class LivingAllowance extends AdminController {
|
|
|
* 兑现
|
|
|
*/
|
|
|
public function issue() {
|
|
|
- /* Company company = (Company) this . getSession() . getAttribute("company");
|
|
|
- List<LivingAllowanceInfo> tiList = this.livingAllowanceInfoService.selectList(new EntityWrapper<LivingAllowanceInfo>().in("id", ids.split(",")));
|
|
|
- List<TalentChecklog> logList = new ArrayList<>();
|
|
|
- for (LivingAllowanceInfo obj : tiList) {
|
|
|
- obj . setIsPublic(5);
|
|
|
- //添加日志
|
|
|
- TalentChecklog log = new TalentChecklog(Integer . parseInt(ProjectConst . MASTERLIVINGALLOWANCE), obj . getId(), null,
|
|
|
- StateConst . ACTIVE_YES, BasicStateEnum . RCRD_BASIC_PASS . getCode(), StepEnum . RCRD_STEP_CARD . getCode(), "<span class='label label-success'>待兑现</span>-><span class='label label-primary'>已兑现</span>", "",
|
|
|
- DateUtil . getTime(), ShiroKit . getUser() . getAccount() + "(" + company . getName() + ")");
|
|
|
- logList . add(log);
|
|
|
- }
|
|
|
- this . livingAllowanceInfoService . updateBatchById(tiList);
|
|
|
- this . talentChecklogService . insertBatch(logList);
|
|
|
- return new ResponseObj(ResponseObj . SUCCESS, "兑现成功"); */
|
|
|
+ $response = new \stdClass();
|
|
|
+ $response->code = 500;
|
|
|
+
|
|
|
+ $ids = array_filter(explode(",", \StrUtil::getRequestDecodeParam($this->request, "ids")));
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
+ $list = Db::table("md_living_allowance_info")->where($where)->select()->toArray();
|
|
|
+ $newLogs = [];
|
|
|
+ Db::startTrans();
|
|
|
+ try {
|
|
|
+ for ($i = 0; $i < count($list); $i++) {
|
|
|
+ $obj = $list[$i];
|
|
|
+
|
|
|
+ if ($obj["isPublic"] != 4) {
|
|
|
+ $response->msg = sprintf("第%d条记录不是公示通过状态,不能兑现", $i + 1);
|
|
|
+ return json($response);
|
|
|
+ }
|
|
|
+ $obj["isPublic"] = 5;
|
|
|
+ $obj["isPay"] = 2;
|
|
|
+ Db::table("md_living_allowance_info")->save($obj);
|
|
|
+
|
|
|
+ //添加日志
|
|
|
+ $newLog["id"] = getStringId();
|
|
|
+ $newLog["type"] = ProjectState::LIVINGALLOWANCE;
|
|
|
+ $newLog["mainId"] = $obj["id"];
|
|
|
+ $newLog["active"] = 1;
|
|
|
+ $newLog["state"] = 3;
|
|
|
+ $newLog["step"] = 8;
|
|
|
+ $newLog["stateChange"] = "<span class='label label-success'>待兑现</span>-><span class='label label-primary'>已兑现</span>";
|
|
|
+ $newLog["description"] = "";
|
|
|
+ $newLog["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ $newLog["createUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"]);
|
|
|
+ $newLogs[] = $newLog;
|
|
|
+ }
|
|
|
+ Db::table("new_talent_checklog")->insertAll($newLogs);
|
|
|
+ Db::commit();
|
|
|
+ $response->code = 200;
|
|
|
+ $response->msg = "兑现成功";
|
|
|
+ return json($response);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ Db::rollback();
|
|
|
+ $response->msg = $e->getMessage();
|
|
|
+ return json($response);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|