|
@@ -73,6 +73,16 @@ class TalentAllowance extends EnterpriseController {
|
|
|
return $response;
|
|
|
}
|
|
|
if (!$param["id"]) {
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["year", "=", $param["year"]];
|
|
|
+ $where[] = ["idCard", "=", $param["idCard"]];
|
|
|
+ $where[] = ["checkState", "not in", [MainState::NOTPASS, MainState::PASS]];
|
|
|
+ $exists = TaModel::where($where)->find();
|
|
|
+ if ($exists) {
|
|
|
+ $response->msg = "当前申请对象在当前批次中存在申请中的记录,请等待申请结束后再操作";
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+
|
|
|
$user = $this->user;
|
|
|
$ti = \app\common\api\VerifyApi::getTalentInfoById($param["talentId"]);
|
|
|
$data = [
|
|
@@ -82,15 +92,15 @@ class TalentAllowance extends EnterpriseController {
|
|
|
"year" => $param["year"],
|
|
|
"source" => $ti["source"],
|
|
|
"qzgccrcActiveTime" => $ti["certificateExpireTime"],
|
|
|
- "talentType" => $ti["enterprise_id"],
|
|
|
- "address" => $ti["address"],
|
|
|
+ "talentType" => $ti["enterpriseTag"],
|
|
|
+ "address" => $ti["street"],
|
|
|
"name" => $ti["name"],
|
|
|
"sex" => $ti["sex"],
|
|
|
"cardType" => $ti["card_type"],
|
|
|
"idCard" => $ti["card_number"],
|
|
|
"firstInJJTime" => $ti["fst_work_time"],
|
|
|
"entryTime" => $ti["cur_entry_time"],
|
|
|
- "post" => $ti["postion"],
|
|
|
+ "post" => $ti["position"],
|
|
|
"phone" => $ti["phone"],
|
|
|
"talentArrange" => $ti["talent_arrange"],
|
|
|
"identifyCondition" => $ti["talent_condition"],
|
|
@@ -105,11 +115,11 @@ class TalentAllowance extends EnterpriseController {
|
|
|
"checkState" => 1,
|
|
|
"type" => $user["type"],
|
|
|
"provinceCode" => $ti["province"],
|
|
|
- "provinceName" => $ti["enterprise_id"],
|
|
|
+ "provinceName" => \app\common\api\LocationApi::getNameByCode($ti["province"]),
|
|
|
"cityCode" => $ti["city"],
|
|
|
- "cityName" => $ti["enterprise_id"],
|
|
|
+ "cityName" => \app\common\api\LocationApi::getNameByCode($ti["city"]),
|
|
|
"countyCode" => $ti["county"],
|
|
|
- "countyName" => $ti["enterprise_id"],
|
|
|
+ "countyName" => \app\common\api\LocationApi::getNameByCode($ti["county"]),
|
|
|
"isSupple" => 2,
|
|
|
"createTime" => date("Y-m-d H:i:s"),
|
|
|
"createUser" => $user["uid"],
|
|
@@ -133,8 +143,8 @@ class TalentAllowance extends EnterpriseController {
|
|
|
/**
|
|
|
* 4.添加津补贴核查项目
|
|
|
*/
|
|
|
- $list = []; //核查项目详情表
|
|
|
- $this->createAllowanceProject($data, $contractDetailList, $list);
|
|
|
+ //核查项目详情表
|
|
|
+ $this->createAllowanceProject($data, $contractDetailList);
|
|
|
\app\common\model\TalentAllowanceArrange::insertAll($arrangeList);
|
|
|
//添加日志
|
|
|
TalentChecklog::create([
|
|
@@ -275,8 +285,6 @@ class TalentAllowance extends EnterpriseController {
|
|
|
"endTime" => $endTime,
|
|
|
"prepareMonths" => null,
|
|
|
"description" => "申报年度有效月份:" . $months,
|
|
|
- "dayMap" => null,
|
|
|
- "list" => $monthList,
|
|
|
"identifyConditionName" => $talentTypeChange["oldIdentifyConditionName"],
|
|
|
"identifyConditionGetTime" => $talentTypeChange["oldIdentifyGetTime"],
|
|
|
];
|
|
@@ -342,7 +350,6 @@ class TalentAllowance extends EnterpriseController {
|
|
|
"gygb" => $quit["gygb"],
|
|
|
"identifyGetTime" => $quit["identifyGetTime"],
|
|
|
"isQuit" => \StrUtil::isEmpOrNull($quit["quitTime"]) ? 2 : 1,
|
|
|
- "enterpriseName" => $quit["enterpriseName"],
|
|
|
"post" => $quit["post"]
|
|
|
];
|
|
|
$count++;
|
|
@@ -351,7 +358,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
- private function createAllowanceProject($info, $contractList, $list) {
|
|
|
+ private function createAllowanceProject($info, $contractList) {
|
|
|
foreach ($contractList as $detail) {
|
|
|
$projects = [
|
|
|
AllowanceProjectEnum::PROJECT_CONTRACT,
|
|
@@ -359,24 +366,22 @@ class TalentAllowance extends EnterpriseController {
|
|
|
AllowanceProjectEnum::PROJECT_WAGES,
|
|
|
AllowanceProjectEnum::PROJECT_ATTENDANCE,
|
|
|
AllowanceProjectEnum::PROJECT_SB_PENSION,
|
|
|
- AllowanceProjectEnum::PROJECT_SB_INJURY,
|
|
|
AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT,
|
|
|
AllowanceProjectEnum::PROJECT_SB_MEDICA,
|
|
|
- AllowanceProjectEnum::PROJECT_SB_BIRTH,
|
|
|
- AllowanceProjectEnum::PROJECT_INBORDER,
|
|
|
AllowanceProjectEnum::PROJECT_WORKDAY,
|
|
|
];
|
|
|
+ $list = [];
|
|
|
foreach ($projects as $project) {
|
|
|
- $list = [];
|
|
|
$list[] = [
|
|
|
"mainId" => $info["id"],
|
|
|
"baseId" => $detail["id"],
|
|
|
"enterpriseId" => $detail["enterpriseId"],
|
|
|
"project" => $project,
|
|
|
- "isLock" => 1
|
|
|
+ "isLock" => 1,
|
|
|
+ "createTime" => date("Y-m-d H:i:s")
|
|
|
];
|
|
|
- \app\common\model\TalentAllowanceProject::insertAll($list);
|
|
|
}
|
|
|
+ \app\common\model\TalentAllowanceProject::insertAll($list);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -389,7 +394,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$limit = $this->request["limit"] ?: 1000;
|
|
|
$count = \app\common\model\TalentAllowancecontractDetail::where("mainId", $mainId)->count();
|
|
|
$list = \app\common\model\TalentAllowancecontractDetail::where("mainId", $mainId)->limit($offset, $limit)->select()->toArray();
|
|
|
- $enterpriseMap = app\common\model\Enterprise::column("name", "id");
|
|
|
+ $enterpriseMap = \app\common\model\Enterprise::column("name", "id");
|
|
|
foreach ($list as &$row) {
|
|
|
$row["enterpriseName"] = $enterpriseMap[$row["enterpriseId"]];
|
|
|
}unset($row);
|
|
@@ -401,7 +406,7 @@ class TalentAllowance extends EnterpriseController {
|
|
|
*/
|
|
|
public function findAllowanceProject() {
|
|
|
$mainId = $this->request["mainId"];
|
|
|
- $baseId = $this->request["mainId"];
|
|
|
+ $baseId = $this->request["baseId"];
|
|
|
$offset = $this->request["offset"] ?: 0;
|
|
|
$limit = $this->request["limit"] ?: 1000;
|
|
|
$where = [];
|
|
@@ -413,7 +418,16 @@ class TalentAllowance extends EnterpriseController {
|
|
|
foreach ($list as &$project) {
|
|
|
$project["projectName"] = AllowanceProjectEnum::getProjectName($project["project"]);
|
|
|
if ($info["checkState"] == 1) {
|
|
|
- $project["isEdit"] = in_array($project["project"], [AllowanceProjectEnum::PROJECT_TAX, AllowanceProjectEnum::PROJECT_INBORDER, AllowanceProjectEnum::PROJECT_WORKDAY]) ? 1 : 2;
|
|
|
+ $project["isEdit"] = in_array($project["project"], [
|
|
|
+ AllowanceProjectEnum::PROJECT_CONTRACT,
|
|
|
+ AllowanceProjectEnum::PROJECT_TAX,
|
|
|
+ AllowanceProjectEnum::PROJECT_WAGES,
|
|
|
+ AllowanceProjectEnum::PROJECT_ATTENDANCE,
|
|
|
+ AllowanceProjectEnum::PROJECT_SB_PENSION,
|
|
|
+ AllowanceProjectEnum::PROJECT_SB_UNEMPLOYMENT,
|
|
|
+ AllowanceProjectEnum::PROJECT_SB_MEDICA,
|
|
|
+ AllowanceProjectEnum::PROJECT_WORKDAY
|
|
|
+ ]) ? 1 : 2;
|
|
|
} else if ($info["checkState"] == 10) {
|
|
|
$projects = explode(",", $info["projects"]);
|
|
|
if (in_array($project["id"], $projects)) {
|