Эх сурвалжийг харах

集成电路企业如果identifyMonth在批次年份之前就可以保存

sugangqiang 11 сар өмнө
parent
commit
513207558e

+ 19 - 3
app/enterprise/controller/TalentAllowance.php

@@ -277,8 +277,17 @@ class TalentAllowance extends EnterpriseController {
             /*             * 1.获取上一年度的人才层次 */
             $arrangeList = $this->getLastYearTalentType($data, $ti);
             if (!$arrangeList) {
-                $response->msg = "上一年度暂无有效的人才层次";
-                return $response;
+                if ($ti["enterpriseType"] == CommonConst::ENTERPRISE_JC) {
+                    $batchYear = substr($data["year"], 0, 4);
+                    $identifyYear = substr($data["identifyMonth"], 0, 4);
+                    if (!$batchYear || !$identifyYear || $identifyYear > $batchYear) {
+                        $response->msg = "上一年度暂无有效的人才层次";
+                        return $response;
+                    }
+                } else {
+                    $response->msg = "上一年度暂无有效的人才层次";
+                    return $response;
+                }
             }
             /*             * 2.获取上一年度所在单位* */
             $contractDetailList = $this->getConcatList($ti, $data, $year); //保存上一年度的工作单位
@@ -338,7 +347,14 @@ class TalentAllowance extends EnterpriseController {
         /*         * 1.获取上一年度的人才层次 */
         $arrangeList = $this->getLastYearTalentType($data, $ti);
         if (!$arrangeList) {
-            return new Response(Response::ERROR, "该人员上一年度暂无有效的人才层次");
+            if ($ti["enterpriseType"] == CommonConst::ENTERPRISE_JC) {
+                $identifyYear = substr($ti["identifyMonth"], 0, 4);
+                if (!$year || !$identifyYear || $identifyYear > $year) {
+                    return new Response(Response::ERROR, "该人员上一年度暂无有效的人才层次");
+                }
+            } else {
+                return new Response(Response::ERROR, "该人员上一年度暂无有效的人才层次");
+            }
         }
         /*         * 2.获取上一年度所在单位* */
         $contractDetailList = $this->getConcatList($ti, $data, $year); //保存上一年度的工作单位

+ 8 - 1
app/job/TalentAllowance.php

@@ -132,7 +132,14 @@ class TalentAllowance {
                     /*                     * 1.获取上一年度的人才层次 */
                     $arrangeList = $this->getLastYearTalentType($data, $ti);
                     if (!$arrangeList) {
-                        return false;
+                        if ($ti["enterpriseType"] == \app\common\state\CommonConst::ENTERPRISE_JC) {
+                            $identifyYear = substr($ti["identifyMonth"], 0, 4);
+                            if (!$year || !$identifyYear || $identifyYear > $year) {
+                                return false;
+                            }
+                        } else {
+                            return false;
+                        }
                     }
                     /*                     * 2.获取上一年度所在单位* */
                     $contractDetailList = $this->getConcatList($ti, $data, $year); //保存上一年度的工作单位