diff --git a/.gitignore b/.gitignore index 5054a67..da10f20 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ Thumbs.db /vendor /.settings /.buildpath -/.project \ No newline at end of file +/.project +/doc \ No newline at end of file diff --git a/app/controller/Match.php b/app/controller/MatchController.php similarity index 100% rename from app/controller/Match.php rename to app/controller/MatchController.php diff --git a/app/service/MatchService.php b/app/service/MatchService.php index b9c83c1..8180664 100644 --- a/app/service/MatchService.php +++ b/app/service/MatchService.php @@ -111,6 +111,11 @@ class MatchService return []; } + // 转换为数组(如果返回的是对象) + if (is_object($user)) { + $user = $user->toArray(); + } + // 构建简历数据结构 $resume = [ 'user_id' => $userId, @@ -160,7 +165,7 @@ class MatchService private function filterPositionsFromDb(array $resume): array { $query = Db::name('no_notice_position') - ->where('deleted_at', null); // 排除已删除的岗位 + ->whereNull('deleted_at'); // 排除已删除的岗位 // 计算年龄 $age = 0; diff --git a/check_db_structure.php b/check_db_structure.php deleted file mode 100644 index c1f8695..0000000 --- a/check_db_structure.php +++ /dev/null @@ -1,93 +0,0 @@ -initialize(); - -use think\facade\Db; - -try { - // 设置数据库配置(从.env读取或直接配置) - $dbConfig = [ - 'default' => 'mysql', - 'connections' => [ - 'mysql' => [ - 'type' => 'mysql', - 'hostname' => '192.168.28.18', - 'database' => 'dhd_official_test', - 'username' => 'dhd_official_test', - 'password' => '4zDsLWZaEzhPAGaf', - 'hostport' => '3306', - 'charset' => 'utf8', - ] - ] - ]; - - // 设置配置 - \think\facade\Config::set($dbConfig, 'database'); - - echo "========================================\n"; - echo "查看数据库表结构\n"; - echo "========================================\n\n"; - - // 查看职位表结构 - echo "【职位表:no_notice_position】\n"; - echo "----------------------------------------\n"; - $positionColumns = Db::query("DESC no_notice_position"); - foreach ($positionColumns as $col) { - $field = $col['Field'] ?? $col['field'] ?? ''; - $type = $col['Type'] ?? $col['type'] ?? ''; - $null = ($col['Null'] ?? $col['null'] ?? '') === 'YES' ? 'NULL' : 'NOT NULL'; - echo sprintf("%-30s %-20s %s\n", $field, $type, $null); - } - - echo "\n【职位表示例数据(前2条)】\n"; - echo "----------------------------------------\n"; - $positions = Db::name('no_notice_position')->limit(2)->select()->toArray(); - foreach ($positions as $index => $pos) { - echo "记录 " . ($index + 1) . ":\n"; - echo "ID: " . ($pos['id'] ?? '') . "\n"; - echo "岗位名称: " . ($pos['positon_name'] ?? '') . "\n"; - echo "学历要求: " . ($pos['education_require'] ?? '') . "\n"; - echo "学位要求: " . ($pos['degree_require'] ?? '') . "\n"; - echo "年龄要求: " . ($pos['age_require'] ?? '') . "\n"; - echo "性别要求: " . ($pos['sex_require'] ?? '') . "\n"; - echo "其他要求(JSON): " . ($pos['position_other_require'] ?? '') . "\n"; - echo "\n"; - } - - echo "\n【用户表:t_user】\n"; - echo "----------------------------------------\n"; - $userColumns = Db::query("DESC t_user"); - foreach ($userColumns as $col) { - $field = $col['Field'] ?? $col['field'] ?? ''; - $type = $col['Type'] ?? $col['type'] ?? ''; - $null = ($col['Null'] ?? $col['null'] ?? '') === 'YES' ? 'NULL' : 'NOT NULL'; - echo sprintf("%-30s %-20s %s\n", $field, $type, $null); - } - - echo "\n【用户表示例数据(前1条)】\n"; - echo "----------------------------------------\n"; - $users = Db::name('t_user')->limit(1)->select()->toArray(); - if (!empty($users)) { - $user = $users[0]; - echo "ID: " . ($user['id'] ?? '') . "\n"; - echo "出生日期: " . ($user['birth_date'] ?? '') . "\n"; - echo "性别: " . ($user['gender'] ?? '') . "\n"; - // 只显示关键字段 - $keyFields = ['id', 'birth_date', 'gender', 'education', 'majors_name']; - foreach ($keyFields as $field) { - if (isset($user[$field])) { - echo "$field: " . $user[$field] . "\n"; - } - } - } - -} catch (\Exception $e) { - echo "错误: " . $e->getMessage() . "\n"; - echo "文件: " . $e->getFile() . ":" . $e->getLine() . "\n"; -} - diff --git a/test_debug.php b/test_debug.php deleted file mode 100644 index b6826cf..0000000 --- a/test_debug.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - "专业-硕士" => "教育学、心理学" - ] -]; - -$resume = [ - "education" => [ - [ - "education_level" => "硕士研究生", - "majors_name" => "教育学" - ] - ] -]; - -$app = new think\App(); -$app->initialize(); - -$matchService = new app\service\MatchService(); - -// 使用反射调用私有方法进行测试 -$reflection = new ReflectionClass($matchService); - -// 测试getMajorRequirement -$getMajorRequirement = $reflection->getMethod('getMajorRequirement'); -$getMajorRequirement->setAccessible(true); -$majorRequire = $getMajorRequirement->invoke($matchService, $position['position_require'], $resume); -echo "专业要求: " . $majorRequire . "\n"; - -// 测试isMajorCategoryMatch -$isMajorCategoryMatch = $reflection->getMethod('isMajorCategoryMatch'); -$isMajorCategoryMatch->setAccessible(true); -$result = $isMajorCategoryMatch->invoke($matchService, "教育学", "教育学、心理学"); -echo "专业匹配结果: " . ($result ? "匹配" : "不匹配") . "\n"; - diff --git a/test_match_new.php b/test_match_new.php deleted file mode 100644 index e077044..0000000 --- a/test_match_new.php +++ /dev/null @@ -1,123 +0,0 @@ - 1, - "base_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001" - ], - "position_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001", - "备注" => "考生按照总成绩由高到低的顺序依次在对应的职位计划表中选择具体工作岗位。", - "招录机关" => "自治区公安厅", - "职位序号" => "1", - "职位简介" => "从事公安机关人工智能研发、大数据系统建设管理、数据信息挖掘及分析研判等专业技术工作。" - ], - "position_require" => [ - "学历要求" => "本科及以上", - "学位要求" => "学士及以上", - "年龄要求" => "18周岁以上、35周岁以下。", - "回避要求" => "报考人员不得报考与市公安局领导班子成员、内设机构领导班子成员(如刑侦支队支队长、副支队长等)存在规定回避情形的职位(回避情形含夫妻关系、直系血亲关系、三代以内旁系血亲关系以及近姻亲关系)。", - "专业资格条件" => "曾参加人工智能、大数据、计算机领域竞赛,获个人三等奖或团体三等奖及以上,提供官方证明文件。", - "其他资格条件" => "适合男性。符合人民警察录用条件。单侧矫正视力低于5.0不合格。", - "专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类" - ] -]; - -// 简历信息 -$resume = [ - "user_id" => 527, - "birth_date" => "1989-03-01", - "gender" => "男", - "ethnicity" => "汉族", - "work_experience" => "无基层工作年限", - "education" => [ - [ - "id" => 1, - "education_level" => "普通本科", - "degree" => "学士", - "majors_name" => "逻辑学" - ], - [ - "id" => 2, - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "伦理学" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -// 计算匹配度 -$result = $matchService->calculateMatchScore($position, $resume); - -// 输出结果 -echo "========================================\n"; -echo "岗位简历匹配度测试结果(新机制)\n"; -echo "========================================\n\n"; - -echo "【硬性条件检查结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "✓ 通过硬性条件筛选\n\n"; - foreach ($result['hard_requirements']['details'] as $key => $detail) { - if (isset($detail['passed'])) { - $status = $detail['passed'] ? '✓' : '✗'; - echo "{$status} {$key}: "; - if ($detail['passed']) { - echo "通过 (要求: {$detail['required']}, 实际: {$detail['actual']})\n"; - } else { - echo "不通过 - {$detail['reason']}\n"; - } - } - } -} else { - echo "✗ 未通过硬性条件筛选\n\n"; - echo "不通过原因:\n"; - foreach ($result['rejection_reasons'] as $reason) { - echo " - {$reason}\n"; - } - echo "\n详细检查结果:\n"; - foreach ($result['hard_requirements']['details'] as $key => $detail) { - if (isset($detail['passed'])) { - $status = $detail['passed'] ? '✓' : '✗'; - echo "{$status} {$key}: "; - if ($detail['passed']) { - echo "通过 (要求: {$detail['required']}, 实际: {$detail['actual']})\n"; - } else { - echo "不通过 - {$detail['reason']}\n"; - } - } - } -} - -echo "\n【软性条件评分结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "总分: {$result['score']}/{$result['soft_requirements']['max_score']}分\n\n"; - foreach ($result['soft_requirements']['details'] as $key => $detail) { - echo "{$key}: {$detail['score']}/{$detail['max_score']}分 - {$detail['reason']}\n"; - } -} else { - echo "(未通过硬性条件筛选,不进行软性条件评分)\n"; -} - -echo "\n========================================\n"; -echo "最终结果: " . ($result['qualified'] ? "✓ 符合条件,匹配度 {$result['score']}/100分" : "✗ 不符合条件") . "\n"; -echo "========================================\n"; - diff --git a/test_match_pass.php b/test_match_pass.php deleted file mode 100644 index 5450750..0000000 --- a/test_match_pass.php +++ /dev/null @@ -1,82 +0,0 @@ - [ - "学历要求" => "本科及以上", - "学位要求" => "学士及以上", - "年龄要求" => "18周岁以上、35周岁以下。", - "其他资格条件" => "适合男性。", - "专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类" - ] -]; - -// 简历信息(符合硬性条件) -$resume = [ - "birth_date" => "1995-03-01", // 29岁,符合年龄要求 - "gender" => "男", - "work_experience" => "3年基层工作年限", - "education" => [ - [ - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "计算机科学与技术" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -// 计算匹配度 -$result = $matchService->calculateMatchScore($position, $resume); - -// 输出结果 -echo "========================================\n"; -echo "岗位简历匹配度测试(通过硬性条件案例)\n"; -echo "========================================\n\n"; - -echo "【硬性条件检查结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "✓ 通过硬性条件筛选\n\n"; - foreach ($result['hard_requirements']['details'] as $key => $detail) { - if (isset($detail['passed'])) { - $status = $detail['passed'] ? '✓' : '✗'; - echo "{$status} {$key}: "; - if ($detail['passed']) { - echo "通过 (要求: {$detail['required']}, 实际: {$detail['actual']})\n"; - } else { - echo "不通过 - {$detail['reason']}\n"; - } - } - } -} else { - echo "✗ 未通过硬性条件筛选\n"; - foreach ($result['rejection_reasons'] as $reason) { - echo " - {$reason}\n"; - } -} - -echo "\n【软性条件评分结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "总分: {$result['score']}/{$result['soft_requirements']['max_score']}分\n\n"; - foreach ($result['soft_requirements']['details'] as $key => $detail) { - echo "{$key}: {$detail['score']}/{$detail['max_score']}分 - {$detail['reason']}\n"; - } -} else { - echo "(未通过硬性条件筛选,不进行软性条件评分)\n"; -} - -echo "\n========================================\n"; -echo "最终结果: " . ($result['qualified'] ? "✓ 符合条件,匹配度 {$result['score']}/100分" : "✗ 不符合条件") . "\n"; -echo "========================================\n"; - diff --git a/test_match_real.php b/test_match_real.php deleted file mode 100644 index df6811c..0000000 --- a/test_match_real.php +++ /dev/null @@ -1,198 +0,0 @@ - 1, - "base_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001" - ], - "position_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001", - "备注" => "考生按照总成绩由高到低的顺序依次在对应的职位计划表中选择具体工作岗位。", - "招录机关" => "自治区公安厅", - "职位序号" => "1", - "职位简介" => "从事公安机关人工智能研发、大数据系统建设管理、数据信息挖掘及分析研判等专业技术工作。" - ], - "position_require" => [ - "学历要求" => "本科及以上", - "学位要求" => "学士及以上", - "年龄要求" => "18周岁以上、35周岁以下。", - "回避要求" => "报考人员不得报考与市公安局领导班子成员、内设机构领导班子成员(如刑侦支队支队长、副支队长等)存在规定回避情形的职位(回避情形含夫妻关系、直系血亲关系、三代以内旁系血亲关系以及近姻亲关系)。", - "专业资格条件" => "曾参加人工智能、大数据、计算机领域竞赛,获个人三等奖或团体三等奖及以上,提供官方证明文件。", - "其他资格条件" => "适合男性。符合人民警察录用条件。单侧矫正视力低于5.0不合格。", - "专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类" - ] -]; - -// 简历信息(从简历-岗位.md) -$resume = [ - "user_id" => 527, - "exam_city" => [ - [ - "name" => "贵州省", - "child" => [ - [ - "name" => "贵阳市", - "city_id" => 604132 - ], - [ - "name" => "六盘水市", - "city_id" => 605834 - ], - [ - "name" => "遵义市", - "city_id" => 607029 - ] - ], - "city_id" => 604131 - ] - ], - "exam_type_id" => [3, 8], - "birth_date" => "1989-03-01", - "gender" => "男", - "ethnicity" => "汉族", - "city_id" => 609311, - "origin_city_id" => 609311, - "political_status" => "群众", - "special_identity" => "无特殊身份/其他特特身份", - "is_young" => "否", - "grassroots_program" => "无", - "work_experience" => "无基层工作年限", - "exam_type_name" => ["事业单位", "公务员"], - "city_name" => "贵州,安顺,西秀", - "origin_city_name" => "贵州,安顺,西秀", - "education" => [ - [ - "id" => 1, - "user_id" => 527, - "education_level" => "普通本科", - "degree" => "学士", - "majors_id" => 1016, - "education_type" => "全日制", - "graduate_date" => "2012-07-01", - "majors_name" => "逻辑学" - ], - [ - "id" => 2, - "user_id" => 527, - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_id" => 513, - "education_type" => "全日制", - "graduate_date" => "2015-07-01", - "majors_name" => "伦理学" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -// 计算匹配度 -$result = $matchService->calculateMatchScore($position, $resume); - -// 输出结果 -echo "========================================\n"; -echo "岗位简历匹配度测试(真实数据)\n"; -echo "========================================\n\n"; - -echo "【岗位信息】\n"; -echo "----------------------------------------\n"; -echo "岗位名称: " . $position['base_info']['岗位名称'] . "\n"; -echo "招考单位: " . $position['base_info']['招考单位'] . "\n"; -echo "学历要求: " . $position['position_require']['学历要求'] . "\n"; -echo "学位要求: " . $position['position_require']['学位要求'] . "\n"; -echo "年龄要求: " . $position['position_require']['年龄要求'] . "\n"; -echo "专业要求: " . $position['position_require']['专业(学科)类别'] . "\n"; -echo "其他条件: " . $position['position_require']['其他资格条件'] . "\n\n"; - -echo "【简历信息】\n"; -echo "----------------------------------------\n"; -$highestEdu = null; -$highestLevel = 0; -$educationLevels = ['普通本科' => 3, '硕士研究生' => 4, '博士研究生' => 5]; -foreach ($resume['education'] as $edu) { - $level = $educationLevels[$edu['education_level']] ?? 0; - if ($level > $highestLevel) { - $highestLevel = $level; - $highestEdu = $edu; - } -} -echo "最高学历: " . ($highestEdu['education_level'] ?? '未知') . "\n"; -echo "最高学位: " . ($highestEdu['degree'] ?? '未知') . "\n"; -echo "专业: "; -foreach ($resume['education'] as $edu) { - echo $edu['majors_name'] . " "; -} -echo "\n"; -$age = date('Y') - date('Y', strtotime($resume['birth_date'])); -if (date('md') < date('md', strtotime($resume['birth_date']))) { - $age--; -} -echo "年龄: {$age}岁 (出生日期: {$resume['birth_date']})\n"; -echo "性别: " . $resume['gender'] . "\n"; -echo "基层工作经历: " . $resume['work_experience'] . "\n\n"; - -echo "【硬性条件检查结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "✓ 通过硬性条件筛选\n\n"; - foreach ($result['hard_requirements']['details'] as $key => $detail) { - if (isset($detail['passed'])) { - $status = $detail['passed'] ? '✓' : '✗'; - echo "{$status} {$key}: "; - if ($detail['passed']) { - echo "通过 (要求: {$detail['required']}, 实际: {$detail['actual']})\n"; - } else { - echo "不通过 - {$detail['reason']}\n"; - } - } - } -} else { - echo "✗ 未通过硬性条件筛选\n\n"; - echo "不通过原因:\n"; - foreach ($result['rejection_reasons'] as $reason) { - echo " - {$reason}\n"; - } - echo "\n详细检查结果:\n"; - foreach ($result['hard_requirements']['details'] as $key => $detail) { - if (isset($detail['passed'])) { - $status = $detail['passed'] ? '✓' : '✗'; - echo "{$status} {$key}: "; - if ($detail['passed']) { - echo "通过 (要求: {$detail['required']}, 实际: {$detail['actual']})\n"; - } else { - echo "不通过 - {$detail['reason']}\n"; - } - } - } -} - -echo "\n【软性条件评分结果】\n"; -echo "----------------------------------------\n"; -if ($result['qualified']) { - echo "总分: {$result['score']}/{$result['soft_requirements']['max_score']}分\n\n"; - foreach ($result['soft_requirements']['details'] as $key => $detail) { - echo "{$key}: {$detail['score']}/{$detail['max_score']}分 - {$detail['reason']}\n"; - } -} else { - echo "(未通过硬性条件筛选,不进行软性条件评分)\n"; -} - -echo "\n========================================\n"; -echo "最终结果: " . ($result['qualified'] ? "✓ 符合条件,匹配度 {$result['score']}/100分" : "✗ 不符合条件") . "\n"; -echo "========================================\n"; - diff --git a/test_match_simple.php b/test_match_simple.php deleted file mode 100644 index 6ac0808..0000000 --- a/test_match_simple.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - "学历要求" => "本科及以上", - "学位要求" => "学士及以上", - "年龄要求" => "18周岁以上、35周岁以下。", - "其他资格条件" => "适合男性。", - "专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类" - ] -]; - -// 简历信息1:不通过硬性条件(年龄超限、专业不匹配) -$resume1 = [ - "birth_date" => "1989-03-01", // 36岁 - "gender" => "男", - "work_experience" => "无基层工作年限", - "education" => [ - [ - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "逻辑学" - ], - [ - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "伦理学" - ] - ] -]; - -// 简历信息2:通过硬性条件 -$resume2 = [ - "birth_date" => "1995-03-01", // 30岁 - "gender" => "男", - "work_experience" => "3年基层工作年限", - "education" => [ - [ - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "计算机科学与技术" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -echo "========================================\n"; -echo "岗位简历匹配度测试(简化版 - 只返回分数)\n"; -echo "========================================\n\n"; - -// 测试案例1:不通过硬性条件 -echo "【测试案例1:不通过硬性条件】\n"; -echo "----------------------------------------\n"; -echo "简历信息:36岁,专业:逻辑学、伦理学\n"; -$score1 = $matchService->calculateMatchScore($position, $resume1); -echo "匹配度分数: {$score1}/100分\n"; -echo "说明: 硬性条件不满足(年龄超限、专业不匹配),返回0分\n\n"; - -// 测试案例2:通过硬性条件 -echo "【测试案例2:通过硬性条件】\n"; -echo "----------------------------------------\n"; -echo "简历信息:30岁,专业:计算机科学与技术,有基层工作经历\n"; -$score2 = $matchService->calculateMatchScore($position, $resume2); -echo "匹配度分数: {$score2}/100分\n"; -echo "说明: 通过硬性条件筛选,进行软性条件评分\n\n"; - -echo "========================================\n"; -echo "测试完成\n"; -echo "========================================\n"; - diff --git a/test_new_case.php b/test_new_case.php deleted file mode 100644 index e974c8f..0000000 --- a/test_new_case.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - "学历要求" => "本科", - "学位要求" => "学士学位", - "年龄要求" => "无", - "性别要求" => "不限制", - "民族要求" => "无", - "政治面貌要求" => "无", - "专业-本科" => "教育学", - "专业-硕士" => "教育学、心理学" - ] -]; - -$resume = [ - "birth_date" => "1998-03-01", - "gender" => "男", - "work_experience" => "无基层工作年限", - "education" => [ - [ - "education_level" => "普通本科", - "degree" => "学士", - "majors_name" => "教育学" - ], - [ - "education_level" => "硕士研究生", - "degree" => "硕士", - "majors_name" => "伦理学" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -// 计算匹配度 -$score = $matchService->calculateMatchScore($position, $resume); - -echo "========================================\n"; -echo "测试结果\n"; -echo "========================================\n"; -echo "匹配度分数: {$score}/100分\n"; -echo "\n"; - -// 检查硬性条件 -echo "岗位要求:\n"; -echo "- 学历要求: " . $position['position_require']['学历要求'] . "\n"; -echo "- 学位要求: " . $position['position_require']['学位要求'] . "\n"; -echo "- 年龄要求: " . $position['position_require']['年龄要求'] . "\n"; -echo "- 性别要求: " . $position['position_require']['性别要求'] . "\n"; -echo "- 专业-本科: " . $position['position_require']['专业-本科'] . "\n"; -echo "- 专业-硕士: " . $position['position_require']['专业-硕士'] . "\n"; -echo "\n"; - -echo "简历信息:\n"; -echo "- 最高学历: " . $resume['education'][1]['education_level'] . "\n"; -echo "- 最高学位: " . $resume['education'][1]['degree'] . "\n"; -echo "- 专业: "; -foreach ($resume['education'] as $edu) { - echo $edu['majors_name'] . " "; -} -echo "\n"; -$age = date('Y') - date('Y', strtotime($resume['birth_date'])); -if (date('md') < date('md', strtotime($resume['birth_date']))) { - $age--; -} -echo "- 年龄: {$age}岁\n"; -echo "- 性别: " . $resume['gender'] . "\n"; -echo "========================================\n"; - diff --git a/test_user_case.php b/test_user_case.php deleted file mode 100644 index 631ef8f..0000000 --- a/test_user_case.php +++ /dev/null @@ -1,72 +0,0 @@ - 1, - "base_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001" - ], - "position_info" => [ - "岗位名称" => "人工智能与大数据侦察职位一", - "招考单位" => "市级公安机关", - "招录人数" => "10", - "岗位代码" => "45150001" - ], - "position_require" => [ - "学历要求" => "本科及以上", - "学位要求" => "学士及以上", - "年龄要求" => "18周岁以上、35周岁以下。", - "专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类", - "其他资格条件" => "适合男性。符合人民警察录用条件。", - "专业资格条件" => "曾参加人工智能、大数据、计算机领域竞赛,获个人三等奖或团体三等奖及以上。" - ] -]; - -$resume = [ - "user_id" => 527, - "birth_date" => "1995-03-01", - "gender" => "男", - "work_experience" => "3年基层工作年限", - "education" => [ - [ - "education_level" => "本科", - "degree" => "学士", - "majors_name" => "计算机科学与技术" - ] - ] -]; - -// 加载ThinkPHP框架 -$app = new think\App(); -$app->initialize(); - -// 创建匹配服务实例 -$matchService = new app\service\MatchService(); - -// 计算匹配度 -$score = $matchService->calculateMatchScore($position, $resume); - -echo "========================================\n"; -echo "测试结果\n"; -echo "========================================\n"; -echo "匹配度分数: {$score}/100分\n"; -echo "\n"; - -// 检查硬性条件 -echo "检查硬性条件:\n"; -echo "- 学历: " . $resume['education'][0]['education_level'] . "\n"; -echo "- 学位: " . $resume['education'][0]['degree'] . "\n"; -echo "- 专业: " . $resume['education'][0]['majors_name'] . "\n"; -$age = date('Y') - date('Y', strtotime($resume['birth_date'])); -if (date('md') < date('md', strtotime($resume['birth_date']))) { - $age--; -} -echo "- 年龄: {$age}岁\n"; -echo "- 性别: " . $resume['gender'] . "\n"; -echo "========================================\n"; - diff --git a/归档.zip b/归档.zip deleted file mode 100644 index 02357da..0000000 Binary files a/归档.zip and /dev/null differ diff --git a/简历-岗位.md b/简历-岗位.md deleted file mode 100644 index 93d5ce7..0000000 --- a/简历-岗位.md +++ /dev/null @@ -1,100 +0,0 @@ -岗位信息如下: -```json - { - "id": 1, - "base_info": { - "岗位名称": "人工智能与大数据侦察职位一", - "招考单位": "市级公安机关", - "招录人数": "10", - "岗位代码": "45150001" - }, - "position_info": { - "岗位名称": "人工智能与大数据侦察职位一", - "招考单位": "市级公安机关", - "招录人数": "10", - "岗位代码": "45150001", - "备注": "考生按照总成绩由高到低的顺序依次在对应的职位计划表中选择具体工作岗位。", - "招录机关": "自治区公安厅", - "职位序号": "1", - "职位简介": "从事公安机关人工智能研发、大数据系统建设管理、数据信息挖掘及分析研判等专业技术工作。" - }, - "position_require": { - "学历要求": "本科及以上", - "学位要求": "学士及以上", - "年龄要求": "18周岁以上、35周岁以下。", - "回避要求": "报考人员不得报考与市公安局领导班子成员、内设机构领导班子成员(如刑侦支队支队长、副支队长等)存在规定回避情形的职位(回避情形含夫妻关系、直系血亲关系、三代以内旁系血亲关系以及近姻亲关系)。", - "专业资格条件": "曾参加人工智能、大数据、计算机领域竞赛,获个人三等奖或团体三等奖及以上,提供官方证明文件。大赛赛项包括但不限于以下类型:\n一是由省级及以上党委、政府及其组成部门(如网信办、教育厅、公安厅、工信厅、总工会等)主办或指导举办的大赛,如全国人工智能大赛(NAIC)、“兴智杯”全国人工智能创新应用大赛、中国人工智能大赛、“数境杯”数据智能创新应用大赛、中国国际大学生创新大赛、“挑战杯”全国大学生课外学术科技作品竞赛、省级职业技能大赛等;\n二是由科研机构主办或指导举办的大赛,如全国大学生大数据分析技术技能大赛、中国高校计算机大赛-人工智能创意赛、中国研究生人工智能创新大赛、“美亚杯”中国电子数据取证大赛、“数证杯”电子数据取证分析大赛、“智警杯”大数据技能竞赛、全国大学生开源情报数据采集与分析大赛等;\n三是由大学联合主办的大赛,如中国高校计算机大赛-大数据挑战赛、IKCEST“一带一路”国际大数据竞赛、CCF大数据与计算智能大赛(简称CCF BDCI)等;\n四是由企业主办类,如阿里云天池大数据竞赛、百度AI开发者大会——百度人工智能安全对抗赛、腾讯广告算法大赛等。", - "其他资格条件": "适合男性。符合人民警察录用条件。单侧矫正视力低于5.0不合格。", - "专业(学科)类别": "计算机科学与技术类,电气、电子及自动化类" - } - } -``` - -简历信息如下: -```json -{ - "user_id": 527, - "exam_city": [ - { - "name": "贵州省", - "child": [ - { - "name": "贵阳市", - "city_id": 604132 - }, - { - "name": "六盘水市", - "city_id": 605834 - }, - { - "name": "遵义市", - "city_id": 607029 - } - ], - "city_id": 604131 - } - ], - "exam_type_id": [ - 3, - 8 - ], - "birth_date": "1989-03-01", - "gender": "男", - "ethnicity": "汉族", - "city_id": 609311, - "origin_city_id": 609311, - "political_status": "群众", - "special_identity": "无特殊身份/其他特特身份", - "is_young": "否", - "grassroots_program": "无", - "work_experience": "无基层工作年限", - "exam_type_name": [ - "事业单位", - "公务员" - ], - "city_name": "贵州,安顺,西秀", - "origin_city_name": "贵州,安顺,西秀", - "education": [ - { - "id": 1, - "user_id": 527, - "education_level": "普通本科", - "degree": "学士", - "majors_id": 1016, - "education_type": "全日制", - "graduate_date": "2012-07-01", - "majors_name": "逻辑学" - }, - { - "id": 2, - "user_id": 527, - "education_level": "硕士研究生", - "degree": "硕士", - "majors_id": 513, - "education_type": "全日制", - "graduate_date": "2015-07-01", - "majors_name": "伦理学" - } - ] - } -``` \ No newline at end of file