|
@@ -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"];
|