|
@@ -41,7 +41,18 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$tpl = "indexIC";
|
|
|
break;
|
|
|
}
|
|
|
- return view($tpl, ['type' => $this->user["type"]]);
|
|
|
+ $templateFile = "gjjbtbiao.xlsx";
|
|
|
+ if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
|
|
|
+ $need_extra_project = getJsonConfig("../sys_config.json", "talent_allowance_need_extra_project");
|
|
|
+ if ($need_extra_project[$this->user["uid"]]) {
|
|
|
+ if ($need_extra_project[$this->user["uid"]][1] == AllowanceProjectEnum::PROJECT_TRAINING_PROGRAM) {
|
|
|
+ $templateFile = "gjjbtbiao_2.xlsx";
|
|
|
+ } else {
|
|
|
+ $templateFile = "gjjbtbiao_1.xlsx";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return view($tpl, ['type' => $this->user["type"], "templateFile" => $templateFile]);
|
|
|
}
|
|
|
|
|
|
public function list() {
|
|
@@ -137,7 +148,17 @@ class TalentAllowance extends EnterpriseController {
|
|
|
array_shift($rows); //去标题行
|
|
|
//检查excel文件有没有问题
|
|
|
$checkMonths = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
|
- $titles = ["姓名", "身份证", "申请补贴类型", "个税缴纳月份", "工资发放月份", "考勤情况", "养老保险", "失业保险", "医疗保险"];
|
|
|
+ $need_extra_project = getJsonConfig("../sys_config.json", "talent_allowance_need_extra_project");
|
|
|
+ if ($this->user["type"] == CommonConst::ENTERPRISE_GJ) {
|
|
|
+ $titles = ["姓名", "身份证", "申请补贴类型", "个税缴纳月份", "工资发放月份", "考勤情况", "养老保险"];
|
|
|
+ if ($need_extra_project[$this->user["uid"]]) {
|
|
|
+ for ($i = 0; $i < count($need_extra_project[$this->user["uid"]]); $i++) {
|
|
|
+ $titles[] = AllowanceProjectEnum::getProjectName($need_extra_project[$this->user["uid"]][$i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $titles = ["姓名", "身份证", "申请补贴类型", "个税缴纳月份", "工资发放月份", "考勤情况", "养老保险", "失业保险", "医疗保险"];
|
|
|
+ }
|
|
|
$allowanceTypes = ["工作津贴", "一次性交通补贴"];
|
|
|
$idCards = [];
|
|
|
foreach ($rows as $key => $row) {
|
|
@@ -156,7 +177,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
return \StrUtil::back(new Response(Response::ERROR, sprintf("第%d行申请补贴类型错误,请仔细检查内容无误后再重新提交", $no)), "TalentAllowanceInfo.importCallBack");
|
|
|
}
|
|
|
if ($allowanceType == "工作津贴") {
|
|
|
- $projects = AllowanceProjectEnum::getProjectsByEnterpriseType($this->user["type"]);
|
|
|
+ $projects = AllowanceProjectEnum::getProjectsByEnterpriseType($this->user["type"], $this->user["uid"]);
|
|
|
for ($i = 3; $i < 9; $i++) {
|
|
|
$project = 1;
|
|
|
switch ($i) {
|
|
@@ -173,10 +194,18 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$project = AllowanceProjectEnum::PROJECT_SB_PENSION;
|
|
|
break;
|
|
|
case 7:
|
|
|
- $project = AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT;
|
|
|
+ if ($this->user["type"] == CommonConst::ENTERPRISE_GJ && $need_extra_project[$this->user["uid"]]) {
|
|
|
+ $project = $need_extra_project[$this->user["uid"]][0];
|
|
|
+ } else {
|
|
|
+ $project = AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT;
|
|
|
+ }
|
|
|
break;
|
|
|
case 8:
|
|
|
- $project = AllowanceProjectEnum::PROJECT_SB_MEDICA;
|
|
|
+ if ($this->user["type"] == CommonConst::ENTERPRISE_GJ && $need_extra_project[$this->user["uid"]]) {
|
|
|
+ $project = $need_extra_project[$this->user["uid"]][1];
|
|
|
+ } else {
|
|
|
+ $project = AllowanceProjectEnum::PROJECT_SB_MEDICA;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
if (!in_array($project, $projects))
|
|
@@ -642,7 +671,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$count = 0;
|
|
|
foreach ($contractList as $detail) {
|
|
|
$count++;
|
|
|
- $projects = AllowanceProjectEnum::getProjectsByEnterpriseType($info["type"]);
|
|
|
+ $projects = AllowanceProjectEnum::getProjectsByEnterpriseType($info["type"], $info["enterpriseId"]);
|
|
|
$list = [];
|
|
|
foreach ($projects as $project) {
|
|
|
$months = "";
|
|
@@ -703,6 +732,9 @@ class TalentAllowance extends EnterpriseController {
|
|
|
AllowanceProjectEnum::PROJECT_SB_PENSION,
|
|
|
AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT,
|
|
|
AllowanceProjectEnum::PROJECT_SB_MEDICA,
|
|
|
+ AllowanceProjectEnum::PROJECT_TEACHING,
|
|
|
+ AllowanceProjectEnum::PROJECT_LESSON,
|
|
|
+ AllowanceProjectEnum::PROJECT_TRAINING_PROGRAM,
|
|
|
//AllowanceProjectEnum::PROJECT_WORKDAY
|
|
|
]) ? 1 : 2;
|
|
|
} else if ($info["checkState"] == 10 || $info["checkState"] == 8) {
|