House.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <?php
  2. namespace app\enterprise\controller;
  3. use app\enterprise\common\EnterpriseController;
  4. use think\facade\Db;
  5. use think\facade\Log;
  6. use app\common\api\EnterpriseApi;
  7. use app\common\api\TalentLogApi;
  8. use think\exception\ValidateException;
  9. use app\common\state\ProjectState;
  10. use app\common\api\BatchApi;
  11. use app\common\api\HouseApi;
  12. use app\common\model\TalentLog;
  13. use app\common\api\DictApi;
  14. use app\common\state\CommonConst;
  15. use app\common\state\MainState;
  16. use app\common\api\Response;
  17. use app\common\model\HousePurchase as houseModel;
  18. /**
  19. * Description of House
  20. * 购房补贴
  21. * @author sgq
  22. */
  23. class House extends EnterpriseController {
  24. public function index() {
  25. return view("", ['type' => session("user")['type']]);
  26. }
  27. public function list() {
  28. $params = $this->request;
  29. $order = trim($params["order"]) ?: "desc";
  30. $offset = trim($params["offset"]) ?: 0;
  31. $limit = trim($params["limit"]) ?: 10;
  32. $where = [];
  33. $where[] = ["type", "=", $this->user["type"]];
  34. $where[] = ["enterpriseId", "=", $this->user["uid"]];
  35. $where[] = ["delete", "=", 0];
  36. if ($params["year"]) {
  37. $where[] = ["year", "=", $params["year"]];
  38. }
  39. if (\StrUtil::isNotEmpAndNull($params["name"])) {
  40. $where[] = ["name", "like", "%" . $params["name"] . "%"];
  41. }
  42. if (\StrUtil::isNotEmpAndNull($params["idCard"])) {
  43. $where[] = ["idCard", "like", "%" . $params["idCard"] . "%"];
  44. }
  45. if ($params["talentArrange"]) {
  46. $where[] = ["talentArrange", "=", $params["talentArrange"]];
  47. }
  48. if (\StrUtil::isNotEmpAndNull($params["spouseName"])) {
  49. $where[] = ["spouseName", "like", "%" . $params["spouseName"] . "%"];
  50. }
  51. if (\StrUtil::isNotEmpAndNull($params["spouseIdcard"])) {
  52. $where[] = ["spouseIdcard", "like", "%" . $params["spouseIdcard"] . "%"];
  53. }
  54. if (\StrUtil::isNotEmpAndNull($params["childName"])) {
  55. $where[] = ["childName", "like", "%" . $params["childName"] . "%"];
  56. }
  57. if (\StrUtil::isNotEmpAndNull($params["childIdCard"])) {
  58. $where[] = ["childIdCard", "like", "%" . $params["childIdCard"] . "%"];
  59. }
  60. if ($params["marryStatus"]) {
  61. $where[] = ["marryStatus", "=", $params["marryStatus"]];
  62. }
  63. $count = houseModel::where($where)->count();
  64. $list = houseModel::where($where)->limit($offset, $limit)->order("createTime $order")->select()->toArray();
  65. //获取字典表婚姻状态
  66. $marryMap = DictApi::selectByParentCode("marry_status");
  67. $cardTypeMap = DictApi::selectByParentCode("card_type");
  68. $streetMap = DictApi::selectByParentCode("street");
  69. $levelMap = DictApi::selectByParentCode("talent_arrange");
  70. $whrCondition = [];
  71. $whrCondition[] = ["type", "=", $this->user["type"]];
  72. $conditionMap = \app\common\model\TalentCondition::where($whrCondition)->column("name", "id");
  73. foreach ($list as &$item) {
  74. $item["marryStatusName"] = $marryMap[$item["marryStatus"]];
  75. $item["cardTypeName"] = $cardTypeMap[$item["cardType"]];
  76. $item["spouseCardTypeName"] = $cardTypeMap[$item["spouseCardType"]];
  77. $item["childCardTypeName"] = $cardTypeMap[$item["childCardType"]];
  78. $item["streetName"] = $streetMap[$item["street"]];
  79. $item["talentArrangeName"] = $levelMap[$item["talentArrange"]];
  80. $item["identifyConditionCH"] = $conditionMap[$item["identifyCondition"]];
  81. }unset($item);
  82. return json(["rows" => $list, "total" => $count]);
  83. }
  84. /**
  85. * 申请
  86. */
  87. public function apply(\think\Request $request) {
  88. $param = $request->param();
  89. $id = isset($param["id"]) ? $param["id"] : 0;
  90. $vars = [];
  91. if ($id) {
  92. $info = HouseApi::getInfoById($id);
  93. $childrenList = HouseApi::getChildren($id);
  94. $houseInfo = HouseApi::getHouseInfo($info["idCard"]);
  95. $dicts = DictApi::findChildDictByCode("card_type");
  96. $vars["dicts"] = $dicts;
  97. $vars["row"] = $info;
  98. $vars["hand"] = $houseInfo ? 2 : 1;
  99. $vars["childrenList"] = $childrenList;
  100. }
  101. if ($request->isPost()) {
  102. return $this->save($info, $request);
  103. }
  104. $batch = $info["year"] ?: BatchApi::getValidBatch(ProjectState::HOUSE, $this->user["type"])["batch"];
  105. $vars["year"] = $batch;
  106. $vars["type"] = $this->user["type"];
  107. return view("", $vars);
  108. }
  109. public function detail(\think\Request $request) {
  110. $id = $this->request["id"];
  111. $info = HouseApi::getInfoById($id);
  112. $childrenList = HouseApi::getChildren($id);
  113. $dicts = DictApi::findChildDictByCode("card_type");
  114. $vars["dicts"] = $dicts;
  115. $vars["row"] = $info;
  116. $vars["childrenList"] = $childrenList;
  117. $vars["type"] = $this->user["type"];
  118. return view("", $vars);
  119. }
  120. /**
  121. * 提交表单
  122. */
  123. public function submitToCheck() {
  124. try {
  125. $id = $this->request["id"];
  126. $info = HouseApi::getInfoById($id);
  127. if (!$info) {
  128. throw new ValidateException("提交审核失败,请先填写基础信息");
  129. }
  130. if ($info["enterpriseId"] != $this->user["uid"]) {
  131. throw new ValidateException("没有对应的人才认定申报信息");
  132. }
  133. $batch = BatchApi::checkBatchValid(["type" => ProjectState::HOUSE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
  134. if ($batch["code"] != 200) {
  135. throw new ValidateException($batch["msg"]);
  136. }
  137. $response = $this->validateIsEdit($info["checkState"]);
  138. if ($response->code != 200) {
  139. throw new ValidateException($response->msg);
  140. }
  141. validate(\app\enterprise\validate\HouseValidator::class)->check($info);
  142. $response = $this->other_validate($info, 2);
  143. if ($response->code != 200) {
  144. throw new ValidateException($response->msg);
  145. }
  146. $where = [];
  147. $where[] = ["mainId", "=", $id];
  148. $where[] = ["type", "=", ProjectState::HOUSE];
  149. $uploadedFileTypes = Db::table("new_talent_file")->where($where)->column("distinct typeId");
  150. $where = [];
  151. $where[] = ["project", "=", ProjectState::HOUSE];
  152. $where[] = ["type", "=", $this->user["type"]];
  153. $where[] = ["must", "=", 1];
  154. $where[] = ["active", "=", 1];
  155. $where[] = ["delete", "=", 0];
  156. $where[] = ["id", "not in", $uploadedFileTypes];
  157. $unUploadfiletypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
  158. if ($unUploadfiletypes) {
  159. $msg = "以下附件为必传:<br>";
  160. foreach ($unUploadfiletypes as $ft) {
  161. $msg .= "<span style='color:red;'>*</span>" . $ft["name"] . "<br>";
  162. }
  163. throw new ValidateException($msg);
  164. }
  165. $data["id"] = $id;
  166. $data["checkState"] = LaState::LA_NEED_FIRST_CHECK;
  167. if (!$info["firstSubmitTime"]) {
  168. $data["firstSubmitTime"] = date("Y-m-d H:i:s");
  169. }
  170. $data["newSubmitTime"] = date("Y-m-d H:i:s");
  171. $data["checkMsg"] = "";
  172. $data["files"] = "";
  173. $data["fields"] = "";
  174. $res = LaModel::update($data);
  175. if ($res) {
  176. $user = session("user");
  177. $log["id"] = getStringId();
  178. $log["active"] = 1;
  179. $log["state"] = 1;
  180. $log["step"] = 0;
  181. $log["stateChange"] = LaState::getStateDesc($info["checkState"]) . "->" . LaState::getStateDesc($data["checkState"]);
  182. $log["type"] = ProjectState::LIVINGALLOWANCE;
  183. $log["mainId"] = $id;
  184. $log["description"] = "确认提交审核";
  185. $log["createUser"] = $user ? sprintf("%s(%s)", $user["account"], $user["companyName"] ?: $user["rolename"]) : "系统";
  186. $log["createTime"] = date("Y-m-d H:i:s");
  187. TalentLog::create($log);
  188. return json(["code" => 200, "msg" => "提交审核成功"]);
  189. }
  190. throw new ValidateException("提交审核失败");
  191. } catch (ValidateException $e) {
  192. $responseObj = new \stdClass();
  193. $responseObj->code = 500;
  194. $responseObj->msg = $e->getMessage();
  195. return json($responseObj);
  196. } catch (\think\Exception $e) {
  197. $res = ["code" => 500, "msg" => "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()];
  198. $logInfo = [
  199. "enterprise_id" => $this->user["uid"],
  200. "data" => $data,
  201. "controller" => $this->request->controller(),
  202. "action" => $this->request->action(),
  203. "errCode" => $e->getCode(),
  204. "errMsg" => $e->getMessage()
  205. ];
  206. Log::write($logInfo, "error");
  207. return json($res);
  208. }
  209. }
  210. public function save($info, \think\Request $request) {
  211. Db::startTrans();
  212. try {
  213. $batch = BatchApi::checkBatchValid(["type" => ProjectState::HOUSE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
  214. if ($batch["code"] != 200) {
  215. throw new ValidateException($batch["msg"]);
  216. }
  217. if ($info) {
  218. $response = $this->validateIsEdit($info["checkState"]);
  219. if ($response->code != 200) {
  220. throw new ValidateException($response->msg);
  221. }
  222. }
  223. $data = $request->param();
  224. $data["year"] = $batch["batch"];
  225. $data["type"] = $this->user["type"];
  226. validate(\app\enterprise\validate\HouseValidator::class)->check($data);
  227. $response = $this->other_validate($data, $info ? 2 : 1);
  228. if ($response->code != 200) {
  229. throw new ValidateException($response->msg);
  230. }
  231. $id = $data["id"];
  232. if ($id) {
  233. if (!$info || $info["id"] != $id || $info["enterpriseId"] != $this->user["uid"]) {
  234. throw new ValidateException("没有对应的人才认定申报信息");
  235. }
  236. $data["checkState"] = $info["checkState"];
  237. $data["updateUser"] = $this->user["uid"];
  238. $data["updateTime"] = date("Y-m-d H:i:s");
  239. } else {
  240. $data["id"] = getStringId();
  241. $data["checkState"] = MainState::SAVE;
  242. $data["createUser"] = $this->user["uid"];
  243. $data["createTime"] = date("Y-m-d H:i:s");
  244. $data["enterpriseId"] = $this->user["uid"];
  245. $data["isConflict"] = 2;
  246. $data["isRecover"] = 2;
  247. $houseInfo = HouseApi::getHouseInfo($data["idCard"]);
  248. $data["number"] = !$houseInfo ? 1 : $houseInfo["count"] + 1;
  249. }
  250. $childList = $data["childList"];
  251. unset($data["jstime"]);
  252. unset($data["childList"]);
  253. if ($id) {
  254. $res = Db::table("un_housepurchase")->update($data);
  255. } else {
  256. $res = Db::table("un_housepurchase")->insert($data);
  257. }
  258. foreach ($childList as &$children) {
  259. $children["pId"] = $data["id"];
  260. if (\StrUtil::isEmpOrNull($children["id"])) {
  261. $children["id"] = getStringId();
  262. $children["createTime"] = date("Y-m-d H:i:s");
  263. Db::table("un_housepurchase_children")->insert($children);
  264. } else {
  265. $children["updateTime"] = date("Y-m-d H:i:s");
  266. $res = Db::table("un_housepurchase_children")->update($children);
  267. }
  268. }unset($children);
  269. //添加日志
  270. Db::table("new_talent_checklog")->insert([
  271. 'id' => getStringId(),
  272. 'mainId' => $data['id'],
  273. 'type' => intval(ProjectState::HOUSE),
  274. 'typeFileId' => null,
  275. 'active' => 1,
  276. 'state' => 1,
  277. 'step' => 0,
  278. 'stateChange' => "保存未提交",
  279. 'description' => "添加购房补贴申报",
  280. 'createTime' => date("Y-m-d H:i:s", time()),
  281. 'createUser' => "申报用户"
  282. ]);
  283. $data["childList"] = $childList;
  284. Db::commit();
  285. return json(new Response(Response::SUCCESS, "添加成功", $data));
  286. } catch (ValidateException $e) {
  287. Db::rollback();
  288. return json(new Response(Response::ERROR, $e->getMessage()));
  289. } catch (\think\Exception $e) {
  290. Db::rollback();
  291. $logInfo = [
  292. "enterprise_id" => $this->user["uid"],
  293. "data" => $data,
  294. "controller" => $this->request->controller(),
  295. "action" => $this->request->action(),
  296. "errCode" => $e->getCode(),
  297. "errMsg" => $e->getMessage()
  298. ];
  299. Log::write($logInfo, "error");
  300. return json(new Response(Response::ERROR, "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()));
  301. }
  302. }
  303. public function deleteChildren($id) {
  304. if (\StrUtil::isEmpOrNull($id)) {
  305. return new Response(Response::ERROR, "删除失败,系统错误");
  306. }
  307. $obj = HouseApi::getChildrenById($id);
  308. $housePurchase = HouseApi::getInfoById($obj["pId"]);
  309. if ($housePurchase["checkState"] != 1 && $housePurchase["checkState"] != 10) {
  310. return new Response(Response::ERROR, "正在审核中,无法删除");
  311. }
  312. if (HouseApi::deleteChildrenById($id)) {
  313. return new Response(Response::SUCCESS, "删除成功");
  314. }
  315. return new Response(Response::ERROR, "删除失败");
  316. }
  317. public function delete($id) {
  318. if (\StrUtil::isEmpOrNull($id)) {
  319. return new Response(Response::ERROR, "删除失败,系统错误");
  320. }
  321. $obj = HouseApi::getInfoById($id);
  322. if ($obj["checkState"] != 1) {
  323. return new Response(Response::ERROR, "已提交审核,无法删除");
  324. }
  325. if (HouseApi::deleteById($id)) {
  326. return new Response(Response::SUCCESS, "删除成功");
  327. }
  328. return new Response(Response::ERROR, "删除失败");
  329. }
  330. public function getTalentInfo($id, $year, $declareType) {
  331. $ti = \app\common\api\VerifyApi::getTalentInfoById($id);
  332. $response = $this->getTalentArrange($ti, $year);
  333. if ($response->code == 500) {
  334. return $response;
  335. }
  336. $resTalentInfo = $response->obj;
  337. $ti["talentArrange"] = $resTalentInfo["talentArrange"];
  338. $ti["identifyCondition"] = $resTalentInfo["identifyCondition"];
  339. $ti["identifyConditionName"] = $resTalentInfo["identifyConditionName"];
  340. $ti["identifyMonth"] = $resTalentInfo["identifyMonth"];
  341. $ti["identifyGetTime"] = $resTalentInfo["identifyGetTime"];
  342. $ti["certificateStartTime"] = $resTalentInfo["certificateStartTime"];
  343. $ti["certificateOutTime"] = $resTalentInfo["certificateOutTime"];
  344. //查询房产库中是否存在房产信息
  345. $houseInfo = HouseApi::getHouseInfo($ti["card_number"]);
  346. return new Response(Response::SUCCESS, "", ["talentInfo" => $ti, "houseInfo" => $houseInfo]);
  347. }
  348. private function other_validate(&$info, $type) {
  349. //校验配偶是否在库
  350. if ($info["spouseIsLibrary"] && $info["spouseIsLibrary"] == 1) {
  351. if (\StrUtil::isEmpOrNull($info["spouseIdcard"])) {
  352. return new Response(Response::ERROR, "请填写配偶证件号码");
  353. }
  354. if (\StrUtil::isEmpOrNull($info["spouseName"])) {
  355. return new Response(Response::ERROR, "请填写配偶姓名");
  356. }
  357. $where = [];
  358. $where[] = ["card_number", "=", $info["spouseIdcard"]];
  359. $where[] = ["name", "=", $info["spouseName"]];
  360. $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED];
  361. $where[] = ["isEffect", "<>", 4];
  362. $where[] = ["delete", "=", 0];
  363. $count = Db::table("new_talent_info")->where($where)->count();
  364. if ($count == 0) {
  365. return new Response(Response::ERROR, "人才库中未查询到配偶相关信息");
  366. }
  367. }
  368. $ti = \app\common\api\VerifyApi::getTalentInfoById($info["talentId"]);
  369. $info["provinceCode"] = $ti["province"];
  370. $info["provinceName"] = $ti["provinceName"];
  371. $info["cityCode"] = $ti["city"];
  372. $info["cityName"] = $ti["cityName"];
  373. $info["countyCode"] = $ti["county"];
  374. $info["countyName"] = $ti["countyName"];
  375. $info["street"] = $ti["street"];
  376. $info["bank"] = $ti["bank"];
  377. $info["bankAccount"] = $ti["bank_account"];
  378. $info["bankNetwork"] = $ti["bank_branch_name"];
  379. $info["bankNumber"] = $ti["bank_number"];
  380. /* * 校验上一年度人才层次 */
  381. if ($type == 1) {
  382. $responseObj = $this->getTalentArrange($ti, $info["year"]);
  383. if ($responseObj->code == 500) {
  384. return $responseObj;
  385. }
  386. $resInfo = $responseObj->obj;
  387. $info["talentArrange"] = $resInfo["talentArrange"];
  388. $info["identifyCondition"] = $resInfo["identifyCondition"];
  389. $info["idenfityConditionName"] = $resInfo["identifyConditionName"];
  390. $info["identifyGetTime"] = $resInfo["identifyGetTime"];
  391. //设置上一年度人才层次有效月份
  392. $info["monthCount"] = count($resInfo["monthList"]);
  393. if ($info["monthCount"] < 9) {
  394. return new Response(Response::ERROR, "申报年度人才证书有效期未满足九个月,无法申报购房补贴");
  395. }
  396. $info["talentArrangeMonths"] = implode(",", $resInfo["monthList"]);
  397. }
  398. return new Response(Response::SUCCESS, "");
  399. }
  400. private function validateIsEdit($checkState) {
  401. if ($checkState != MainState::SAVE && $checkState != MainState::FIRST_REJECT) {
  402. return new Response(Response::ERROR, "正在审核中,无法修改");
  403. }
  404. return new Response(Response::SUCCESS, "");
  405. }
  406. /**
  407. * @param talentInfo
  408. * @param year
  409. * @description 获取上一年度的人才层次,规则如下:上一年度存在多个人才层次则取占比大的人才层次,占比相同则取人才层次高者
  410. * @returns com.stylefeng.guns.core.common.model.ResponseObj
  411. * @author Liu
  412. * @date 2020/5/6
  413. * */
  414. private function getTalentArrange($talentInfo, $year) {
  415. /**
  416. * 判定在申报年度内或之前是否认定,申报年度之后认定无效,根据公布入选月份判断(此处还要考虑人才层次变更)
  417. */
  418. $year = substr($year, 0, 4);
  419. $identifyTimeField = "identifyMonth";
  420. $oldStartTimeField = "oldIdentifyMonth";
  421. $newStartTimeField = "newIdentifyMonth";
  422. if ($talentInfo["enterpriseType"] == CommonConst::ENTERPRISE_JC) {
  423. $identifyTimeField = "identifyGetTime";
  424. $oldStartTimeField = "oldIdentifyGetTime";
  425. $newStartTimeField = "newIdentifyGetTime";
  426. }
  427. $where = [];
  428. $where[] = ["idCard", "=", $talentInfo["card_number"]];
  429. $where[] = ["checkState", "=", MainState::PASS];
  430. $where[] = ["isPublic", "=", 6];
  431. $where[] = [$oldStartTimeField, "<=", $year . "-12-31"];
  432. $typeChanges = \app\enterprise\model\TalentTypeChange::where($where)->field("oldTalentArrange,oldIdentifyCondition,oldIdentifyGetTime,oldIdentifyOutTime,oldIdentifyConditionName,oldIdentifyMonth,oldCertificateStartTime,oldCertificateOutTime,newIdentifyMonth,newIdentifyGetTime")->order("createTime desc")->select()->toArray();
  433. if (!$typeChanges && strtotime($year . "-12-31") > strtotime($talentInfo[$identifyTimeField])) {
  434. return new Response(Response::ERROR, "在上一年度未认定优秀人才,无法申报");
  435. } else {
  436. $typeChanges[] = [
  437. "oldTalentArrange" => $talentInfo["talent_arrange"],
  438. "oldIdentifyCondition" => $talentInfo["talent_condition"],
  439. "oldIdentifyGetTime" => $talentInfo["identifyGetTime"],
  440. "oldIdentifyOutTime" => $talentInfo["identifyExpireTime"],
  441. "oldIdentifyConditionName" => $talentInfo["identifyConditionName"],
  442. "oldIdentifyMonth" => $talentInfo["identifyMonth"],
  443. "oldCertificateStartTime" => $talentInfo["certificateGetTime"],
  444. "oldCertificateOutTime" => $talentInfo["certificateExpireTime"] ?: date("Y-m-d", strtotime(sprintf("%s +6 years -1 days", $talentInfo["certificateGetTime"]))),
  445. "newIdentifyMonth" => ($year + 1) . "-01-01",
  446. "newIdentifyGetTime" => ($year + 1) . "-01-01"
  447. ];
  448. $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
  449. usort($typeChanges, function($a, $b) {
  450. return (int) $b["oldTalentArrange"] - (int) $a["oldTalentArrange"];
  451. });
  452. $months = []; //当年度可用月份
  453. $talentArrange = 8; //当年度最高层次
  454. $resTalentInfo = [];
  455. foreach ($typeChanges as $typeChange) {
  456. $startTime = $typeChange[$oldStartTimeField];
  457. $endTime = $typeChange[$newStartTimeField];
  458. $monthList = \DateUtil::getMonthBetweenDatesNotEnd($startTime, $endTime);
  459. $res = \DateUtil::getEveryMonthDayBetween($endTime, $endTime, $monthList);
  460. $intersectMonthList = array_intersect($totalMonth, $monthList);
  461. if (count($intersectMonthList) > 0) {
  462. if ($typeChange["oldTalentArrange"] < $talentArrange) {
  463. //按当年度最高
  464. $talentArrange = $typeChange["oldTalentArrange"];
  465. $resTalentInfo = [
  466. "talentArrange" => $typeChange["oldTalentArrange"],
  467. "identifyCondition" => $typeChange["oldIdentifyCondition"],
  468. "identifyGetTime" => $typeChange["oldIdentifyGetTime"],
  469. "identifyConditionName" => $typeChange["oldIdentifyConditionName"],
  470. "certificateStartTime" => $typeChange["oldCertificateStartTime"],
  471. "certificateOutTime" => $typeChange["oldCertificateOutTime"],
  472. "identifyMonth" => $typeChange["oldIdentifyMonth"],
  473. "dayMap" => $res
  474. ];
  475. }
  476. $months = array_unique(array_merge($months, $intersectMonthList));
  477. }
  478. }
  479. $resTalentInfo["monthList"] = $months;
  480. if (count($months) < 9) {
  481. return new Response(Response::ERROR, "申报年度人才证书有效期未满足九个月,无法申报购房补贴");
  482. }
  483. return new Response(Response::SUCCESS, "", $resTalentInfo);
  484. }
  485. }
  486. }