|
@@ -182,6 +182,13 @@ class TalentAllowance extends AdminController {
|
|
|
$fileList = array_filter(explode(",", $obj["files"]));
|
|
|
$newObj["files"] = implode(",", $fileList);
|
|
|
}
|
|
|
+ if ($obj["process"] == 1 && $oldObj["type"] == CommonConst::ENTERPRISE_GJ && $obj["checkState"] == 3) {
|
|
|
+ $newObj["otherEnjoyedMoney"] = $obj["otherEnjoyedMoney"];
|
|
|
+ $newObj["otherEnjoyedDescription"] = $obj["otherEnjoyedDescription"];
|
|
|
+ } else {
|
|
|
+ $newObj["otherEnjoyedMoney"] = 0.00;
|
|
|
+ $newObj["otherEnjoyedDescription"] = null;
|
|
|
+ }
|
|
|
//if (Const.RSJ.equals(checkCompany.getCode())) {
|
|
|
$newObj["concats"] = $obj["concats"];
|
|
|
$newObj["fields"] = $obj["fields"];
|
|
@@ -697,7 +704,7 @@ class TalentAllowance extends AdminController {
|
|
|
];
|
|
|
return new Response(Response::SUCCESS, "计算成功", $res);
|
|
|
} catch (\think\Exception $e) {
|
|
|
- return new Response(Response::ERROR, "系统异常,请联系管理员");
|
|
|
+ return new Response(Response::ERROR, "系统异常,请联系管理员:" . $e->getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -768,7 +775,7 @@ class TalentAllowance extends AdminController {
|
|
|
$data["allowanceType"] = $old["recommendAllowanceType"];
|
|
|
$data["allowanceMsg"] = $old["recommendAllowanceMsg"];
|
|
|
$data["months"] = $old["recommendMonths"];
|
|
|
- $data["money"] = $old["recommendMoney"];
|
|
|
+ $data["money"] = $old["recommendMoney"] - $old["otherEnjoyedMoney"];
|
|
|
$data["moneyDesc"] = $old["recommendMoneyDesc"];
|
|
|
$data["jtTalentArrange"] = $old["recommendTalentArrange"];
|
|
|
$data["workAllowanceMoney"] = $old["workAllowanceMoney"];
|
|
@@ -838,12 +845,12 @@ class TalentAllowance extends AdminController {
|
|
|
$upd["allowanceMsg"] = $obj["recommendAllowanceMsg"];
|
|
|
if ($upd["allowanceType"] == 1) {
|
|
|
$upd["months"] = $obj["recommendMonths"];
|
|
|
- $upd["money"] = $obj["recommendMoney"];
|
|
|
+ $upd["money"] = $obj["recommendMoney"] - $obj["otherEnjoyedMoney"];
|
|
|
$upd["moneyDesc"] = $obj["recommendMoneyDesc"];
|
|
|
} else if ($upd["allowanceType"] == 2) {
|
|
|
$upd["months"] = "";
|
|
|
$upd["jtTalentArrange"] = $obj["recommendTalentArrange"];
|
|
|
- $upd["money"] = $obj["recommendMoney"];
|
|
|
+ $upd["money"] = $obj["recommendMoney"] - $obj["otherEnjoyedMoney"];
|
|
|
$upd["moneyDesc"] = $obj["recommendMoneyDesc"];
|
|
|
$upd["workAllowanceMoney"] = null;
|
|
|
$upd["developAllowanceMoney"] = null;
|
|
@@ -1049,13 +1056,13 @@ class TalentAllowance extends AdminController {
|
|
|
for ($m = 1; $m <= 12; $m++) {
|
|
|
$months[] = $m . "月";
|
|
|
}
|
|
|
- $columns = [["年度", [1, 2]], ["所属镇街", [1, 2]], ["姓名", [1, 2]], ["性别", [1, 2]], ["证件号码", [1, 2]], ["人才层次", [1, 2]], ["认定条件", [1, 2]], ["认定条件取得时间", [1, 2]], ["认定条件名称", [1, 2]], ["公布入选月份", [1, 2]], ["拟认定津补贴类型", [1, 2]], ["拟兑现月份", [1, 2]], ["拟兑现金额", [1, 2]], ["拟兑现金额说明", [1, 2]], ["津补贴类型", [1, 2]], ["兑现月份", [1, 2]], ["兑现金额", [1, 2]], ["金额说明", [1, 2]], ["审核状态", [1, 2]], ["缴纳单位", [1, 2]]];
|
|
|
+ $columns = [["年度", [1, 2]], ["所属镇街", [1, 2]], ["姓名", [1, 2]], ["性别", [1, 2]], ["证件号码", [1, 2]], ["人才层次", [1, 2]], ["认定条件", [1, 2]], ["认定条件取得时间", [1, 2]], ["认定条件名称", [1, 2]], ["公布入选月份", [1, 2]], ["拟认定津补贴类型", [1, 2]], ["拟兑现月份", [1, 2]], ["拟兑现金额", [1, 2]], ["拟兑现金额说明", [1, 2]], ["其它补贴金额", [1, 2]], ["其它补贴说明", [1, 2]], ["津补贴类型", [1, 2]], ["兑现月份", [1, 2]], ["兑现金额", [1, 2]], ["金额说明", [1, 2]], ["审核状态", [1, 2]], ["缴纳单位", [1, 2]]];
|
|
|
$infoCols = count($columns);
|
|
|
for ($i = 0; $i < count($projects); $i++) {
|
|
|
$columns[] = [AllowanceProjectEnum::getProjectName($projects[$i]), $months];
|
|
|
}
|
|
|
$list = \app\common\model\TalentAllowanceProject::alias("pro")
|
|
|
- ->field("ta.id,ta.year,ta.enterpriseId as curEnterpriseId,ta.address,ta.name,ta.sex,ta.idCard,ta.talentArrange,ta.identifyCondition,ta.identifyGetTime,ta.identifyConditionName,ta.identifyMonth,ta.recommendAllowanceType,ta.recommendMonths,ta.recommendMoney,ta.recommendMoneyDesc,ta.allowanceType,ta.months,ta.money,ta.moneyDesc,ta.checkState,ta.publicState,pro.project,pro.months as pre_months,con.enterpriseId,con.startTime,con.endTime,con.entryTime,con.quitTime,con.isQuit")
|
|
|
+ ->field("ta.id,ta.year,ta.enterpriseId as curEnterpriseId,ta.address,ta.name,ta.sex,ta.idCard,ta.talentArrange,ta.identifyCondition,ta.identifyGetTime,ta.identifyConditionName,ta.identifyMonth,ta.recommendAllowanceType,ta.recommendMonths,ta.recommendMoney,ta.recommendMoneyDesc,ta.otherEnjoyedMoney,ta.otherEnjoyedDescription,ta.allowanceType,ta.months,ta.money,ta.moneyDesc,ta.checkState,ta.publicState,pro.project,pro.months as pre_months,con.enterpriseId,con.startTime,con.endTime,con.entryTime,con.quitTime,con.isQuit")
|
|
|
->leftJoin("un_talent_allowance_info ta", "ta.id=pro.mainId")
|
|
|
->leftJoin("un_talent_allowancecontract_detail con", "pro.baseId=con.id")
|
|
|
->where($where)
|
|
@@ -1078,7 +1085,7 @@ class TalentAllowance extends AdminController {
|
|
|
$tmpList[$item["id"]]["curEnterpriseId"] = $item["curEnterpriseId"];
|
|
|
$tmpList[$item["id"]]["info"] = [$item["year"], $streetMap[$item["address"]], $item["name"], $item["sex"] == 1 ? "男" : "女", $item["idCard"], $levelMap[$item["talentArrange"]],
|
|
|
$icmap[$item["identifyCondition"]], $item["identifyGetTime"], $item["identifyConditionName"], $item["identifyMonth"], AllowanceTypeEnum::getTypeName($item["recommendAllowanceType"]), $item["recommendMonths"], $item["recommendMoney"],
|
|
|
- $item["recommendMoneyDesc"], AllowanceTypeEnum::getTypeName($item["allowanceType"]), $item["months"], $item["money"],
|
|
|
+ $item["recommendMoneyDesc"], $item["otherEnjoyedMoney"], $item["otherEnjoyedDescription"] ?: "", AllowanceTypeEnum::getTypeName($item["allowanceType"]), $item["months"], $item["money"],
|
|
|
$item["moneyDesc"], $this->getCheckStateName($item["checkState"], $item["publicState"], $item["allowanceType"])];
|
|
|
}
|
|
|
if (!$tmpList[$item["id"]]["enterprise"][$item["enterpriseId"]]) {
|
|
@@ -1177,6 +1184,8 @@ class TalentAllowance extends AdminController {
|
|
|
$info["backWork"] = $old["backWork"];
|
|
|
$info["recommendAllowanceType"] = $old["allowanceType"];
|
|
|
$info["recommendAllowanceMsg"] = "";
|
|
|
+ $info["otherEnjoyedMoney"] = $old["otherEnjoyedMoney"];
|
|
|
+ $info["otherEnjoyedDescription"] = $old["otherEnjoyedDescription"];
|
|
|
$projectList = \app\common\model\TalentAllowanceProject::where("mainId", $info["id"])->select()->toArray();
|
|
|
$set = $this->valideAllowanceType($info, $projectList, $monthMap, $monthAndDayMap);
|
|
|
$info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n综合以上所有判断得到最终补贴类型为:";
|
|
@@ -1215,35 +1224,35 @@ class TalentAllowance extends AdminController {
|
|
|
$set = array_intersect($set, $contractSet);
|
|
|
$set = array_intersect($set, $workdaySet);
|
|
|
$checkSet = $set;
|
|
|
- $set = array_intersect($set, $pensionSet);
|
|
|
- $set = array_intersect($set, $taxSet);
|
|
|
+ //$set = array_intersect($set, $pensionSet);
|
|
|
+ //$set = array_intersect($set, $taxSet);
|
|
|
} else if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
|
|
|
if ($info["backWork"] == 1) {
|
|
|
$str = "工资发放月份、个税缴交月份";
|
|
|
$set = array_intersect($set, $wageSet);
|
|
|
$set = array_intersect($set, $taxSet);
|
|
|
$checkSet = $set;
|
|
|
- $set = array_intersect($set, $contractSet);
|
|
|
- $set = array_intersect($set, $pensionSet);
|
|
|
- $set = array_intersect($set, $workdaySet);
|
|
|
+ //$set = array_intersect($set, $contractSet);
|
|
|
+ //$set = array_intersect($set, $pensionSet);
|
|
|
+ //$set = array_intersect($set, $workdaySet);
|
|
|
} else {
|
|
|
$str = "养老保险缴交月份、工资发放月份、个税缴交月份";
|
|
|
$set = array_intersect($set, $pensionSet);
|
|
|
$set = array_intersect($set, $wageSet);
|
|
|
$set = array_intersect($set, $taxSet);
|
|
|
$checkSet = $set;
|
|
|
- $set = array_intersect($set, $contractSet);
|
|
|
- $set = array_intersect($set, $workdaySet);
|
|
|
+ //$set = array_intersect($set, $contractSet);
|
|
|
+ //$set = array_intersect($set, $workdaySet);
|
|
|
}
|
|
|
} else {
|
|
|
$set = array_intersect($set, $contractSet);
|
|
|
$set = array_intersect($set, $workdaySet);
|
|
|
$set = array_intersect($set, $wageSet);
|
|
|
$checkSet = $set;
|
|
|
- $set = array_intersect($set, $pensionSet);
|
|
|
- $set = array_intersect($set, $unemploymentSet);
|
|
|
- $set = array_intersect($set, $medicaSet);
|
|
|
- $set = array_intersect($set, $taxSet);
|
|
|
+ //$set = array_intersect($set, $pensionSet);
|
|
|
+ //$set = array_intersect($set, $unemploymentSet);
|
|
|
+ //$set = array_intersect($set, $medicaSet);
|
|
|
+ //$set = array_intersect($set, $taxSet);
|
|
|
}
|
|
|
usort($set, function($a, $b) {
|
|
|
return (int) $a - (int) $b;
|
|
@@ -1357,8 +1366,11 @@ class TalentAllowance extends AdminController {
|
|
|
}unset($arrange);
|
|
|
$info["recommendMonths"] = implode(",", $recommendMonths);
|
|
|
$info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "通过与{$identifyExpiredName}取交集得到最终可享受月份:" . implode(",", $recommendMonths) . "\n经过计算:人才津贴为" . $jobMoney . ";";
|
|
|
+ if ($info["otherEnjoyedMoney"] != 0) {
|
|
|
+ $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n" . "扣除其它补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "元";
|
|
|
+ }
|
|
|
$info["recommendMoney"] = $jobMoney;
|
|
|
- $info["recommendMoneyDesc"] = implode("+", $msgBulider);
|
|
|
+ $info["recommendMoneyDesc"] = implode("+", $msgBulider) . ($info["otherEnjoyedMoney"] != 0 ? sprintf("-%s(其它补贴金额)", number_format($info["otherEnjoyedMoney"], 2)) : "");
|
|
|
|
|
|
break;
|
|
|
case 2:
|
|
@@ -1372,6 +1384,10 @@ class TalentAllowance extends AdminController {
|
|
|
$info["workAllowanceMoney"] = 0.00;
|
|
|
$info["developAllowanceMoney"] = 0.00;
|
|
|
$info["recommendTalentArrange"] = $talentArrange;
|
|
|
+ if ($info["otherEnjoyedMoney"] != 0) {
|
|
|
+ $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n" . "扣除其它补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "元";
|
|
|
+ }
|
|
|
+ $info["recommendMoneyDesc"] = $info["otherEnjoyedMoney"] != 0 ? sprintf("-%s(其它补贴金额)", number_format($info["otherEnjoyedMoney"], 2)) : "";
|
|
|
break;
|
|
|
case 3:
|
|
|
$info["recommendMoney"] = 0.00;
|
|
@@ -1409,6 +1425,13 @@ class TalentAllowance extends AdminController {
|
|
|
if ($info["type"] == CommonConst::ENTERPRISE_WJ) {
|
|
|
$preCheckProjects = ["①", "②"];
|
|
|
}
|
|
|
+ if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
|
|
|
+ if ($info["backWork"] == 1) {
|
|
|
+ $preCheckProjects = ["③", "⑦"];
|
|
|
+ } else {
|
|
|
+ $preCheckProjects = ["③", "④", "⑦"];
|
|
|
+ }
|
|
|
+ }
|
|
|
if ($info["recommendAllowanceType"] == 1 && (!$set || count($set) < 6) && in_array($sort, $preCheckProjects)) {
|
|
|
$info["recommendAllowanceType"] = 3;
|
|
|
$info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . $sort . $name . "不足6个月,无法享受工作津贴(×)";
|
|
@@ -1598,12 +1621,7 @@ class TalentAllowance extends AdminController {
|
|
|
$res["files"] = $filetypes;
|
|
|
$res["projects"] = $projectList;
|
|
|
$res["concats"] = $detailList;
|
|
|
- if ($process == 1) {
|
|
|
- $standard = \app\common\api\AmountStandardApi::getStandard($info["type"], $info["allowanceType"], $info["talentArrange"]);
|
|
|
-
|
|
|
- $res["calResult"] = TalentAllowanceApi::validateAllowanceType($id);
|
|
|
- $res["calResult"]["money"] = $standard ? $standard["money"] : 0;
|
|
|
- }
|
|
|
+ $res["calResult"] = TalentAllowanceApi::validateAllowanceType($id);
|
|
|
}
|
|
|
return new Response(Response::SUCCESS, "不在审核范围内", $res);
|
|
|
}
|