|
@@ -229,8 +229,8 @@ class House extends AdminController {
|
|
|
"checkIsTradeRecord" => \StrUtil::getRequestDecodeParam($this->request, "checkIsTradeRecord"),
|
|
|
"checkRecordTime" => \StrUtil::getRequestDecodeParam($this->request, "checkRecordTime"),
|
|
|
"zjjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "zjjCheckDetail"),
|
|
|
- "otherList" => \StrUtil::getRequestDecodeParam($this->request, "otherList"),
|
|
|
- "houseList" => \StrUtil::getRequestDecodeParam($this->request, "houseList")
|
|
|
+ "otherList" => $this->request["otherList"],
|
|
|
+ "houseList" => $this->request["houseList"]
|
|
|
];
|
|
|
if (!$obj) {
|
|
|
return new Response(Response::ERROR, "请填写信息后保存");
|
|
@@ -301,7 +301,7 @@ class House extends AdminController {
|
|
|
'state' => 3,
|
|
|
'step' => 2,
|
|
|
'stateChange' => "保存未提交",
|
|
|
- 'description' => "录入核查数据",
|
|
|
+ 'description' => $obj["zjjCheckDetail"] ? "录入核查数据:" . $obj["zjjCheckDetail"] : "录入核查数据:",
|
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
|
]);
|
|
@@ -322,7 +322,7 @@ class House extends AdminController {
|
|
|
"transferMethod" => \StrUtil::getRequestDecodeParam($this->request, "transferMethod"),
|
|
|
"transferTime" => \StrUtil::getRequestDecodeParam($this->request, "transferTime"),
|
|
|
"zrzzjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "zrzzjCheckDetail"),
|
|
|
- "houseList" => \StrUtil::getRequestDecodeParam($this->request, "houseList")
|
|
|
+ "houseList" => $this->request["houseList"]
|
|
|
];
|
|
|
if (!$obj) {
|
|
|
return new Response(Response::ERROR, "请填写信息后保存");
|
|
@@ -390,7 +390,7 @@ class House extends AdminController {
|
|
|
'state' => 3,
|
|
|
'step' => 2,
|
|
|
'stateChange' => "保存未提交",
|
|
|
- 'description' => "录入核查数据",
|
|
|
+ 'description' => $obj["zrzzjCheckDetail"] ? "录入核查数据:" . $obj["zrzzjCheckDetail"] : "录入核查数据",
|
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
|
]);
|
|
@@ -406,7 +406,7 @@ class House extends AdminController {
|
|
|
"id" => \StrUtil::getRequestDecodeParam($this->request, "id"),
|
|
|
"companyId" => \StrUtil::getRequestDecodeParam($this->request, "companyId"),
|
|
|
"mzjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "mzjCheckDetail"),
|
|
|
- "spouseList" => \StrUtil::getRequestDecodeParam($this->request, "spouseList")
|
|
|
+ "spouseList" => $this->request["spouseList"]
|
|
|
];
|
|
|
|
|
|
if (!$obj) {
|
|
@@ -445,7 +445,7 @@ class House extends AdminController {
|
|
|
'state' => 3,
|
|
|
'step' => 2,
|
|
|
'stateChange' => "保存未提交",
|
|
|
- 'description' => "录入核查数据",
|
|
|
+ 'description' => $obj["mzjCheckDetail"] ? "录入核查数据:" . $obj["mzjCheckDetail"] : "录入核查数据:",
|
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
|
]);
|
|
@@ -494,6 +494,35 @@ class House extends AdminController {
|
|
|
return new Response(Response::SUCCESS, "审核成功");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param id
|
|
|
+ * @param type
|
|
|
+ * @description 删除享受其他政策记录/历年享受记录
|
|
|
+ * */
|
|
|
+ public function deleteOtherOrHouse($id, $type) {
|
|
|
+ if (\StrUtil::isEmpOrNull($id)) {
|
|
|
+ return new Response(Response::ERROR, "系统错误");
|
|
|
+ }
|
|
|
+ if ($type == 1) { //享受其他政策
|
|
|
+ \app\common\model\HousePurchaseEnjoyOther::where("id", $id)->delete();
|
|
|
+ } else if (type == 2) { //其他房产信息
|
|
|
+ \app\common\model\HousePurchaseOtherHouse::where("id", $id)->delete();
|
|
|
+ }
|
|
|
+ return new Response(Response::SUCCESS, "删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param id
|
|
|
+ * @description 删除配偶信息
|
|
|
+ * */
|
|
|
+ public function deleteSpouse($id) {
|
|
|
+ if (\StrUtil::isEmpOrNull($id)) {
|
|
|
+ return new Response(Response::ERROR, "系统错误");
|
|
|
+ }
|
|
|
+ \app\common\model\HousePurchaseSpouse::where("id", $id)->delete();
|
|
|
+ return new Response(Response::SUCCESS, "删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 提交审核
|
|
|
* @return Response
|
|
@@ -1038,6 +1067,8 @@ class House extends AdminController {
|
|
|
"id" => \StrUtil::getRequestDecodeParam($this->request, "id"),
|
|
|
"checkIsTradeRecord" => \StrUtil::getRequestDecodeParam($this->request, "checkIsTradeRecord"),
|
|
|
"checkRecordTime" => \StrUtil::getRequestDecodeParam($this->request, "checkRecordTime"),
|
|
|
+ "mzjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "mzjCheckDetail"),
|
|
|
+ "mzjSpouseList" => $this->request["mzjSpouseList"],
|
|
|
"zjjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "zjjCheckDetail"),
|
|
|
"isHasBdcCard" => \StrUtil::getRequestDecodeParam($this->request, "isHasBdcCard"),
|
|
|
"bdcRegistTime" => \StrUtil::getRequestDecodeParam($this->request, "bdcRegistTime"),
|
|
@@ -1045,9 +1076,9 @@ class House extends AdminController {
|
|
|
"transferMethod" => \StrUtil::getRequestDecodeParam($this->request, "transferMethod"),
|
|
|
"transferTime" => \StrUtil::getRequestDecodeParam($this->request, "transferTime"),
|
|
|
"zrzzjCheckDetail" => \StrUtil::getRequestDecodeParam($this->request, "zrzzjCheckDetail"),
|
|
|
- "zjjHouseList" => \StrUtil::getRequestDecodeParam($this->request, "zjjHouseList"),
|
|
|
- "zrzyjHouseList" => \StrUtil::getRequestDecodeParam($this->request, "zrzyjHouseList"),
|
|
|
- "otherList" => \StrUtil::getRequestDecodeParam($this->request, "otherList")
|
|
|
+ "zjjHouseList" => $this->request["zjjHouseList"],
|
|
|
+ "zrzyjHouseList" => $this->request["zrzyjHouseList"],
|
|
|
+ "otherList" => $this->request["otherList"]
|
|
|
];
|
|
|
if (!$obj) {
|
|
|
return new Response(Response::ERROR, "系统错误,请联系管理员");
|
|
@@ -1081,6 +1112,21 @@ class House extends AdminController {
|
|
|
$obj["checkIsTradeRecord"] = null;
|
|
|
$obj["checkRecordTime"] = "";
|
|
|
}
|
|
|
+ if ($obj["mzjSpouseList"] && count($obj["mzjSpouseList"]) > 0) {
|
|
|
+ foreach ($obj["mzjSpouseList"] as $spouse) {
|
|
|
+ if ($spouse["id"]) {
|
|
|
+ $spouse["updateTime"] = date("Y-m-d H:i:s");
|
|
|
+ $spouse["updateUser"] = $this->user["name"];
|
|
|
+ \app\common\model\HousePurchaseSpouse::update($spouse);
|
|
|
+ } else {
|
|
|
+ $spouse["id"] = getStringId();
|
|
|
+ $spouse["pId"] = $obj["id"];
|
|
|
+ $spouse["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ $spouse["createUser"] = $this->user["name"];
|
|
|
+ \app\common\model\HousePurchaseSpouse::insert($spouse);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if ($obj["zrzyjHouseList"] && count($obj["zrzyjHouseList"]) > 0) {
|
|
|
foreach ($obj["zrzyjHouseList"] as $other) {
|
|
|
if ($other["id"]) {
|
|
@@ -2081,7 +2127,6 @@ class House extends AdminController {
|
|
|
* @description 计算购房补贴金额
|
|
|
* */
|
|
|
private function calculate($old, &$housepurchase = [], &$descideDesc = [], $type = 1) {
|
|
|
- $count = $old["type"] == 1 ? 5 : 3; //最大申报数
|
|
|
/* * 1、查询申报人和配偶的房产信息 */
|
|
|
$houseInfo = HouseApi::getHouseInfo($old["idCard"]);
|
|
|
$spouseHouseInfo = HouseApi::getHouseInfo($old["spouseIdCard"]);
|
|
@@ -2101,9 +2146,6 @@ class House extends AdminController {
|
|
|
];
|
|
|
}
|
|
|
//判断是否超过五次申报
|
|
|
- if ($houseInfo["count"] >= $count) {
|
|
|
- return new Response(Response::ERROR, "申报人已享受五次购房补贴,无法再次享受");
|
|
|
- }
|
|
|
if ($houseInfo["balanceMoney"] <= 0) {
|
|
|
return new Response(Response::ERROR, "申报房产可享受余额不足,无法享受");
|
|
|
}
|
|
@@ -2111,28 +2153,31 @@ class House extends AdminController {
|
|
|
$amountStandard = \app\common\api\AmountStandardApi::getStandard($this->user["type"], 3, $old["talentArrange"]);
|
|
|
if (!$amountStandard)
|
|
|
return new Response(Response::ERROR, "系统暂未设置该人才层次的购房补贴享受金额,请设置后再提交");
|
|
|
- if ($old["type"] == 1) {
|
|
|
- $housepurchase["talentArrangeMoney"] = round(0.2 * $amountStandard["money"], 2);
|
|
|
- } else {
|
|
|
- $code = "housepurchase_percentage_";
|
|
|
- switch ($old["type"]) {
|
|
|
- case CommonConst::ENTERPRISE_JC:
|
|
|
- $code .= "ic";
|
|
|
- break;
|
|
|
- case CommonConst::ENTERPRISE_WJ:
|
|
|
- $code .= "wj";
|
|
|
- break;
|
|
|
- case CommonConst::ENTERPRISE_GJ:
|
|
|
- $code .= "gj";
|
|
|
- break;
|
|
|
- }
|
|
|
- $dic = DictApi::findByParentCodeAndCode($code, $houseInfo["count"] + 1);
|
|
|
- if (!$dic)
|
|
|
- return new Response(Response::ERROR, "系统字典中暂未设置购房补贴年度比例,请设置后再提交。字典代码以[集成电路:housepurchase_percentage_ic][卫健:housepurchase_percentage_wj][高教:housepurchase_percentage_gj]为准");
|
|
|
- if (!is_numeric($dic["name"]) || $dic["name"] > 1 || $dic["name"] < 0)
|
|
|
- return new Response(Response::ERROR, "系统字典中设置的购房补贴年度比例应该是介于0~1之间的数字");
|
|
|
- $housepurchase["talentArrangeMoney"] = round($dic["name"] * $amountStandard["money"], 2);
|
|
|
+ $code = "housepurchase_percentage_";
|
|
|
+ switch ($old["type"]) {
|
|
|
+ case CommonConst::ENTERPRISE_NORMAL:
|
|
|
+ $code .= "normal";
|
|
|
+ break;
|
|
|
+ case CommonConst::ENTERPRISE_JC:
|
|
|
+ $code .= "ic";
|
|
|
+ break;
|
|
|
+ case CommonConst::ENTERPRISE_WJ:
|
|
|
+ $code .= "wj";
|
|
|
+ break;
|
|
|
+ case CommonConst::ENTERPRISE_GJ:
|
|
|
+ $code .= "gj";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $dic = DictApi::findByParentCodeAndCode($code, $houseInfo["count"] + 1);
|
|
|
+ if (!$dic)
|
|
|
+ return new Response(Response::ERROR, "系统字典中暂未设置购房补贴年度比例,请设置后再提交。");
|
|
|
+ $count = count(DictApi::findChildDictByCode($code));
|
|
|
+ if ($houseInfo["count"] >= $count) {
|
|
|
+ return new Response(Response::ERROR, "申报人已享受五次购房补贴,无法再次享受");
|
|
|
}
|
|
|
+ if (!is_numeric($dic["name"]) || $dic["name"] > 1 || $dic["name"] < 0)
|
|
|
+ return new Response(Response::ERROR, "系统字典中设置的购房补贴年度比例应该是介于0~1之间的数字");
|
|
|
+ $housepurchase["talentArrangeMoney"] = round($dic["name"] * $amountStandard["money"], 2);
|
|
|
/* * 3.计算当年度录入享受其他政策的金额 */
|
|
|
$otherList = HouseApi::getEnjoyOtherList($old["id"]);
|
|
|
$housepurchase["nowOtherMoney"] = 0;
|