|
@@ -211,6 +211,10 @@ class House extends AdminController {
|
|
$data["id"] = $id;
|
|
$data["id"] = $id;
|
|
if ($checkState == 2) {
|
|
if ($checkState == 2) {
|
|
if ($toProcess == 2) {
|
|
if ($toProcess == 2) {
|
|
|
|
+ $depCodes = getJsonConfig("../sys_config.json", "housepurchase_dep_list")[$old["type"]];
|
|
|
|
+ if (!$depCodes || count($depCodes) == 0) {
|
|
|
|
+ return new Response(Response::ERROR, "没有配置部门审核,不能选择驳回至部门审核");
|
|
|
|
+ }
|
|
$where = [];
|
|
$where = [];
|
|
$where[] = ["code", "in", $toDep];
|
|
$where[] = ["code", "in", $toDep];
|
|
$companyIds = \app\common\model\Company::where($where)->column("id");
|
|
$companyIds = \app\common\model\Company::where($where)->column("id");
|
|
@@ -292,22 +296,29 @@ class House extends AdminController {
|
|
/* * 生成各部门数据审核 */
|
|
/* * 生成各部门数据审核 */
|
|
$depList = [];
|
|
$depList = [];
|
|
$depCodes = getJsonConfig("../sys_config.json", "housepurchase_dep_list")[$old["type"]];
|
|
$depCodes = getJsonConfig("../sys_config.json", "housepurchase_dep_list")[$old["type"]];
|
|
- $where = [];
|
|
|
|
- $where[] = ["code", "in", $depCodes];
|
|
|
|
- $companies = \app\common\model\Company::where($where)->select()->toArray();
|
|
|
|
- foreach ($companies as $company) {
|
|
|
|
- $depList[] = [
|
|
|
|
- "id" => getStringId(),
|
|
|
|
- "type" => ProjectState::HOUSE,
|
|
|
|
- "mainId" => $id,
|
|
|
|
- "companyId" => $company["id"],
|
|
|
|
- "state" => 1,
|
|
|
|
- "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
- "createUser" => $this->user["name"]
|
|
|
|
- ];
|
|
|
|
|
|
+ if ($depCodes && count($depCodes) > 0) {
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["code", "in", $depCodes];
|
|
|
|
+ $companies = \app\common\model\Company::where($where)->select()->toArray();
|
|
|
|
+ foreach ($companies as $company) {
|
|
|
|
+ $depList[] = [
|
|
|
|
+ "id" => getStringId(),
|
|
|
|
+ "type" => ProjectState::HOUSE,
|
|
|
|
+ "mainId" => $id,
|
|
|
|
+ "companyId" => $company["id"],
|
|
|
|
+ "state" => 1,
|
|
|
|
+ "createTime" => date("Y-m-d H:i:s"),
|
|
|
|
+ "createUser" => $this->user["name"]
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ Db::table("un_talent_depcheckstate")->insertAll($depList);
|
|
|
|
+ $housepurchase["checkState"] = HouseStateEnum::NEED_DEP_CHECK;
|
|
|
|
+ } else {
|
|
|
|
+ if (\StrUtil::isEmpOrNull($old["depPassTime"])) {
|
|
|
|
+ $housepurchase["depPassTime"] = date("Y-m-d H:i:s");
|
|
|
|
+ }
|
|
|
|
+ $housepurchase["checkState"] = HouseStateEnum::NEED_REVIEW_CHECK;
|
|
}
|
|
}
|
|
- Db::table("un_talent_depcheckstate")->insertAll($depList);
|
|
|
|
- $housepurchase["checkState"] = HouseStateEnum::NEED_DEP_CHECK;
|
|
|
|
}
|
|
}
|
|
if (\StrUtil::isEmpOrNull($old["firstPassTime"])) {
|
|
if (\StrUtil::isEmpOrNull($old["firstPassTime"])) {
|
|
$housepurchase["firstPassTime"] = date("Y-m-d H:i:s");
|
|
$housepurchase["firstPassTime"] = date("Y-m-d H:i:s");
|
|
@@ -336,7 +347,10 @@ class House extends AdminController {
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
]);
|
|
]);
|
|
- TalentChecklog::delete($log["id"]);
|
|
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["mainId", "=", $id];
|
|
|
|
+ $where[] = ["active", "=", 2];
|
|
|
|
+ TalentChecklog::where($where)->delete();
|
|
houseModel::update($housepurchase);
|
|
houseModel::update($housepurchase);
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
@@ -383,7 +397,10 @@ class House extends AdminController {
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
]);
|
|
]);
|
|
- TalentChecklog::delete($log["id"]);
|
|
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["mainId", "=", $id];
|
|
|
|
+ $where[] = ["active", "=", 2];
|
|
|
|
+ TalentChecklog::where($where)->delete();
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
if ($checkState == -1) {
|
|
if ($checkState == -1) {
|
|
@@ -425,93 +442,158 @@ class House extends AdminController {
|
|
$where[] = ["year", "=", $old["year"]];
|
|
$where[] = ["year", "=", $old["year"]];
|
|
$where[] = ["delete", "=", 0];
|
|
$where[] = ["delete", "=", 0];
|
|
$info = \app\common\model\TalentAllowance::where($where)->find();
|
|
$info = \app\common\model\TalentAllowance::where($where)->find();
|
|
- if (!$info) {
|
|
|
|
- return new Response(Response::ERROR, "当前申报人暂未申报津补贴,无法审核通过");
|
|
|
|
- }
|
|
|
|
- if ($info["checkState"] != \app\common\state\AllowanceStateEnum::REVIEW_PASS || $info["publicState"] < 4) {
|
|
|
|
- return new Response(Response::ERROR, "当前申报人的津补贴申报暂未公示通过,无法审核通过");
|
|
|
|
|
|
+ if ($info["checkState"] == \app\common\state\AllowanceStateEnum::REVIEW_PASS && $info["publicState"] == 4) {
|
|
|
|
+ $housepurchase["allowanceType"] = $info["allowanceType"];
|
|
}
|
|
}
|
|
$housepurchase["cashType"] = $old["cashType"];
|
|
$housepurchase["cashType"] = $old["cashType"];
|
|
- $descideDesc[] = "审核意见:" . $log["description"] . ";系统根据津补贴情况判断说明:";
|
|
|
|
- /* * 1.判断征信信息 */
|
|
|
|
- if (\StrUtil::isNotEmpAndNull($info["outMsg"]) && $info["checkState"] == \app\common\state\AllowanceStateEnum::NOTPASS) {
|
|
|
|
- $housepurchase["zxMsg"] = $info["outMsg"];
|
|
|
|
- $housepurchase["checkState"] = HouseStateEnum::NOTPASS;
|
|
|
|
- $housepurchase["cashType"] = 2;
|
|
|
|
- $descideDesc[] = "(1)核查征信结果:" . $info["outMsg"] . ";无法享受";
|
|
|
|
- } else {
|
|
|
|
- $descideDesc[] = "(1)核查征信结果:征信通过;";
|
|
|
|
- $housepurchase["zxMsg"] = "";
|
|
|
|
- $housepurchase["checkState"] = HouseStateEnum::REVIEW_PASS;
|
|
|
|
- }
|
|
|
|
- /* * 2.获取社保/个税数据并判断是否可以享受* */
|
|
|
|
|
|
+ $descideDesc[] = "审核意见:" . $log["description"] . ";";
|
|
|
|
+ $housepurchase["checkState"] = HouseStateEnum::REVIEW_PASS;
|
|
if ($old["declareType"] == 1) { //购房补贴
|
|
if ($old["declareType"] == 1) { //购房补贴
|
|
- $sbSet = [];
|
|
|
|
- if ($old["type"] == 1) {
|
|
|
|
- sbSet = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_SB . getCode());
|
|
|
|
- } else {
|
|
|
|
- Set<String> pensionSet = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_SB_PENSION . getCode());
|
|
|
|
- Set<String> unemploymentSet = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_SB_UNEMPLOYMENT . getCode());
|
|
|
|
- Set<String> medicalSet = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_SB_MEDICA . getCode());
|
|
|
|
- pensionSet . retainAll(unemploymentSet);
|
|
|
|
- pensionSet . retainAll(medicalSet);
|
|
|
|
- sbSet . addAll(pensionSet);
|
|
|
|
- }
|
|
|
|
- Set<String> taxSet = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_TAX . getCode());
|
|
|
|
- housepurchase . setSbPayDetail(sbSet . stream() . collect(Collectors . joining(",")));
|
|
|
|
- housepurchase . setTaxPayDetail(taxSet . stream() . collect(Collectors . joining(",")));
|
|
|
|
- housepurchase . setAllowanceType(info . getAllowanceType());
|
|
|
|
- /* * 获取社保个税交集 */
|
|
|
|
- Set<String> totalMonth = new TreeSet <> (Arrays . asList("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"));
|
|
|
|
- totalMonth . retainAll(sbSet);
|
|
|
|
- taxSet . retainAll(taxSet);
|
|
|
|
- /* * 判断是否享受人才津贴 */
|
|
|
|
- if (info . getAllowanceType() != 1 && housepurchase . getCashType() == 1) {
|
|
|
|
- housepurchase . setCashType(2);
|
|
|
|
- descideDesc . append("(2)上一年度未享受人才津贴,无法享受;");
|
|
|
|
- } else {
|
|
|
|
- descideDesc . append("(2)上一年度享受人才津贴;");
|
|
|
|
- }
|
|
|
|
- /* * 判断社保个税共同缴纳是否满足几个月 */
|
|
|
|
- if (totalMonth . size() < 9 && housepurchase . getCashType() == 1) {
|
|
|
|
- housepurchase . setCashType(2);
|
|
|
|
- descideDesc . append("(3)社保和个税上一年度共同缴纳未满足9个月,无法享受;");
|
|
|
|
- } else {
|
|
|
|
- descideDesc . append("(3)社保和个税上一年度共同缴纳满足9个月;");
|
|
|
|
- }
|
|
|
|
- housepurchase . setDecideDetail(descideDesc . toString());
|
|
|
|
/* * 对需要兑现的计算享受金额 */
|
|
/* * 对需要兑现的计算享受金额 */
|
|
- if (housepurchase . getCashType() == 1) {
|
|
|
|
- ResponseObj responseObj = calculateOld(old, housepurchase, descideDesc, 1);
|
|
|
|
- if (responseObj . getCode() == 500) {
|
|
|
|
- return responseObj;
|
|
|
|
|
|
+ if ($housepurchase["cashType"] == 1) {
|
|
|
|
+ $result = $this->calculate($old, $housepurchase, $descideDesc, 1);
|
|
|
|
+ if ($result->code == 500) {
|
|
|
|
+ return $result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if (old . getDeclareType() == 2) { //免租入住
|
|
|
|
- Set<String> set = getAllowanceProjectSet(info, old, AllowanceProjectEnum . PROJECT_LETTER . getCode());
|
|
|
|
- housepurchase . setLetterDetail(set . stream() . collect(Collectors . joining(",")));
|
|
|
|
- if (set . size() < 9 && housepurchase . getCashType() == 1) {
|
|
|
|
- housepurchase . setCashType(2);
|
|
|
|
- housepurchase . setDecideDetail("(2)上一年度行政介绍信未满足9个月");
|
|
|
|
- } else {
|
|
|
|
- housepurchase . setDecideDetail("(2)上一年度行政介绍信满足9个月");
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- if (FengStringUtil . isEmpOrNull(old . getReviewPassTime())) {
|
|
|
|
- housepurchase . setReviewPassTime(DateUtil . getTime());
|
|
|
|
|
|
+ $housepurchase["decideDetail"] = implode("", $descideDesc);
|
|
|
|
+ if (\StrUtil::isEmpOrNull($old["reviewPassTime"])) {
|
|
|
|
+ $housepurchase["reviewPassTime"] = date("Y-m-d H:i:s");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- TalentChecklog newLog3 = new TalentChecklog(ProjectEnum . HOUSE . getCode(), obj . getId(), null, StateConst . ACTIVE_YES, checkState,
|
|
|
|
- obj . getProcess(), HousePurechaseStateEnum . valueOf(old . getCheckState()) + "->" + HousePurechaseStateEnum . valueOf(housepurchase . getCheckState()), log . getDescription(), DateUtil . getTime(),
|
|
|
|
- ShiroKit . getUser() . getAccount() + "(" + company . getName() + ")");
|
|
|
|
- this.talentChecklogService.delete(new EntityWrapper<TalentChecklog>().eq("mainId", obj.getId()).eq("active", StateConst.ACTIVE_NO));
|
|
|
|
- this . talentChecklogService . insert(newLog3);
|
|
|
|
- this . housepurchaseService . updateById(housepurchase);
|
|
|
|
|
|
+ //添加日志
|
|
|
|
+ TalentChecklog::create([
|
|
|
|
+ 'id' => getStringId(),
|
|
|
|
+ 'mainId' => $id,
|
|
|
|
+ 'type' => intval(ProjectState::HOUSE),
|
|
|
|
+ 'typeFileId' => null,
|
|
|
|
+ 'active' => 1,
|
|
|
|
+ 'state' => $checkState,
|
|
|
|
+ 'step' => $process,
|
|
|
|
+ 'stateChange' => sprintf("%s->%s", HouseStateEnum::getStateName($old["checkState"]), HouseStateEnum::getStateName($housepurchase["checkState"])),
|
|
|
|
+ 'description' => $log["description"],
|
|
|
|
+ 'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
|
+ 'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
|
|
+ ]);
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["mainId", "=", $id];
|
|
|
|
+ $where[] = ["active", "=", 2];
|
|
|
|
+ TalentChecklog::where($where)->delete();
|
|
|
|
+ houseModel::update($housepurchase);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
return new Response(Response::SUCCESS, "提交审核成功");
|
|
return new Response(Response::SUCCESS, "提交审核成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 撤销审核
|
|
|
|
+ * @return \app\admin\controller\ResponseObj
|
|
|
|
+ */
|
|
|
|
+ public function cancleThirdCheck() {
|
|
|
|
+ $id = $this->request["id"];
|
|
|
|
+ $checkMsg = $this->request["checkMsg"];
|
|
|
|
+ if (\StrUtil::isEmpOrNull($id)) {
|
|
|
|
+ return new Response(Response::ERROR, "请选择需要撤销的对象");
|
|
|
|
+ }
|
|
|
|
+ $old = HouseApi::getInfoById($id);
|
|
|
|
+ if ($old["checkState"] != HouseStateEnum::REVIEW_PASS) {
|
|
|
|
+ return new Response(Response::ERROR, "当前对象不是复核通过状态,无法撤销");
|
|
|
|
+ }
|
|
|
|
+ if ($old["publicState"] != 1) {
|
|
|
|
+ return new Response(Response::ERROR, "当前对象不是待公示状态,无法撤销");
|
|
|
|
+ }
|
|
|
|
+ $data["id"] = $id;
|
|
|
|
+ $data["checkMsg"] = $checkMsg;
|
|
|
|
+ $data["checkState"] = HouseStateEnum::NEED_REVIEW_CHECK;
|
|
|
|
+ $data["cashIdCards"] = "";
|
|
|
|
+ $data["cashType"] = null;
|
|
|
|
+ $data["decideMoneyDetail"] = "";
|
|
|
|
+ $data["decideDetail"] = "";
|
|
|
|
+ $where = [];
|
|
|
|
+ $where[] = ["mainId", "=", $id];
|
|
|
|
+ $count = Db::table("un_talent_depcheckstate")->where($where)->count();
|
|
|
|
+ $data["highProcess"] = $count > 0 ? 2 : 1;
|
|
|
|
+
|
|
|
|
+ //添加日志
|
|
|
|
+ TalentChecklog::create([
|
|
|
|
+ 'id' => getStringId(),
|
|
|
|
+ 'mainId' => $id,
|
|
|
|
+ 'type' => intval(ProjectState::HOUSE),
|
|
|
|
+ 'typeFileId' => null,
|
|
|
|
+ 'active' => 1,
|
|
|
|
+ 'state' => 11,
|
|
|
|
+ 'step' => 3,
|
|
|
|
+ 'stateChange' => HouseStateEnum::getStateName($old["checkState"]) . "->" . HouseStateEnum::getStateName($data["checkState"]),
|
|
|
|
+ 'description' => "撤销原因:" . $checkMsg,
|
|
|
|
+ 'createTime' => date("Y-m-d H:i:s", time()),
|
|
|
|
+ 'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
|
|
+ ]);
|
|
|
|
+ houseModel::update($data);
|
|
|
|
+ return new Response(Response::SUCCESS, "撤销成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param type
|
|
|
|
+ * @description 查询需要审核的数据(待核查征信 /待公示 / 待公示通过 / 待兑现)
|
|
|
|
+ * */
|
|
|
|
+ public function selectNeedCheckData() {
|
|
|
|
+ $type = $this->request["type"];
|
|
|
|
+ $name = $this->request["name"];
|
|
|
|
+ $idCard = $this->request["idCard"];
|
|
|
|
+ $where = [];
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($name)) {
|
|
|
|
+ $where[] = ["name", "like", "%$name%"];
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($idCard)) {
|
|
|
|
+ $where[] = ["idCard", "like", "%$idCard%"];
|
|
|
|
+ }
|
|
|
|
+ $where[] = ["type", "=", $this->user["type"]];
|
|
|
|
+ $field = "id,year,idCard,name,enterpriseId";
|
|
|
|
+ $error = null;
|
|
|
|
+ switch ($type) {
|
|
|
|
+ case -1:
|
|
|
|
+ case 0:
|
|
|
|
+ $where[] = ["publicState", "=", 1];
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::NOTPASS, HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $error = "暂无可核查征信的数据";
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ case 5:
|
|
|
|
+ $where[] = ["publicState", "=", 2];
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::NOTPASS, HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $where[] = ["cashType", "=", 1];
|
|
|
|
+ $error = "暂无可公示(兑现)的数据";
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ case 6:
|
|
|
|
+ $where[] = ["publicState", "=", 2];
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::NOTPASS, HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $where[] = ["cashType", "=", 2];
|
|
|
|
+ $error = "暂无可公示(不予兑现)的数据";
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ $where[] = ["publicState", "=", 3];
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::NOTPASS, HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $error = "暂无需要公示通过的数据";
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ $where[] = ["publicState", "=", 4];
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $where[] = ["cashType", "=", 1];
|
|
|
|
+ $error = "暂无待兑现的数据";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $list = HouseApi::getList($where, $field);
|
|
|
|
+ //查询企业信息
|
|
|
|
+ $enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
|
|
|
|
+ foreach ($list as &$row) {
|
|
|
|
+ $row["enterpriseName"] = $enterpriseMap[$row["enterpriseId"]];
|
|
|
|
+ }
|
|
|
|
+ $res = ["rows" => $list, "total" => count($list)];
|
|
|
|
+ return new Response(Response::SUCCESS, "", $res);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function exportHczx() {
|
|
public function exportHczx() {
|
|
$response = new \stdClass();
|
|
$response = new \stdClass();
|
|
$response->code = 500;
|
|
$response->code = 500;
|
|
@@ -558,35 +640,33 @@ class House extends AdminController {
|
|
if (!$param) {
|
|
if (!$param) {
|
|
return new Response(Response::ERROR, "系统错误,请联系管理员");
|
|
return new Response(Response::ERROR, "系统错误,请联系管理员");
|
|
}
|
|
}
|
|
- $old = TalentAllowanceApi::getInfoById($param["id"]);
|
|
|
|
|
|
+ $old = HouseApi::getInfoById($param["id"]);
|
|
if ($old["publicState"] != 1) {
|
|
if ($old["publicState"] != 1) {
|
|
return new Response(Response::ERROR, "当前记录不是待核查征信状态,无法核查");
|
|
return new Response(Response::ERROR, "当前记录不是待核查征信状态,无法核查");
|
|
}
|
|
}
|
|
|
|
+
|
|
$data["id"] = $param["id"];
|
|
$data["id"] = $param["id"];
|
|
|
|
+ $data["checkState"] = HouseStateEnum::NOTPASS;
|
|
$data["publicState"] = 2;
|
|
$data["publicState"] = 2;
|
|
- $data["checkState"] = AllowanceStateEnum::NOTPASS;
|
|
|
|
- $data["recommendAllowanceType"] = 3;
|
|
|
|
- $data["recommendAllowanceMsg"] = "征信失信,不予兑现,失信原因:" . $param["outMsg"];
|
|
|
|
- $data["recommendMonths"] = "";
|
|
|
|
- $data["recommendMoney"] = 0.00;
|
|
|
|
- $data["workAllowanceMoney"] = null;
|
|
|
|
- $data["developAllowanceMoney"] = null;
|
|
|
|
|
|
+ $data["zxMsg"] = $param["outMsg"];
|
|
|
|
+ $data["cashType"] = 2;
|
|
|
|
+ $data["descideDesc"] = $old . "(1)核查征信结果:" . $param["outMsg"] . ";无法享受";
|
|
|
|
|
|
//添加日志
|
|
//添加日志
|
|
TalentChecklog::create([
|
|
TalentChecklog::create([
|
|
'id' => getStringId(),
|
|
'id' => getStringId(),
|
|
'mainId' => $param["id"],
|
|
'mainId' => $param["id"],
|
|
- 'type' => intval(ProjectState::JBT),
|
|
|
|
|
|
+ 'type' => intval(ProjectState::HOUSE),
|
|
'typeFileId' => null,
|
|
'typeFileId' => null,
|
|
'active' => 1,
|
|
'active' => 1,
|
|
'state' => 2,
|
|
'state' => 2,
|
|
'step' => 4,
|
|
'step' => 4,
|
|
- 'stateChange' => AllowanceStateEnum::getStateName($old["checkState"]) . "-><span class='label label-primary'>审核不通过</span>" . "公示状态:<span class='label label-success'>待核查</span>-><span class='label label-primary'>待公示</span>",
|
|
|
|
|
|
+ 'stateChange' => HouseStateEnum::getStateName($old["checkState"]) . "->" . HouseStateEnum::getStateName($data["checkState"]) . "<br>公示状态:<span class='label label-success'>待核查</span>-><span class='label label-primary'>待公示</span>",
|
|
'description' => $param["outMsg"],
|
|
'description' => $param["outMsg"],
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createTime' => date("Y-m-d H:i:s", time()),
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
]);
|
|
]);
|
|
- TaModel::update($data);
|
|
|
|
|
|
+ houseModel::update($data);
|
|
return new Response(Response::SUCCESS, "核查征信成功");
|
|
return new Response(Response::SUCCESS, "核查征信成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -664,7 +744,7 @@ class House extends AdminController {
|
|
];
|
|
];
|
|
$phones[] = $info["phone"];
|
|
$phones[] = $info["phone"];
|
|
}
|
|
}
|
|
- $data["publicState"] = 2;
|
|
|
|
|
|
+ $data["publicState"] = 3;
|
|
Db::table("un_housepurchase")->where($where)->update($data);
|
|
Db::table("un_housepurchase")->where($where)->update($data);
|
|
$effect = Db::table("new_talent_checklog")->insertAll($logList);
|
|
$effect = Db::table("new_talent_checklog")->insertAll($logList);
|
|
Db::commit();
|
|
Db::commit();
|
|
@@ -709,33 +789,6 @@ class House extends AdminController {
|
|
return view("public_check", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
|
|
return view("public_check", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 公示再审核计算津补贴
|
|
|
|
- * */
|
|
|
|
- public function suppleCheckCalculate() {
|
|
|
|
- $id = $this->request["id"];
|
|
|
|
- try {
|
|
|
|
- $info = TalentAllowanceApi::getInfoById($id);
|
|
|
|
- $arrangeList = $this->validateAllowanceType($info);
|
|
|
|
- $detailList = \app\common\model\TalentAllowancecontractDetail::where("mainId", $id)->select()->toArray();
|
|
|
|
- $talentTypeMap = DictApi::selectByParentCode("enterprise_tag");
|
|
|
|
- $enterpriseMap = \app\common\model\Enterprise::where("type", $this->user["type"])->column("name", "id");
|
|
|
|
- foreach ($detailList as &$detail) {
|
|
|
|
- $detail["enterpriseName"] = $enterpriseMap[$detail["enterpriseId"]];
|
|
|
|
- if (\StrUtil::isNotEmpAndNull($detail["talentType"])) {
|
|
|
|
- $detail["talentTypeName"] = $talentTypeMap[$detail["talentType"]];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- $res = [
|
|
|
|
- "info" => $info,
|
|
|
|
- "detailList" => $detailList
|
|
|
|
- ];
|
|
|
|
- return new Response(Response::SUCCESS, "计算成功", $res);
|
|
|
|
- } catch (\think\Exception $e) {
|
|
|
|
- return new Response(Response::ERROR, "系统异常,请联系管理员");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 公示后审核
|
|
* 公示后审核
|
|
*/
|
|
*/
|
|
@@ -893,7 +946,7 @@ class House extends AdminController {
|
|
}
|
|
}
|
|
$houseInfo["count"] = $houseInfo["count"] + 1;
|
|
$houseInfo["count"] = $houseInfo["count"] + 1;
|
|
$houseInfo["balanceMoney"] = $houseInfo["balanceMoney"] - $obj["shouldEnjoyMoney"];
|
|
$houseInfo["balanceMoney"] = $houseInfo["balanceMoney"] - $obj["shouldEnjoyMoney"];
|
|
- $houseInfo["lastYearArrears"] = $obj["nowNotSubOtherMoney"]
|
|
|
|
|
|
+ $houseInfo["lastYearArrears"] = $obj["nowNotSubOtherMoney"];
|
|
if (\StrUtil::isNotEmpAndNull($obj["spouseIdcard"])) {
|
|
if (\StrUtil::isNotEmpAndNull($obj["spouseIdcard"])) {
|
|
if (!$spouseHouseInfo) {
|
|
if (!$spouseHouseInfo) {
|
|
$spouseHouseInfo = [
|
|
$spouseHouseInfo = [
|
|
@@ -950,7 +1003,7 @@ class House extends AdminController {
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- $upd["publicState"] = 3;
|
|
|
|
|
|
+ $upd["publicState"] = 4;
|
|
Db::table("un_housepurchase")->where($where)->update($upd);
|
|
Db::table("un_housepurchase")->where($where)->update($upd);
|
|
if ($insertHouseInfoList) {
|
|
if ($insertHouseInfoList) {
|
|
Db::table("un_housepurchase_house_info")->insertAll($insertHouseInfoList);
|
|
Db::table("un_housepurchase_house_info")->insertAll($insertHouseInfoList);
|
|
@@ -995,7 +1048,7 @@ class House extends AdminController {
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
'createUser' => sprintf("%s(%s)", $this->user["account"], $this->user["companyName"])
|
|
];
|
|
];
|
|
}
|
|
}
|
|
- $upd["publicState"] = 4;
|
|
|
|
|
|
+ $upd["publicState"] = 5;
|
|
Db::table("un_housepurchase")->where($where)->update($upd);
|
|
Db::table("un_housepurchase")->where($where)->update($upd);
|
|
Db::table("new_talent_checklog")->insertAll($logList);
|
|
Db::table("new_talent_checklog")->insertAll($logList);
|
|
Db::commit();
|
|
Db::commit();
|
|
@@ -1147,7 +1200,7 @@ class House extends AdminController {
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
if ($obj["publicState"]) {
|
|
if ($obj["publicState"]) {
|
|
- $where[] = ["publicState", "=", $param["publicState"]];
|
|
|
|
|
|
+ $where[] = ["publicState", "=", $obj["publicState"]];
|
|
}
|
|
}
|
|
$where[] = ["ta.checkState", "in", [-1, 30]];
|
|
$where[] = ["ta.checkState", "in", [-1, 30]];
|
|
break;
|
|
break;
|
|
@@ -1338,11 +1391,12 @@ class House extends AdminController {
|
|
$old["checkState"] = null;
|
|
$old["checkState"] = null;
|
|
$old["checkMsg"] = "";
|
|
$old["checkMsg"] = "";
|
|
}
|
|
}
|
|
- $res = $this->calculate($old, 1);
|
|
|
|
|
|
+ $housepurchase = [];
|
|
|
|
+ $this->calculate($old, $housepurchase, [], 1);
|
|
if ($res->code == 500) {
|
|
if ($res->code == 500) {
|
|
return $res;
|
|
return $res;
|
|
}
|
|
}
|
|
- $res["housepurchase"] = $res->obj;
|
|
|
|
|
|
+ $res["housepurchase"] = $housepurchase;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -1400,6 +1454,59 @@ class House extends AdminController {
|
|
return new Response(Response::SUCCESS, "修改成功");
|
|
return new Response(Response::SUCCESS, "修改成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function basicDataExport() {
|
|
|
|
+ $names = \StrUtil::getRequestDecodeParam($this->request, "names");
|
|
|
|
+ $values = \StrUtil::getRequestDecodeParam($this->request, "values");
|
|
|
|
+ $process = \StrUtil::getRequestDecodeParam($this->request, "process");
|
|
|
|
+
|
|
|
|
+ $where = [];
|
|
|
|
+ $obj = $this->setHousepurchase($this->request);
|
|
|
|
+ $obj["process"] = $process;
|
|
|
|
+ $obj["type"] = $this->user["type"];
|
|
|
|
+ $this->setCondition($where, $obj);
|
|
|
|
+
|
|
|
|
+ switch ($process) {
|
|
|
|
+ case 1:
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ break;
|
|
|
|
+ case 3:
|
|
|
|
+ $where[] = ["depPassTime", "EXP", Db::raw("is not null")];
|
|
|
|
+ break;
|
|
|
|
+ case 4:
|
|
|
|
+ $where[] = ["checkState", "in", [HouseStateEnum::NOTPASS, HouseStateEnum::REVIEW_PASS]];
|
|
|
|
+ $where[] = ["reviewPassTime", "EXP", Db::raw("is not null")];
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (in_array($process, [1, 3, 4])) {
|
|
|
|
+ $list = houseModel::where($where)->order($order)->select()->toArray();
|
|
|
|
+ } else {
|
|
|
|
+ $company = getCacheById("Company", $this->user["companyId"]);
|
|
|
|
+ $result = HouseApi::selectForHousePurchase($obj, $company, ProjectState::HOUSE, 0, 99999);
|
|
|
|
+ $list = $result["rows"];
|
|
|
|
+ }
|
|
|
|
+ $list = $this->translateChinese($list, $process);
|
|
|
|
+
|
|
|
|
+ if ($list) {
|
|
|
|
+ $filename = "购房补贴导出";
|
|
|
|
+ $columns = array_filter(explode(",", $names));
|
|
|
|
+ $keys = array_filter(explode(",", $values));
|
|
|
|
+ $rows = [];
|
|
|
|
+ foreach ($list as $item) {
|
|
|
|
+ $row = [];
|
|
|
|
+ foreach ($keys as $key) {
|
|
|
|
+ $row[] = $item[$key];
|
|
|
|
+ }
|
|
|
|
+ $rows[] = $row;
|
|
|
|
+ }
|
|
|
|
+ export($columns, $rows, $filename);
|
|
|
|
+ exit();
|
|
|
|
+ } else {
|
|
|
|
+ $response = new Response(Response::ERROR, "没有可导出的内容");
|
|
|
|
+ return \StrUtil::back($response, "Housepurchase.callBack");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private function setCondition(&$where, &$query) {
|
|
private function setCondition(&$where, &$query) {
|
|
if (\StrUtil::isNotEmpAndNull($query["year"])) {
|
|
if (\StrUtil::isNotEmpAndNull($query["year"])) {
|
|
$where[] = ["year", "=", $query["year"]];
|
|
$where[] = ["year", "=", $query["year"]];
|
|
@@ -1670,13 +1777,13 @@ class House extends AdminController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param old
|
|
|
|
- * @param type 1-复核阶段,不生成享受人的剩余享受金额记录,2-公示再审核阶段,生成享受记录
|
|
|
|
|
|
+ * @param $old 原来的记录
|
|
|
|
+ * @param $housepurchase 新的记录
|
|
|
|
+ * @param $descideDesc 记录文本
|
|
|
|
+ * @param $type 1-复核阶段,不生成享受人的剩余享受金额记录,2-公示再审核阶段,生成享受记录
|
|
* @description 计算购房补贴金额
|
|
* @description 计算购房补贴金额
|
|
* */
|
|
* */
|
|
- private function calculate($old, $type) {
|
|
|
|
- $housepurchase = [];
|
|
|
|
- $descideDesc = [];
|
|
|
|
|
|
+ private function calculate($old, &$housepurchase = [], &$descideDesc = [], $type = 1) {
|
|
$count = $old["type"] == 1 ? 5 : 3; //最大申报数
|
|
$count = $old["type"] == 1 ? 5 : 3; //最大申报数
|
|
/* * 1、查询申报人和配偶的房产信息 */
|
|
/* * 1、查询申报人和配偶的房产信息 */
|
|
$houseInfo = HouseApi::getHouseInfo($old["idCard"]);
|
|
$houseInfo = HouseApi::getHouseInfo($old["idCard"]);
|
|
@@ -1828,4 +1935,44 @@ class House extends AdminController {
|
|
return new Response(Response::SUCCESS, "", $housepurchase);
|
|
return new Response(Response::SUCCESS, "", $housepurchase);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private function setHousepurchase($request) {
|
|
|
|
+ $name = \StrUtil::getRequestDecodeParam($request, "name");
|
|
|
|
+ $idCard = \StrUtil::getRequestDecodeParam($request, "idCard");
|
|
|
|
+ $yearStr = \StrUtil::getRequestDecodeParam($request, "year");
|
|
|
|
+ $talentArrangeStr = \StrUtil::getRequestDecodeParam($request, "talentArrange");
|
|
|
|
+ $spouseName = \StrUtil::getRequestDecodeParam($request, "spouseName");
|
|
|
|
+ $spouseIdcard = \StrUtil::getRequestDecodeParam($request, "spouseIdcard");
|
|
|
|
+ $childName = \StrUtil::getRequestDecodeParam($request, "childName");
|
|
|
|
+ $childIdCard = \StrUtil::getRequestDecodeParam($request, "childIdCard");
|
|
|
|
+ $marryStatus = \StrUtil::getRequestDecodeParam($request, "marryStatus");
|
|
|
|
+ $checkStateStr = \StrUtil::getRequestDecodeParam($request, "checkState");
|
|
|
|
+ $isConflictStr = \StrUtil::getRequestDecodeParam($request, "isConflict");
|
|
|
|
+ $isRecoverStr = \StrUtil::getRequestDecodeParam($request, "isRecover");
|
|
|
|
+ $talentArrange = null;
|
|
|
|
+ $year = null;
|
|
|
|
+ $checkState = null;
|
|
|
|
+ $isRecover = null;
|
|
|
|
+ $isConflict = null;
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($talentArrangeStr)) {
|
|
|
|
+ $talentArrange = intval($talentArrangeStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($yearStr)) {
|
|
|
|
+ $year = intval($yearStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($checkStateStr)) {
|
|
|
|
+ $checkState = intval($checkStateStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($isConflictStr)) {
|
|
|
|
+ $isConflict = intval($isConflictStr);
|
|
|
|
+ }
|
|
|
|
+ if (\StrUtil::isNotEmpAndNull($isRecoverStr)) {
|
|
|
|
+ $isRecover = intval($isRecoverStr);
|
|
|
|
+ }
|
|
|
|
+ $obj = ["year" => $year,
|
|
|
|
+ "name" => $name, "cardType" => null, "idCard" => $idCard, "talentArrange" => $talentArrange,
|
|
|
|
+ "spouseName" => $spouseName, "spouseIdcard" => $spouseIdcard, "childName" => $childName, "childIdCard" => $childIdCard,
|
|
|
|
+ "marryStatus" => $marryStatus, "checkState" => $checkState, "publicState" => null, "cashType" => null, "isRecover" => $isRecover, "isConflict" => $isConflict];
|
|
|
|
+ return $obj;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|