| 
					
				 | 
			
			
				@@ -309,6 +309,109 @@ class Talent { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Log::write($e->getMessage(), "error"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            case 6://卫健批量审核 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $condition = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $upddata["pass_dept_check"] = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $talent_info = \app\common\api\VerifyApi::getTalentInfoById($data["id"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if ($talent_info && $talent_info["checkState"] == TalentState::SCND_SUBMIT) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($data["checkState"] == 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //审核成功,并取消设置越过部门并审 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $log_checkState = $checkState = TalentState::FST_VERIFY_PASS; //初审成功 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//审核驳回并记录需要修改的字段和上传文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (in_array("talent_condition", $data["fields"])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $condition = TalentConditionApi::getOne($talent_info["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $data["files"] = array_merge($data["files"], (array) explode(",", $condition["bindFileTypes"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ($talent_info["enterpriseType"] == CommonConst::ENTERPRISE_WJ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if ($data["checkState"] == 6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                //驳回到分院 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if ($talent_info["isGeneral"] == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    //总院不能驳回到分院,自动变更为退回总院 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    $checkState = TalentState::SCND_SAVE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    $checkState = TalentState::FST_SAVE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if ($talent_info["isGeneral"] == 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    $checkState = TalentState::SCND_SAVE; //退回材料编辑状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (\app\common\api\Nhc::hasGeneralHospital($talent_info["medicalCommunityId"])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        $checkState = TalentState::FST_SUBMIT; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        $checkState = TalentState::FST_SAVE; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $checkState = TalentState::SCND_SAVE; //退回材料编辑状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $log_checkState = TalentState::FST_VERIFY_REJECT; //日志记录拒绝状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $nowProcess = 3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($checkState == TalentState::FST_VERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $upddata["highProcess"] = $nowProcess > $talent_info["highProcess"] ? $nowProcess : $talent_info["highProcess"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $userIds = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($log_checkState == TalentState::FST_VERIFY_PASS) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $upddata["first_dept_check_time"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $condition = $condition ? $condition : TalentConditionApi::getOne($talent_info["talent_condition"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $companyIds = array_filter(explode(",", $condition["companyIds"])); //该条件下需要审核的所有单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ($talent_info["re_check_companys"]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $unpass_companyIds = array_filter(explode(",", $talent_info["re_check_companys"])); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//这边去除已经审核通过的单位,主要通过日志是否存在记录。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $pass_companyIds = TalentLogApi::getPassDepts($data["id"]); //已经通过的单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $unpass_companyIds = array_diff($companyIds, (array) $pass_companyIds); //排除已经通过的单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (!$unpass_companyIds) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                $data["pass_dept_check"] = 1; //部门已经全部审核过了,跳过部门审核 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ($unpass_companyIds) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            sort($unpass_companyIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $delay = 9 * 24 * 3600; //9天的秒数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            queue("app\job\Talent", ["type" => 1, "id" => $data["id"]], $delay); //加入部门审核超期处理队列,延迟7天执行 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            TalentLogApi::writeDeptLogs($data["id"], $unpass_companyIds, TalentState::FST_VERIFY_PASS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              //初审通过发送短信通知并审部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $codes = ["talentInfo_depCheck"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $menuIds = MenuApi::getMenuIdsByCodes($codes); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where[] = ["menuid", "in", $menuIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $roleIds = SysRelation::where($where)->group("roleid")->having("count(*)=" . count($codes))->column("roleid"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where[] = ["status", "=", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              //$where[] = ["type", "=", $this->user["type"]]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where[] = ["companyId", "in", $unpass_companyIds]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $where[] = ["roleid", "<>", 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $regstr = ",(" . implode("|", $roleIds) . "),"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $whereRaw = "concat(',',roleid,',') REGEXP '$regstr'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                              $userIds = User::where($where)->whereRaw($whereRaw)->column("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                             */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $log = TalentLogApi::getLastLog($data["id"], 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (!$log && !$talent_info["oldId"]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        return json(["msg" => "日志数据异常,保存失败"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($log["active"] === 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        TalentLogApi::rewrite($log["id"], [$log_checkState, $checkState], $data["checkMsg"], 1, $data["user"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        TalentLogApi::write(1, $data["id"], [$log_checkState, $checkState], $data["checkMsg"], 1, null, null, null, $data["user"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $upddata["id"] = $talent_info["id"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $upddata["modify_files"] = $data["files"] ? implode(",", $data["files"]) : ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $upddata["modify_fields"] = $data["fields"] ? implode(",", $data["fields"]) : ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $upddata["checkState"] = $checkState; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    TalentModel::update($upddata); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 |