|
@@ -16,6 +16,7 @@ use app\common\api\DictApi;
|
|
|
use app\common\state\CommonConst;
|
|
|
use app\common\state\MainState;
|
|
|
use app\common\api\Response;
|
|
|
+use app\common\model\HousePurchase as houseModel;
|
|
|
|
|
|
/**
|
|
|
* Description of House
|
|
@@ -64,8 +65,8 @@ class House extends EnterpriseController {
|
|
|
$where[] = ["marryStatus", "=", $params["marryStatus"]];
|
|
|
}
|
|
|
|
|
|
- $count = Db::table("un_housepurchase")->where($where)->count();
|
|
|
- $list = Db::table("un_housepurchase")->where($where)->limit($offset, $limit)->order("createTime $order")->select()->toArray();
|
|
|
+ $count = houseModel::where($where)->count();
|
|
|
+ $list = houseModel::where($where)->limit($offset, $limit)->order("createTime $order")->select()->toArray();
|
|
|
//获取字典表婚姻状态
|
|
|
$marryMap = DictApi::selectByParentCode("marry_status");
|
|
|
$cardTypeMap = DictApi::selectByParentCode("card_type");
|
|
@@ -124,62 +125,65 @@ class House extends EnterpriseController {
|
|
|
return view("", $vars);
|
|
|
}
|
|
|
|
|
|
- private function other_validate($info) {
|
|
|
- $responseObj = new \stdClass();
|
|
|
-
|
|
|
- /* 校验姓名是否与人才库一致 */
|
|
|
- $where = [];
|
|
|
- $where[] = ["checkState", ">=", \app\common\api\TalentState::REVERIFY_PASS];
|
|
|
- $where[] = ["checkState", "not in", [\app\common\api\TalentState::REVERIFY_REJECT, \app\common\api\TalentState::REVERIFY_FAIL]];
|
|
|
- $where[] = ["card_number", "=", $info["idCard"]];
|
|
|
- $talentInfo = Db::table("new_talent_info")->where($where)->order("createTime desc")->find();
|
|
|
- if ($talentInfo && $talentInfo["name"] != $info["name"]) {
|
|
|
- $responseObj->msg = "该证件号码的姓名与人才库姓名不匹配!";
|
|
|
- return $responseObj;
|
|
|
- }
|
|
|
- $year = substr($info["year"], 0, 4);
|
|
|
- /* 查询当前批次审核通过的数量以及当前批次未审核完成的数量 */
|
|
|
- $where = [];
|
|
|
- $where[] = ["year", "like", "{$year}%"];
|
|
|
- $where[] = ["idCard", "=", $info["idCard"]];
|
|
|
- $where[] = ["checkState", "<>", LaState::LA_NOTPASS];
|
|
|
- if ($info["id"]) {
|
|
|
- $where[] = ["id", "<>", $info["id"]];
|
|
|
- }
|
|
|
- $nowYearApplyCount = LaModel::where($where)->count();
|
|
|
- if ($nowYearApplyCount > 0) {
|
|
|
- $responseObj->msg = "不能重复申报";
|
|
|
- return $responseObj;
|
|
|
+ private function other_validate(&$info, $type) {
|
|
|
+ //校验配偶是否在库
|
|
|
+ if ($info["spouseIsLibrary"] && $info["spouseIsLibrary"] == 1) {
|
|
|
+ if (\StrUtil::isEmpOrNull($info["spouseIdcard"])) {
|
|
|
+ return new Response(Response::ERROR, "请填写配偶证件号码");
|
|
|
+ }
|
|
|
+ if (\StrUtil::isEmpOrNull($info["spouseName"])) {
|
|
|
+ return new Response(Response::ERROR, "请填写配偶姓名");
|
|
|
+ }
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["card_number", "=", $info["spouseIdcard"]];
|
|
|
+ $where[] = ["name", "=", $info["spouseName"]];
|
|
|
+ $where[] = ["checkState", "=", \app\common\api\TalentState::CERTIFICATED];
|
|
|
+ $where[] = ["isEffect", "<>", 4];
|
|
|
+ $where[] = ["delete", "=", 0];
|
|
|
+ $count = Db::table("new_talent_info")->where($where)->count();
|
|
|
+ if ($count == 0) {
|
|
|
+ return new Response(Response::ERROR, "人才库中未查询到配偶相关信息");
|
|
|
+ }
|
|
|
}
|
|
|
- if (!$info["id"]) {
|
|
|
- $passYears = CommonLaApi::getPassYearsByIdCard($info["idCard"]);
|
|
|
- if (in_array($year, $passYears)) {
|
|
|
- return $responseObj->msg = "您今年度已经申报过了,每年度仅能享受一次生活补贴!";
|
|
|
+ $ti = \app\common\api\VerifyApi::getTalentInfoById($info["talentId"]);
|
|
|
+ $info["provinceCode"] = $ti["province"];
|
|
|
+ $info["provinceName"] = $ti["provinceName"];
|
|
|
+ $info["cityCode"] = $ti["city"];
|
|
|
+ $info["cityName"] = $ti["cityName"];
|
|
|
+ $info["countyCode"] = $ti["county"];
|
|
|
+ $info["countyName"] = $ti["countyName"];
|
|
|
+ $info["street"] = $ti["street"];
|
|
|
+ $info["bank"] = $ti["bank"];
|
|
|
+ $info["bankAccount"] = $ti["bank_account"];
|
|
|
+ $info["bankNetwork"] = $ti["bank_branch_name"];
|
|
|
+ $info["bankNumber"] = $ti["bank_number"];
|
|
|
+ /* * 校验上一年度人才层次 */
|
|
|
+ if ($type == 1) {
|
|
|
+ $responseObj = $this->getTalentArrange($ti, $info["year"]);
|
|
|
+ if ($responseObj->code == 500) {
|
|
|
+ return $responseObj;
|
|
|
}
|
|
|
-
|
|
|
- if (count($passYears) >= 3) {
|
|
|
- return $responseObj->msg = "一个人最多享受三次!";
|
|
|
+ $resInfo = $responseObj->obj;
|
|
|
+ $info["talentArrange"] = $resInfo["talentArrange"];
|
|
|
+ $info["identifyCondition"] = $resInfo["identifyCondition"];
|
|
|
+ $info["idenfityConditionName"] = $resInfo["identifyConditionName"];
|
|
|
+ $info["identifyGetTime"] = $resInfo["identifyGetTime"];
|
|
|
+
|
|
|
+ //设置上一年度人才层次有效月份
|
|
|
+ $info["monthCount"] = count($resInfo["monthList"]);
|
|
|
+ if ($info["monthCount"] < 9) {
|
|
|
+ return new Response(Response::ERROR, "申报年度人才证书有效期未满足九个月,无法申报购房补贴");
|
|
|
}
|
|
|
+ $info["talentArrangeMonths"] = implode(",", $resInfo["monthList"]);
|
|
|
}
|
|
|
- $responseObj->code = 200;
|
|
|
- return $responseObj;
|
|
|
+ return new Response(Response::SUCCESS, "");
|
|
|
}
|
|
|
|
|
|
private function validateIsEdit($checkState) {
|
|
|
- $responseObj = new \stdClass();
|
|
|
- if ($checkState != LaState::LA_SAVE && $checkState != LaState::LA_BEFORE_REJECT && $checkState != LaState::LA_FIRST_REJECT) {
|
|
|
- if ($checkState == LaState::LA_NOTPASS) {
|
|
|
- $responseObj->msg = "您的申报审核不通过,无法操作";
|
|
|
- } else if ($checkState >= LaState::LA_PASS) {
|
|
|
- $responseObj->msg = "您的申报已审核通过,无法操作";
|
|
|
- } else {
|
|
|
- $responseObj->msg = "您的申报正在审核中,请耐心等待";
|
|
|
- }
|
|
|
- $responseObj->code = 500;
|
|
|
- return $responseObj;
|
|
|
+ if ($checkState != MainState::SAVE && $checkState != MainState::FIRST_REJECT) {
|
|
|
+ return new Response(Response::ERROR, "正在审核中,无法修改");
|
|
|
}
|
|
|
- $responseObj->code = 200;
|
|
|
- return $responseObj;
|
|
|
+ return new Response(Response::SUCCESS, "");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -188,14 +192,14 @@ class House extends EnterpriseController {
|
|
|
public function submitToCheck() {
|
|
|
try {
|
|
|
$id = $this->request["id"];
|
|
|
- $info = CommonLaApi::getInfoById($id);
|
|
|
+ $info = HouseApi::getInfoById($id);
|
|
|
if (!$info) {
|
|
|
throw new ValidateException("提交审核失败,请先填写基础信息");
|
|
|
}
|
|
|
if ($info["enterpriseId"] != $this->user["uid"]) {
|
|
|
throw new ValidateException("没有对应的人才认定申报信息");
|
|
|
}
|
|
|
- $batch = BatchApi::checkBatchValid(["type" => ProjectState::LIVINGALLOWANCE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
|
|
|
+ $batch = BatchApi::checkBatchValid(["type" => ProjectState::HOUSE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
|
|
|
if ($batch["code"] != 200) {
|
|
|
throw new ValidateException($batch["msg"]);
|
|
|
}
|
|
@@ -203,19 +207,19 @@ class House extends EnterpriseController {
|
|
|
if ($response->code != 200) {
|
|
|
throw new ValidateException($response->msg);
|
|
|
}
|
|
|
- validate(LivingAllowanceValidator::class)->check($info);
|
|
|
- $response = $this->other_validate($info);
|
|
|
+ validate(\app\enterprise\validate\HouseValidator::class)->check($info);
|
|
|
+ $response = $this->other_validate($info, 2);
|
|
|
if ($response->code != 200) {
|
|
|
throw new ValidateException($response->msg);
|
|
|
}
|
|
|
|
|
|
$where = [];
|
|
|
$where[] = ["mainId", "=", $id];
|
|
|
- $where[] = ["type", "=", ProjectState::LIVINGALLOWANCE];
|
|
|
+ $where[] = ["type", "=", ProjectState::HOUSE];
|
|
|
$uploadedFileTypes = Db::table("new_talent_file")->where($where)->column("distinct typeId");
|
|
|
|
|
|
$where = [];
|
|
|
- $where[] = ["project", "=", ProjectState::LIVINGALLOWANCE];
|
|
|
+ $where[] = ["project", "=", ProjectState::HOUSE];
|
|
|
$where[] = ["type", "=", $this->user["type"]];
|
|
|
$where[] = ["must", "=", 1];
|
|
|
$where[] = ["active", "=", 1];
|
|
@@ -278,7 +282,7 @@ class House extends EnterpriseController {
|
|
|
|
|
|
public function save($info, \think\Request $request) {
|
|
|
try {
|
|
|
- $batch = BatchApi::checkBatchValid(["type" => ProjectState::LIVINGALLOWANCE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
|
|
|
+ $batch = BatchApi::checkBatchValid(["type" => ProjectState::HOUSE, "year" => $info["year"], "first_submit_time" => $info["firstSubmitTime"]], $this->user["type"]);
|
|
|
|
|
|
if ($batch["code"] != 200) {
|
|
|
throw new ValidateException($batch["msg"]);
|
|
@@ -291,9 +295,10 @@ class House extends EnterpriseController {
|
|
|
}
|
|
|
$data = $request->param();
|
|
|
$data["year"] = $batch["batch"];
|
|
|
- validate(LivingAllowanceValidator::class)->check($data);
|
|
|
+ $data["type"] = $this->user["type"];
|
|
|
+ validate(\app\enterprise\validate\HouseValidator::class)->check($data);
|
|
|
|
|
|
- $response = $this->other_validate($data);
|
|
|
+ $response = $this->other_validate($data, $info ? 2 : 1);
|
|
|
if ($response->code != 200) {
|
|
|
throw new ValidateException($response->msg);
|
|
|
}
|
|
@@ -306,75 +311,54 @@ class House extends EnterpriseController {
|
|
|
$data["checkState"] = $info["checkState"];
|
|
|
} else {
|
|
|
$data["id"] = getStringId();
|
|
|
- $data["active"] = 1;
|
|
|
- $data["checkState"] = LaState::LA_SAVE;
|
|
|
- $data["isPublic"] = 1;
|
|
|
- $data["recommendIsPay"] = 0;
|
|
|
- $data["isPay"] = 0;
|
|
|
- $data["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ $data["checkState"] = MainState::SAVE;
|
|
|
$data["createUser"] = $this->user["uid"];
|
|
|
- $data["creditStatus"] = 1;
|
|
|
- $count = count(CommonLaApi::getPassYearsByIdCard($data["idCard"]));
|
|
|
- $data["applyCount"] = $count + 1;
|
|
|
- if ($data["applyCount"] > 1 && !$data["personalTax"]) {
|
|
|
- throw new ValidateException("非首年申报必须填写个税缴交情况!");
|
|
|
- }
|
|
|
- }
|
|
|
- $checkState = $data["checkState"];
|
|
|
- $data["photo"] = $info["photo"];
|
|
|
- if ($request->file()) {
|
|
|
- $headimg = $request->file("file");
|
|
|
- $upload = new \app\common\api\UploadApi();
|
|
|
- $result = $upload->uploadOne($headimg, "image", "talent/photo");
|
|
|
- if ($result->code != 200) {
|
|
|
- throw new ValidateException($result->msg);
|
|
|
- }
|
|
|
- $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
|
|
|
- $width = imagesx($file);
|
|
|
- $height = imagesy($file);
|
|
|
- //免冠二寸照长宽413:579
|
|
|
- if ($width * 579 != $height * 413) {
|
|
|
- @unlink("storage/" . $result->filepath); //像素不符合,删除上传文件
|
|
|
- throw new ValidateException("近期免冠半身彩照(二寸)不符合二寸像素标准。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
|
|
|
- }
|
|
|
- if ($info && $info["photo"]) {
|
|
|
- //如果新照片符合像素要求,则删除旧照片
|
|
|
- $old_head_url = "storage/" . $info["photo"];
|
|
|
- if (file_exists($old_head_url))
|
|
|
- @unlink($old_head_url);
|
|
|
- }
|
|
|
- $data["photo"] = $result->filepath;
|
|
|
- }
|
|
|
- if (!$data["photo"])
|
|
|
- throw new ValidateException("请上传头像。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
|
|
|
-
|
|
|
+ $data["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ $data["enterpriseId"] = $this->user["uid"];
|
|
|
+ $data["isConflict"] = 2;
|
|
|
+ $data["isRecover"] = 2;
|
|
|
|
|
|
- if ($info["checkState"] == LaState::LA_FIRST_REJECT) {
|
|
|
- //驳回,需要判断什么字段可以提交
|
|
|
- $modify_fields = array_filter(explode(",", $info["fields"]));
|
|
|
- $tmp_data = $data;
|
|
|
- $data = [];
|
|
|
- foreach ($modify_fields as $field) {
|
|
|
- $data[$field] = $tmp_data[$field];
|
|
|
- }
|
|
|
- $data["id"] = $id;
|
|
|
+ $houseInfo = HouseApi::getHouseInfo($data["idCard"]);
|
|
|
+ $data["number"] = !$houseInfo ? 1 : $houseInfo["count"] + 1;
|
|
|
}
|
|
|
+ $childList = $data["childList"];
|
|
|
+ unset($data["jstime"]);
|
|
|
+ unset($data["childList"]);
|
|
|
if ($id) {
|
|
|
- $res = LaModel::update($data);
|
|
|
+ $res = houseModel::update($data);
|
|
|
} else {
|
|
|
- $res = LaModel::insertGetId($data);
|
|
|
+ $res = houseModel::insertGetId($data);
|
|
|
}
|
|
|
- if ($res) {
|
|
|
- return json(["code" => 200, "msg" => "保存成功", "obj" => ["id" => $data["id"], "checkState" => $checkState]]);
|
|
|
+ foreach ($childList as &$children) {
|
|
|
+ $children["pId"] = $data["id"];
|
|
|
+ if (\StrUtil::isEmpOrNull($children["id"])) {
|
|
|
+ $children["id"] = getStringId();
|
|
|
+ $children["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ } else {
|
|
|
+ $children["updateTime"] = date("Y-m-d H:i:s");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($childList) {
|
|
|
+ \app\common\model\HousePurchaseChildren::insertAll($childList);
|
|
|
}
|
|
|
- throw new ValidateException("保存失败");
|
|
|
+ //添加日志
|
|
|
+ \app\common\model\TalentChecklog::create([
|
|
|
+ 'id' => getStringId(),
|
|
|
+ 'mainId' => $data['id'],
|
|
|
+ 'type' => intval(ProjectState::HOUSE),
|
|
|
+ 'typeFileId' => null,
|
|
|
+ 'active' => 1,
|
|
|
+ 'state' => 1,
|
|
|
+ 'step' => 0,
|
|
|
+ 'stateChange' => "保存未提交",
|
|
|
+ 'description' => "添加购房补贴申报",
|
|
|
+ 'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
+ 'createUser' => "申报用户"
|
|
|
+ ]);
|
|
|
+ return json(new Response(Response::SUCCESS, "添加成功", $data));
|
|
|
} catch (ValidateException $e) {
|
|
|
- $responseObj = new \stdClass();
|
|
|
- $responseObj->code = 500;
|
|
|
- $responseObj->msg = $e->getMessage();
|
|
|
- return json($responseObj);
|
|
|
+ return json(new Response(Response::ERROR, $e->getMessage()));
|
|
|
} catch (\think\Exception $e) {
|
|
|
- $res = ["code" => 500, "msg" => "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()];
|
|
|
$logInfo = [
|
|
|
"enterprise_id" => $this->user["uid"],
|
|
|
"data" => $data,
|
|
@@ -384,7 +368,7 @@ class House extends EnterpriseController {
|
|
|
"errMsg" => $e->getMessage()
|
|
|
];
|
|
|
Log::write($logInfo, "error");
|
|
|
- return json($res);
|
|
|
+ return json(new Response(Response::ERROR, "发生预料外错误,请联系管理员处理,错误代码:" . $e->getCode()));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -417,37 +401,21 @@ class House extends EnterpriseController {
|
|
|
|
|
|
public function getTalentInfo($id, $year, $declareType) {
|
|
|
$ti = \app\common\api\VerifyApi::getTalentInfoById($id);
|
|
|
- if ($ti["enterpriseType"] == CommonConst::ENTERPRISE_NORMAL) {
|
|
|
- $response = $this->getTalentArrange($ti, $year);
|
|
|
- if ($response->code == 500) {
|
|
|
- return $response;
|
|
|
- }
|
|
|
- }
|
|
|
- if (en . getType() == 1) {
|
|
|
- /* List<String> totalMonth = DateUtil.getMonthBetweenDates(year + "-01-01", year + "-12-31");
|
|
|
- TalentInfo resInfo = (TalentInfo) responseObj.getObj();
|
|
|
- ti.setTalentArrange(resInfo.getTalentArrange());
|
|
|
- ti.setIdentifyCondition(resInfo.getIdentifyCondition());
|
|
|
- ti.setIdentifyConditionName(resInfo.getIdentifyConditionName());
|
|
|
- ti.setIdentifyGetTime(resInfo.getIdentifyGetTime());
|
|
|
- ti.setCertificateStartTime(resInfo.getCertificateStartTime());
|
|
|
- ti.setQzgccrcActiveTime(resInfo.getQzgccrcActiveTime());
|
|
|
- /**校验上一年度人才标签 */
|
|
|
- /* responseObj = getTalentType(ti, declareType);
|
|
|
- if (responseObj.getCode() == 500) {
|
|
|
- return responseObj;
|
|
|
- }
|
|
|
- TalentQuit resQuit = (TalentQuit) responseObj.getObj();
|
|
|
- ti.setTalentType(resQuit.getTalentType()); */
|
|
|
+ $response = $this->getTalentArrange($ti, $year);
|
|
|
+ if ($response->code == 500) {
|
|
|
+ return $response;
|
|
|
}
|
|
|
+ $resTalentInfo = $response->obj;
|
|
|
+ $ti["talentArrange"] = $resTalentInfo["talentArrange"];
|
|
|
+ $ti["identifyCondition"] = $resTalentInfo["identifyCondition"];
|
|
|
+ $ti["identifyConditionName"] = $resTalentInfo["identifyConditionName"];
|
|
|
+ $ti["identifyMonth"] = $resTalentInfo["identifyMonth"];
|
|
|
+ $ti["identifyGetTime"] = $resTalentInfo["identifyGetTime"];
|
|
|
+ $ti["certificateStartTime"] = $resTalentInfo["certificateStartTime"];
|
|
|
+ $ti["certificateOutTime"] = $resTalentInfo["certificateOutTime"];
|
|
|
//查询房产库中是否存在房产信息
|
|
|
- /* Housepurchase housepurchase = new Housepurchase();
|
|
|
- housepurchase.setIdCard(ti.getIdCard());
|
|
|
- HousepurchaseHouseInfo houseInfo = HousepurchaseUtil.getHouseInfo(housepurchase.getIdCard());
|
|
|
- Map<String, Object> res = new HashMap<>();
|
|
|
- res.put("talentInfo", ti);
|
|
|
- res.put("houseInfo", houseInfo);
|
|
|
- return new ResponseObj(ResponseObj.SUCCESS, "", res); */
|
|
|
+ $houseInfo = HouseApi::getHouseInfo($ti["card_number"]);
|
|
|
+ return new Response(Response::SUCCESS, "", ["talentInfo" => $ti, "houseInfo" => $houseInfo]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -477,10 +445,8 @@ class House extends EnterpriseController {
|
|
|
$where[] = ["checkState", "=", MainState::PASS];
|
|
|
$where[] = ["isPublic", "=", 6];
|
|
|
$where[] = [$oldStartTimeField, "<=", $year . "-12-31"];
|
|
|
- $typeChanges = TalentTypeChange::where($where)->field("oldTalentArrange,oldIdentifyCondition,oldIdentifyGetTime,oldIdentifyOutTime,oldIdentifyConditionName,oldIdentifyMonth,oldCertificateStartTime,oldCertificateOutTime,newIdentifyMonth,newIdentifyGetTime")->order("createTime desc")->select()->toArray();
|
|
|
- $jjList = [];
|
|
|
- $unionList = [];
|
|
|
- $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
|
|
|
+ $typeChanges = \app\enterprise\model\TalentTypeChange::where($where)->field("oldTalentArrange,oldIdentifyCondition,oldIdentifyGetTime,oldIdentifyOutTime,oldIdentifyConditionName,oldIdentifyMonth,oldCertificateStartTime,oldCertificateOutTime,newIdentifyMonth,newIdentifyGetTime")->order("createTime desc")->select()->toArray();
|
|
|
+
|
|
|
if (!$typeChanges && strtotime($year . "-12-31") > strtotime($talentInfo[$identifyTimeField])) {
|
|
|
return new Response(Response::ERROR, "在上一年度未认定优秀人才,无法申报");
|
|
|
} else {
|
|
@@ -496,23 +462,42 @@ class House extends EnterpriseController {
|
|
|
"newIdentifyMonth" => ($year + 1) . "-01-01",
|
|
|
"newIdentifyGetTime" => ($year + 1) . "-01-01"
|
|
|
];
|
|
|
+ $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
|
|
|
+ usort($typeChanges, function($a, $b) {
|
|
|
+ return (int) $b["oldTalentArrange"] - (int) $a["oldTalentArrange"];
|
|
|
+ });
|
|
|
+ $months = []; //当年度可用月份
|
|
|
+ $talentArrange = 8; //当年度最高层次
|
|
|
+ $resTalentInfo = [];
|
|
|
foreach ($typeChanges as $typeChange) {
|
|
|
- $monthList = \DateUtil::getMonthBetweenDatesNotEnd($typeChange["oldCertificateStartTime"], $typeChange["oldCertificateOutTime"]);
|
|
|
- $res = \DateUtil::getEveryMonthDayBetween($typeChange["oldCertificateStartTime"], $typeChange["oldCertificateOutTime"], $monthList);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- for (TalentTypeChange typeChange : typeChanges) {
|
|
|
- List<String> monthList = DateUtil . getMonthBetweenDatesNotEnd(typeChange . getOldCertificateStartTime(), typeChange . getOldCertificateOutTime());
|
|
|
- Map<String, Integer> res = DateUtil . getEveryMonthDayBetween(typeChange . getOldCertificateStartTime(), typeChange . getOldCertificateOutTime(), monthList);
|
|
|
- if (res . size() > 0) {
|
|
|
- unionList . removeAll(monthList);
|
|
|
- unionList . addAll(monthList);
|
|
|
- TalentInfo info = new TalentInfo(typeChange . getOldTalentArrange(), typeChange . getOldIdentifyCondition(), typeChange . getOldIdentifyGetTime(), typeChange . getOldIdentifyConditionName(), typeChange . getOldCertificateStartTime(), typeChange . getOldCertificateOutTime(), typeChange . getOldIdentifyMonth());
|
|
|
- info . setDayMap(res);
|
|
|
- jjList . add(info);
|
|
|
+ $startTime = $typeChange[$oldStartTimeField];
|
|
|
+ $endTime = $typeChange[$newStartTimeField];
|
|
|
+ $monthList = \DateUtil::getMonthBetweenDatesNotEnd($startTime, $endTime);
|
|
|
+ $res = \DateUtil::getEveryMonthDayBetween($endTime, $endTime, $monthList);
|
|
|
+ $intersectMonthList = array_intersect($totalMonth, $monthList);
|
|
|
+ if (count($intersectMonthList) > 0) {
|
|
|
+ if ($typeChange["oldTalentArrange"] < $talentArrange) {
|
|
|
+ //按当年度最高
|
|
|
+ $talentArrange = $typeChange["oldTalentArrange"];
|
|
|
+ $resTalentInfo = [
|
|
|
+ "talentArrange" => $typeChange["oldTalentArrange"],
|
|
|
+ "identifyCondition" => $typeChange["oldIdentifyCondition"],
|
|
|
+ "identifyGetTime" => $typeChange["oldIdentifyGetTime"],
|
|
|
+ "identifyConditionName" => $typeChange["oldIdentifyConditionName"],
|
|
|
+ "certificateStartTime" => $typeChange["oldCertificateStartTime"],
|
|
|
+ "certificateOutTime" => $typeChange["oldCertificateOutTime"],
|
|
|
+ "identifyMonth" => $typeChange["oldIdentifyMonth"],
|
|
|
+ "dayMap" => $res
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $months = array_unique(array_merge($months, $intersectMonthList));
|
|
|
}
|
|
|
}
|
|
|
+ $resTalentInfo["monthList"] = $months;
|
|
|
+ if (count($months) < 9) {
|
|
|
+ return new Response(Response::ERROR, "申报年度人才证书有效期未满足九个月,无法申报购房补贴");
|
|
|
+ }
|
|
|
+ return new Response(Response::SUCCESS, "", $resTalentInfo);
|
|
|
}
|
|
|
}
|
|
|
|