瀏覽代碼

津补贴申报增加前置判定条件,必须要人才认定的时间早于津补贴的申报年份,高教和卫健2023年不参与判断

sugangqiang 1 年之前
父節點
當前提交
3784b27a86
共有 2 個文件被更改,包括 34 次插入9 次删除
  1. 21 5
      app/enterprise/controller/TalentAllowance.php
  2. 13 4
      app/job/TalentAllowance.php

+ 21 - 5
app/enterprise/controller/TalentAllowance.php

@@ -265,6 +265,15 @@ class TalentAllowance extends EnterpriseController {
                 "wage" => $param["wage"],
                 "allowanceType" => $param["allowanceType"]
             ];
+
+            $submitTime = $ti["first_submit_time"] ? $ti["first_submit_time"] : $ti["new_submit_time"];
+            $identifyYear = date("Y", strtotime($submitTime));
+            $year = substr($param["year"], 0, 4);
+            if ((($ti["enterpriseType"] == CommonConst::ENTERPRISE_JC) || (in_array($ti["enterpriseType"], [CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]) && $year != 2023)) && $identifyYear > $year) {
+                $response->msg = "该人员的人才认定时间晚于申报津补贴的年份,不符合申报条件";
+                return $response;
+            }
+
             /*             * 1.获取上一年度的人才层次 */
             $arrangeList = $this->getLastYearTalentType($data, $ti);
             if (!$arrangeList) {
@@ -272,7 +281,7 @@ class TalentAllowance extends EnterpriseController {
                 return $response;
             }
             /*             * 2.获取上一年度所在单位* */
-            $contractDetailList = $this->getConcatList($ti, $data, $param["year"]); //保存上一年度的工作单位
+            $contractDetailList = $this->getConcatList($ti, $data, $year); //保存上一年度的工作单位
             if (!$contractDetailList) {
                 $response->msg = "申报失败,原因为:申报年度不存在有效的工作单位";
                 return $response;
@@ -320,6 +329,12 @@ class TalentAllowance extends EnterpriseController {
             "id" => getStringId(),
             "type" => $ti["enterpriseType"]
         ];
+        $submitTime = $ti["first_submit_time"] ? $ti["first_submit_time"] : $ti["new_submit_time"];
+        $identifyYear = date("Y", strtotime($submitTime));
+        $year = substr($year, 0, 4);
+        if ((($ti["enterpriseType"] == CommonConst::ENTERPRISE_JC) || (in_array($ti["enterpriseType"], [CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]) && $year != 2023)) && $identifyYear > $year) {
+            return new Response(Response::ERROR, "该人员的人才认定时间晚于申报津补贴的年份,不符合申报条件");
+        }
         /*         * 1.获取上一年度的人才层次 */
         $arrangeList = $this->getLastYearTalentType($data, $ti);
         if (!$arrangeList) {
@@ -401,6 +416,7 @@ class TalentAllowance extends EnterpriseController {
     /*     * 获取上一年度的人才层次变更信息 */
 
     private function getLastYearTalentType($info, $talentInfo) {
+        $year = substr($info["year"], 0, 4);
         $arrangeList = [];
         /*         * * 添加人才层次记录 */
         $oldStartTimeField = "oldIdentifyMonth";
@@ -417,7 +433,7 @@ class TalentAllowance extends EnterpriseController {
         $where[] = ["idCard", "=", $info["idCard"]];
         $where[] = ["checkState", "=", MainState::PASS];
         $where[] = ["isPublic", ">=", 5];
-        $where[] = [$oldStartTimeField, "<=", $info["year"] . "-12-31"];
+        $where[] = [$oldStartTimeField, "<=", $year . "-12-31"];
         $typeList = TalentTypeChange::where($where)->field("oldTalentArrange,oldIdentifyCondition,oldIdentifyGetTime,oldIdentifyOutTime,oldIdentifyMonth,oldCertificateStartTime,oldCertificateOutTime,newIdentifyMonth,newIdentifyGetTime")->order("createTime desc")->select()->toArray();
 
         $typeList[] = [
@@ -428,10 +444,10 @@ class TalentAllowance extends EnterpriseController {
             "oldIdentifyMonth" => $talentInfo["identifyMonth"],
             "oldCertificateStartTime" => $talentInfo["certificateGetTime"],
             "oldCertificateOutTime" => $talentInfo["certificateExpireTime"],
-            "newIdentifyMonth" => $info["year"] . "-12-31",
-            "newIdentifyGetTime" => $info["year"] . "-12-31"
+            "newIdentifyMonth" => $year . "-12-31",
+            "newIdentifyGetTime" => $year . "-12-31"
         ];
-        $totalMonth = \DateUtil::getMonthBetweenDates($info["year"] . "-01-01", $info["year"] . "-12-31");
+        $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
         /*         * 获取上一年度有效的人才层次 */
         usort($typeList, function($a, $b) {
             return (int) $b["oldTalentArrange"] - (int) $a["oldTalentArrange"];

+ 13 - 4
app/job/TalentAllowance.php

@@ -121,6 +121,14 @@ class TalentAllowance {
                         "id" => getStringId(),
                         "allowanceType" => $allowanceType
                     ];
+
+                    $submitTime = $ti["first_submit_time"] ? $ti["first_submit_time"] : $ti["new_submit_time"];
+                    $identifyYear = date("Y", strtotime($submitTime));
+                    $year = substr($year, 0, 4);
+                    if ((($ti["enterpriseType"] == \app\common\state\CommonConst::ENTERPRISE_JC) || (in_array($ti["enterpriseType"], [\app\common\state\CommonConst::ENTERPRISE_WJ, \app\common\state\CommonConst::ENTERPRISE_GJ]) && $year != 2023)) && $identifyYear > $year) {
+                        return false;
+                    }
+
                     /*                     * 1.获取上一年度的人才层次 */
                     $arrangeList = $this->getLastYearTalentType($data, $ti);
                     if (!$arrangeList) {
@@ -169,6 +177,7 @@ class TalentAllowance {
     /*     * 获取上一年度的人才层次变更信息 */
 
     private function getLastYearTalentType($info, $talentInfo) {
+        $year = substr($info["year"], 0, 4);
         $arrangeList = [];
         /*         * * 添加人才层次记录 */
         $oldStartTimeField = "oldIdentifyMonth";
@@ -185,7 +194,7 @@ class TalentAllowance {
         $where[] = ["idCard", "=", $info["idCard"]];
         $where[] = ["checkState", "=", MainState::PASS];
         $where[] = ["isPublic", ">=", 5];
-        $where[] = [$oldStartTimeField, "<=", $info["year"] . "-12-31"];
+        $where[] = [$oldStartTimeField, "<=", $year . "-12-31"];
         $typeList = TalentTypeChange::where($where)->field("oldTalentArrange,oldIdentifyCondition,oldIdentifyGetTime,oldIdentifyOutTime,oldIdentifyMonth,oldCertificateStartTime,oldCertificateOutTime,newIdentifyMonth,newIdentifyGetTime")->order("createTime desc")->select()->toArray();
         $typeList[] = [
             "oldTalentArrange" => $talentInfo["talent_arrange"],
@@ -195,10 +204,10 @@ class TalentAllowance {
             "oldIdentifyMonth" => $talentInfo["identifyMonth"],
             "oldCertificateStartTime" => $talentInfo["certificateGetTime"],
             "oldCertificateOutTime" => $talentInfo["certificateExpireTime"],
-            "newIdentifyMonth" => $info["year"] . "-12-31",
-            "newIdentifyGetTime" => $info["year"] . "-12-31"
+            "newIdentifyMonth" => $year . "-12-31",
+            "newIdentifyGetTime" => $year . "-12-31"
         ];
-        $totalMonth = \DateUtil::getMonthBetweenDates($info["year"] . "-01-01", $info["year"] . "-12-31");
+        $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
         /*         * 获取上一年度有效的人才层次 */
         usort($typeList, function($a, $b) {
             return (int) $b["oldTalentArrange"] - (int) $a["oldTalentArrange"];