|
@@ -158,33 +158,6 @@ class House extends AdminController {
|
|
|
return view($template, $vars);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查看详情
|
|
|
- * @return type
|
|
|
- */
|
|
|
- public function toSelectPage() {
|
|
|
- $id = $this->request["id"];
|
|
|
- $process = $this->request["process"];
|
|
|
- $obj = TalentAllowanceApi::getInfoById($id);
|
|
|
- $this->translateToChinese($obj);
|
|
|
- if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
|
|
|
- $need_choose_post_type = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_post_type");
|
|
|
- $need_choose_institution = getJsonConfig("../sys_config.json", "talent_allowance_need_choose_institution");
|
|
|
- if ($need_choose_post_type[$obj["enterpriseId"]]) {
|
|
|
- $postTypes = DictApi::findChildDictByCode("PostType");
|
|
|
- foreach ($postTypes as $key => $pt) {
|
|
|
- if (!in_array($pt["code"], $need_choose_post_type[$obj["enterpriseId"]])) {
|
|
|
- unset($postTypes[$key]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (in_array($obj["enterpriseId"], $need_choose_institution)) {
|
|
|
- $institutions = DictApi::findChildDictByCode("Institution");
|
|
|
- }
|
|
|
- }
|
|
|
- return view("select", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 审核保存
|
|
|
*/
|
|
@@ -601,16 +574,16 @@ class House extends AdminController {
|
|
|
$ids_arr = array_filter(explode(",", $ids));
|
|
|
if (!$ids_arr) {
|
|
|
$response->msg = "没有选择导出的名单";
|
|
|
- return \StrUtil::back($response, "TalentAllowanceInfo.hczxCallBack");
|
|
|
+ return \StrUtil::back($response, "Housepurchase.callBack");
|
|
|
}
|
|
|
$where = [];
|
|
|
$where[] = ["id", "in", $ids_arr];
|
|
|
- $list = TaModel::field("id,cardType,idCard,name,enterpriseId,year")->where($where)->select()->toArray();
|
|
|
+ $list = houseModel::field("id,cardType,idCard,name,enterpriseId,year")->where($where)->select()->toArray();
|
|
|
if (!$list) {
|
|
|
$response->msg = "暂无可核查征信的数据";
|
|
|
- return \StrUtil::back($response, "TalentAllowanceInfo.hczxCallBack");
|
|
|
+ return \StrUtil::back($response, "Housepurchase.callBack");
|
|
|
}
|
|
|
- $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "备注"];
|
|
|
+ $columns = ["序号", "姓名", "证件类型", "证件号码", "工作单位", "年度"];
|
|
|
|
|
|
$enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
|
|
|
$cardTypeName = DictApi::selectByParentCode("card_type");
|
|
@@ -618,17 +591,17 @@ class House extends AdminController {
|
|
|
for ($i = 0; $i < count($list); $i++) {
|
|
|
$item = $list[$i];
|
|
|
$row = [
|
|
|
- $i + 1, $item["name"], $cardTypeName[$item["cardType"]], $item["idCard"], $enterpriseMap[$item["enterpriseId"]], $item["description"]
|
|
|
+ $i + 1, $item["name"], $cardTypeName[$item["cardType"]], $item["idCard"], $enterpriseMap[$item["enterpriseId"]], $item["year"]
|
|
|
];
|
|
|
$rows[] = $row;
|
|
|
}
|
|
|
- $filename = "津补贴待核查征信名单导出";
|
|
|
+ $filename = "购房补贴待核查征信名单导出";
|
|
|
if ($rows) {
|
|
|
export($columns, $rows, $filename);
|
|
|
exit();
|
|
|
} else {
|
|
|
$response->msg = "没有选择导出的名单";
|
|
|
- return \StrUtil::back($response, "TalentTypeChange.callBack");
|
|
|
+ return \StrUtil::back($response, "Housepurchase.callBack");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -680,31 +653,38 @@ class House extends AdminController {
|
|
|
}
|
|
|
$where = [];
|
|
|
$where[] = ["id", "in", $ids];
|
|
|
- $list = TaModel::where($where)->select()->toArray();
|
|
|
+ $list = houseModel::where($where)->select()->toArray();
|
|
|
$logList = [];
|
|
|
$upds = [];
|
|
|
+ $new_ids = [];
|
|
|
foreach ($list as $obj) {
|
|
|
- $upds[] = [
|
|
|
- "id" => $obj["id"],
|
|
|
- "publicState" => 2,
|
|
|
- ];
|
|
|
- $logList[] = [
|
|
|
- "id" => getStringId(),
|
|
|
- "type" => ProjectState::JBT,
|
|
|
- "mainId" => $obj["id"],
|
|
|
- "active" => 1,
|
|
|
- "state" => 3,
|
|
|
- "step" => 4,
|
|
|
- "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"])
|
|
|
- ];
|
|
|
+ if ($obj["checkState"] == HouseStateEnum::REVIEW_PASS && $obj["publicState"] == 1) {
|
|
|
+ $new_ids[] = $obj["id"];
|
|
|
+ $logList[] = [
|
|
|
+ "id" => getStringId(),
|
|
|
+ "type" => ProjectState::HOUSE,
|
|
|
+ "mainId" => $obj["id"],
|
|
|
+ "active" => 1,
|
|
|
+ "state" => 3,
|
|
|
+ "step" => 4,
|
|
|
+ "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"])
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $upd = [
|
|
|
+ "publicState" => 2,
|
|
|
+ ];
|
|
|
+ if ($new_ids) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["id", "in", $new_ids];
|
|
|
+ houseModel::where($where)->update($upd);
|
|
|
+ Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
+ return new Response(Response::SUCCESS, "核查征信通过成功");
|
|
|
}
|
|
|
- $taModel = new TaModel();
|
|
|
- $taModel->saveAll($upds);
|
|
|
- Db::table("new_talent_checklog")->insertAll($logList);
|
|
|
- return new Response(Response::SUCCESS, "核查征信通过成功");
|
|
|
+ return new Response(Response::ERROR, "没有待核查的列表");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -728,35 +708,44 @@ class House extends AdminController {
|
|
|
try {
|
|
|
$logList = [];
|
|
|
$phones = [];
|
|
|
+ $newIds = [];
|
|
|
foreach ($list as $info) {
|
|
|
- /* * 添加日志 */
|
|
|
- $logList[] = [
|
|
|
- "id" => getStringId(),
|
|
|
- "type" => ProjectState::HOUSE,
|
|
|
- "mainId" => $info["id"],
|
|
|
- "active" => 1,
|
|
|
- "state" => 3,
|
|
|
- "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"])
|
|
|
- ];
|
|
|
- $phones[] = $info["phone"];
|
|
|
+ if ($info["checkState"] == HouseStateEnum::REVIEW_PASS && $info["publicState"] == 2) {
|
|
|
+ /* * 添加日志 */
|
|
|
+ $newIds[] = $info["id"];
|
|
|
+ $logList[] = [
|
|
|
+ "id" => getStringId(),
|
|
|
+ "type" => ProjectState::HOUSE,
|
|
|
+ "mainId" => $info["id"],
|
|
|
+ "active" => 1,
|
|
|
+ "state" => 3,
|
|
|
+ "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"])
|
|
|
+ ];
|
|
|
+ $phones[] = $info["phone"];
|
|
|
+ }
|
|
|
}
|
|
|
- $data["publicState"] = 3;
|
|
|
- Db::table("un_housepurchase")->where($where)->update($data);
|
|
|
- $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"]);
|
|
|
- $phones = array_filter($phones);
|
|
|
- foreach ($phones as $phone) {
|
|
|
- queue("app\job\Messenger", ["type" => 6, "userId" => 0, "phone" => $phone, "template" => $tpl_content, "processName" => "购房补贴-批量公示", "userType" => 3]);
|
|
|
+ if ($newIds) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["id", "in", $newIds];
|
|
|
+ $data["publicState"] = 3;
|
|
|
+ Db::table("un_housepurchase")->where($where)->update($data);
|
|
|
+ $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"]);
|
|
|
+ $phones = array_filter($phones);
|
|
|
+ foreach ($phones as $phone) {
|
|
|
+ queue("app\job\Messenger", ["type" => 6, "userId" => 0, "phone" => $phone, "template" => $tpl_content, "processName" => "购房补贴-批量公示", "userType" => 3]);
|
|
|
+ }
|
|
|
}
|
|
|
+ return new Response(Response::SUCCESS, "公示成功");
|
|
|
}
|
|
|
- return new Response(Response::SUCCESS, "公示成功");
|
|
|
+ return new Response(Response::ERROR, "没有待公示的列表");
|
|
|
} catch (\think\db\exception\DbException $e) {
|
|
|
Db::rollback();
|
|
|
return new Response(Response::SUCCESS, "公示失败:" . $e->getMessage());
|
|
@@ -1118,7 +1107,7 @@ class House extends AdminController {
|
|
|
$enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
|
|
|
$levelMap = DictApi::selectByParentCode("talent_arrange");
|
|
|
$year = $list[0]["year"];
|
|
|
- foreach ($list as $key => $obj) {
|
|
|
+ foreach ($list as $key => &$obj) {
|
|
|
$obj["talentArrangeName"] = $levelMap[$obj["talentArrange"]];
|
|
|
$obj["enterpriseName"] = $enterpriseMap[$obj["enterpriseId"]];
|
|
|
$obj["sn"] = $key + 1;
|
|
@@ -1126,16 +1115,17 @@ class House extends AdminController {
|
|
|
$obj["declareTypeName"] = "购房补贴";
|
|
|
$otherHouses = $otherMap[$obj["id"]];
|
|
|
$desc = [];
|
|
|
- foreach ($otherHouses as $house) {
|
|
|
- $desc[] = $house["enjoyPolicyName"];
|
|
|
+ if ($otherHouses) {
|
|
|
+ foreach ($otherHouses as $house) {
|
|
|
+ $desc[] = $house["enjoyPolicyName"];
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- $obj["description"] = $desc = "扣除已享受" . implode(";\n", $desc) . "部分";
|
|
|
+ $obj["description"] = $desc ? "扣除已享受" . implode(";\n", $desc) . "部分" : "";
|
|
|
} else if ($obj["declareType"] == 2) {
|
|
|
$obj["declareTypeName"] = "免租入住";
|
|
|
$obj["description"] = $year . "年度取得免租入住资格";
|
|
|
}
|
|
|
- }
|
|
|
+ }unset($obj);
|
|
|
$userTypeName = CommonConst::getTypeName($this->user["type"]);
|
|
|
if ($type == 1) {
|
|
|
//兑现
|