Переглянути джерело

修改津补贴卫健月份交集计算方法

sugangqiang 2 днів тому
батько
коміт
cb2b7f2d66

+ 15 - 16
app/admin/controller/TalentAllowance.php

@@ -240,7 +240,7 @@ class TalentAllowance extends AdminController {
                         });
                         $newObj["recommendMonths"] = implode(",", $set);
                         $typeName = "人工判定:津补贴类型(" . (\app\common\state\AllowanceTypeEnum::getTypeName($newObj["recommendAllowanceType"])) . ");享受月份:" . $newObj["recommendMonths"] . ";\n";
-                    }else{
+                    } else {
                         $typeName = "人工判定:津补贴类型(" . (\app\common\state\AllowanceTypeEnum::getTypeName($newObj["recommendAllowanceType"])) . ");\n";
                     }
                     $newObj["recommendAllowanceMsg"] = $typeName . "判定说明:\n" . $obj["resAllowanceMsg"] . ";";
@@ -367,9 +367,9 @@ class TalentAllowance extends AdminController {
                     case 3:
                         $updCheck["checkState"] = AllowanceStateEnum::REVIEW_PASS;
                         $updCheck["reviewPassTime"] = date("Y-m-d H:i:s");
-                        $old = TalentAllowanceApi::getInfoById($id);//20240915增加判定是否人工认定,如果人工认定不再走系统计算
-                        if(strpos($old['recommendAllowanceMsg'],"人工判定") === false){
-                            /*                         * * 在此处需要判断津补贴类型 */
+                        $old = TalentAllowanceApi::getInfoById($id); //20240915增加判定是否人工认定,如果人工认定不再走系统计算
+                        if (strpos($old['recommendAllowanceMsg'], "人工判定") === false) {
+                            /*                             * * 在此处需要判断津补贴类型 */
                             $arrangeList = $this->validateAllowanceType($updCheck);
                             $taaModel = new TalentAllowanceArrange();
                             $taaModel->saveAll($arrangeList);
@@ -504,7 +504,7 @@ class TalentAllowance extends AdminController {
             case 2:
                 $where[] = ["publicState", "=", 1];
                 $where[] = ["checkState", "in", [-1, 30]];
-                $where[] = ['recommendAllowanceType',"in", [1, 2]];
+                $where[] = ['recommendAllowanceType', "in", [1, 2]];
                 $error = "暂无可核查征信的数据";
                 break;
             case 3:
@@ -1146,7 +1146,7 @@ class TalentAllowance extends AdminController {
             //组装数据
             if (!$tmpList[$item["id"]]) {
                 $tmpList[$item["id"]]["curEnterpriseId"] = $item["curEnterpriseId"];
-                $tmpList[$item["id"]]["info"] = [$item["year"], $streetMap[$item["address"]], $item["name"], $item["sex"] == 1 ? "男" : "女", $item["idCard"],$item['bank'],$item['bankNumber'],$item['bankNetwork'],$item['bankAccount'], $levelMap[$item["talentArrange"]],
+                $tmpList[$item["id"]]["info"] = [$item["year"], $streetMap[$item["address"]], $item["name"], $item["sex"] == 1 ? "男" : "女", $item["idCard"], $item['bank'], $item['bankNumber'], $item['bankNetwork'], $item['bankAccount'], $levelMap[$item["talentArrange"]],
                     $icmap[$item["identifyCondition"]], $item["identifyGetTime"], $item["identifyConditionName"], $item["identifyMonth"], AllowanceTypeEnum::getTypeName($item["recommendAllowanceType"]), $item["recommendMonths"], $item["recommendMoney"],
                     $item["recommendMoneyDesc"], $item["otherEnjoyedMoney"], $item["otherEnjoyedDescription"] ?: "", AllowanceTypeEnum::getTypeName($item["allowanceType"]), $item["months"], $item["money"],
                     $item["moneyDesc"], $this->getCheckStateName($item["checkState"], $item["publicState"], $item["allowanceType"]), $item["checkMsg"]];
@@ -1355,12 +1355,14 @@ class TalentAllowance extends AdminController {
                     }
                 }
             } else {
-                if (count($checkSet) < 6) {
+                $checkDayCount = $info["type"] == CommonConst::ENTERPRISE_WJ ? 9 : 6; //卫健需要连续交集9个月
+                if (count($checkSet) < $checkDayCount) {
                     //如果全部满足6个月,但是重叠时间不满足6个月,开始检测是否符合交通补贴要求
                     $info["recommendAllowanceType"] = 3;
-                    $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n上年度{$str}交集月份不满足6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
-                } else {
-                    //检查连续缴纳月份是否满足6个月
+                    $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n上年度{$str}交集月份不满足{$checkDayCount}个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
+                }
+                if ($info["type"] == CommonConst::ENTERPRISE_WJ) {
+                    //检查连续缴纳月份是否满足9个月
                     $count = 1;
                     foreach ($checkSet as $s) {
                         $currentVal = intval($s);
@@ -1368,16 +1370,16 @@ class TalentAllowance extends AdminController {
                         $nextKey = str_pad($nextVal, 2, "0", STR_PAD_LEFT);
                         if (in_array($nextKey, $checkSet)) {
                             $count++;
-                            if ($count >= 6) {
+                            if ($count >= $checkDayCount) {
                                 break;
                             }
                         } else {
                             $count = 1;
                         }
                     }
-                    if ($count < 6) {
+                    if ($count < $checkDayCount) {
                         $info["recommendAllowanceType"] = 3;
-                        $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n上年度{$str}不满足连续缴纳6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
+                        $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n上年度{$str}不满足连续缴纳{$checkDayCount}个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
                     }
                 }
             }
@@ -1720,7 +1722,6 @@ class TalentAllowance extends AdminController {
             $res["projects"] = $projectList;
             $res["concats"] = $detailList;
             $res["calResult"] = TalentAllowanceApi::validateAllowanceType($id);
-
         }
 
 
@@ -1735,8 +1736,6 @@ class TalentAllowance extends AdminController {
         }
         $res["detailList"] = $detailList;
 
-
-
         return new Response(Response::SUCCESS, "不在审核范围内", $res);
     }
 

+ 9 - 7
app/common/api/TalentAllowanceApi.php

@@ -325,12 +325,14 @@ class TalentAllowanceApi {
                     }
                 }
             } else {
-                if (count($checkSet) < 6) {
+                $checkDayCount = $info["type"] == CommonConst::ENTERPRISE_WJ ? 9 : 6; //卫健需要连续交集9个月
+                if (count($checkSet) < $checkDayCount) {
                     //如果全部满足6个月,但是重叠时间不满足6个月,开始检测是否符合交通补贴要求
                     $info["recommendAllowanceType"] = 3;
-                    $info["recommendAllowanceMsg"][] = "上年度{$str}交集月份不满足6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
-                } else {
-                    //检查连续缴纳月份是否满足6个月
+                    $info["recommendAllowanceMsg"][] = "上年度{$str}交集月份不满足{$checkDayCount}个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
+                }
+                if ($info["type"] == CommonConst::ENTERPRISE_WJ) {
+                    //检查连续缴纳月份是否满足9个月
                     $count = 1;
                     foreach ($checkSet as $s) {
                         $currentVal = intval($s);
@@ -338,16 +340,16 @@ class TalentAllowanceApi {
                         $nextKey = str_pad($nextVal, 2, "0", STR_PAD_LEFT);
                         if (in_array($nextKey, $checkSet)) {
                             $count++;
-                            if ($count >= 6) {
+                            if ($count >= $checkDayCount) {
                                 break;
                             }
                         } else {
                             $count = 1;
                         }
                     }
-                    if ($count < 6) {
+                    if ($count < $checkDayCount) {
                         $info["recommendAllowanceType"] = 3;
-                        $info["recommendAllowanceMsg"][] = "上年度{$str}交集月份不满足连续缴纳6个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
+                        $info["recommendAllowanceMsg"][] = "上年度{$str}交集月份不满足连续缴纳{$checkDayCount}个月(" . implode(",", $checkSet) . "),无法享受工作津贴(×)";
                     }
                 }
             }