|
@@ -150,13 +150,18 @@ class TalentAllowanceApi {
|
|
* */
|
|
* */
|
|
private static function valideAllowanceType(&$info, $projectList, $monthMap, $monthAndDayMap) {
|
|
private static function valideAllowanceType(&$info, $projectList, $monthMap, $monthAndDayMap) {
|
|
$set = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
|
|
$set = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
|
|
- /* * 2.判定工作月份、五险和个税是否满足重叠6个月要求* */
|
|
|
|
- $workdaySet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_ATTENDANCE], $info, "上年度工作月份", "①");
|
|
|
|
- $pensionSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_PENSION], $info, "养老保险", "②");
|
|
|
|
- $unemploymentSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT], $info, "失业保险", "③");
|
|
|
|
- $medicaSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_MEDICA], $info, "医疗保险", "④");
|
|
|
|
- $taxSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_TAX], $info, "个税", "⑤");
|
|
|
|
|
|
+ /* * 2.判定合同月份、工作月份、五险和个税是否满足重叠6个月要求* */
|
|
|
|
+ $contractSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_CONTRACT], $info, "上年度合同月份", "①");
|
|
|
|
+ $workdaySet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_ATTENDANCE], $info, "上年度工作月份", "②");
|
|
|
|
+ $wageSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_WAGES], $info, "上年度工资发放月份", "③");
|
|
|
|
+ $pensionSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_PENSION], $info, "养老保险", "④");
|
|
|
|
+ $unemploymentSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT], $info, "失业保险", "⑤");
|
|
|
|
+ $medicaSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_SB_MEDICA], $info, "医疗保险", "⑥");
|
|
|
|
+ $taxSet = self::chkMonths($monthMap[AllowanceProjectEnum::PROJECT_TAX], $info, "个税", "⑦");
|
|
|
|
+ $set = array_intersect($set, $contractSet);
|
|
$set = array_intersect($set, $workdaySet);
|
|
$set = array_intersect($set, $workdaySet);
|
|
|
|
+ $set = array_intersect($set, $wageSet);
|
|
|
|
+ $checkSet = $set;
|
|
$set = array_intersect($set, $pensionSet);
|
|
$set = array_intersect($set, $pensionSet);
|
|
$set = array_intersect($set, $unemploymentSet);
|
|
$set = array_intersect($set, $unemploymentSet);
|
|
$set = array_intersect($set, $medicaSet);
|
|
$set = array_intersect($set, $medicaSet);
|
|
@@ -165,18 +170,18 @@ class TalentAllowanceApi {
|
|
return (int) $a - (int) $b;
|
|
return (int) $a - (int) $b;
|
|
});
|
|
});
|
|
if ($info["recommendAllowanceType"] == 1) {
|
|
if ($info["recommendAllowanceType"] == 1) {
|
|
- if (count($set) < 6) {
|
|
|
|
|
|
+ if (count($checkSet) < 6) {
|
|
//如果全部满足6个月,但是重叠时间不满足6个月,开始检测是否符合交通补贴要求
|
|
//如果全部满足6个月,但是重叠时间不满足6个月,开始检测是否符合交通补贴要求
|
|
$info["recommendAllowanceType"] = 2;
|
|
$info["recommendAllowanceType"] = 2;
|
|
- $info["recommendAllowanceMsg"][] = "社会保险、个税、上年度工作月份交集月份不满足6个月(" . implode(",", $set) . "),无法享受工作津贴(×)";
|
|
|
|
|
|
+ $info["recommendAllowanceMsg"][] = "上年度工作合同月份、考勤月份、工资发放月份交集月份不满足6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
|
|
} else {
|
|
} else {
|
|
//检查连续缴纳月份是否满足6个月
|
|
//检查连续缴纳月份是否满足6个月
|
|
$count = 1;
|
|
$count = 1;
|
|
- foreach ($set as $s) {
|
|
|
|
|
|
+ foreach ($checkSet as $s) {
|
|
$currentVal = intval($s);
|
|
$currentVal = intval($s);
|
|
$nextVal = $currentVal + 1;
|
|
$nextVal = $currentVal + 1;
|
|
$nextKey = str_pad($nextVal, 2, "0", STR_PAD_LEFT);
|
|
$nextKey = str_pad($nextVal, 2, "0", STR_PAD_LEFT);
|
|
- if (in_array($nextKey, $set)) {
|
|
|
|
|
|
+ if (in_array($nextKey, $checkSet)) {
|
|
$count++;
|
|
$count++;
|
|
if ($count >= 6) {
|
|
if ($count >= 6) {
|
|
break;
|
|
break;
|
|
@@ -187,7 +192,7 @@ class TalentAllowanceApi {
|
|
}
|
|
}
|
|
if ($count < 6) {
|
|
if ($count < 6) {
|
|
$info["recommendAllowanceType"] = 2;
|
|
$info["recommendAllowanceType"] = 2;
|
|
- $info["recommendAllowanceMsg"][] = "社会保险、个税、上年度工作月份交集月份不满足连续缴纳6个月(" . implode(",", $set) . "),无法享受工作津贴(×)";
|
|
|
|
|
|
+ $info["recommendAllowanceMsg"][] = "上年度工作合同月份、考勤月份、工资发放月份交集月份不满足连续缴纳6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -270,7 +275,7 @@ class TalentAllowanceApi {
|
|
$info["recommendMonths"] = implode(",", $recommendMonths);
|
|
$info["recommendMonths"] = implode(",", $recommendMonths);
|
|
$info["recommendAllowanceMsg"][] = "通过与人才证书有效期取交集得到最终可享受月份:";
|
|
$info["recommendAllowanceMsg"][] = "通过与人才证书有效期取交集得到最终可享受月份:";
|
|
$info["recommendAllowanceMsg"][] = "<span style='color:red;font-weight:bold;'>" . implode(",", $recommendMonths) . "</span>;";
|
|
$info["recommendAllowanceMsg"][] = "<span style='color:red;font-weight:bold;'>" . implode(",", $recommendMonths) . "</span>;";
|
|
- $info["recommendAllowanceMsg"][] = "经过计算:人才津贴为<span style='color:red;font-weight:bold;'>" . $jobMoney . "</span>;";
|
|
|
|
|
|
+ $info["recommendAllowanceMsg"][] = "经过计算:兑现月份" . count($recommendMonths) . "个月,人才津贴为<span style='color:red;font-weight:bold;'>" . $jobMoney . "</span>;";
|
|
$info["recommendMoney"] = $jobMoney;
|
|
$info["recommendMoney"] = $jobMoney;
|
|
$info["recommendMoneyDesc"] = implode("+", $msgBulider);
|
|
$info["recommendMoneyDesc"] = implode("+", $msgBulider);
|
|
|
|
|
|
@@ -328,6 +333,7 @@ class TalentAllowanceApi {
|
|
|
|
|
|
//合并所有项目的月份
|
|
//合并所有项目的月份
|
|
private static function mergeMonth($detailList) {
|
|
private static function mergeMonth($detailList) {
|
|
|
|
+ $contractList = [];
|
|
$taxList = [];
|
|
$taxList = [];
|
|
$wagesList = [];
|
|
$wagesList = [];
|
|
$pensionList = [];
|
|
$pensionList = [];
|
|
@@ -337,6 +343,10 @@ class TalentAllowanceApi {
|
|
$workdayList = [];
|
|
$workdayList = [];
|
|
foreach ($detailList as $detail) {
|
|
foreach ($detailList as $detail) {
|
|
$projectMap = $detail["projectMap"];
|
|
$projectMap = $detail["projectMap"];
|
|
|
|
+ if ($detail["months"]) {
|
|
|
|
+ $tmp = array_filter(explode(",", $detail["months"]));
|
|
|
|
+ $contractList = array_merge($contractList, $tmp);
|
|
|
|
+ }
|
|
if ($projectMap[AllowanceProjectEnum::PROJECT_TAX] && \StrUtil::isNotEmpAndNull($projectMap[AllowanceProjectEnum::PROJECT_TAX]["months"])) {
|
|
if ($projectMap[AllowanceProjectEnum::PROJECT_TAX] && \StrUtil::isNotEmpAndNull($projectMap[AllowanceProjectEnum::PROJECT_TAX]["months"])) {
|
|
$tmp = array_filter(explode(",", $projectMap[AllowanceProjectEnum::PROJECT_TAX]["months"]));
|
|
$tmp = array_filter(explode(",", $projectMap[AllowanceProjectEnum::PROJECT_TAX]["months"]));
|
|
$taxList = array_merge($taxList, $tmp);
|
|
$taxList = array_merge($taxList, $tmp);
|
|
@@ -367,6 +377,7 @@ class TalentAllowanceApi {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$map = [
|
|
$map = [
|
|
|
|
+ AllowanceProjectEnum::PROJECT_CONTRACT => $contractList,
|
|
AllowanceProjectEnum::PROJECT_TAX => $taxList,
|
|
AllowanceProjectEnum::PROJECT_TAX => $taxList,
|
|
AllowanceProjectEnum::PROJECT_WAGES => $wagesList,
|
|
AllowanceProjectEnum::PROJECT_WAGES => $wagesList,
|
|
AllowanceProjectEnum::PROJECT_SB_PENSION => $pensionList,
|
|
AllowanceProjectEnum::PROJECT_SB_PENSION => $pensionList,
|