删除不要文件

This commit is contained in:
杨志
2026-01-06 13:58:03 +08:00
parent cb7ad9a4b7
commit 0f1bf1ca02
13 changed files with 8 additions and 868 deletions

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ Thumbs.db
/.settings /.settings
/.buildpath /.buildpath
/.project /.project
/doc

View File

@@ -111,6 +111,11 @@ class MatchService
return []; return [];
} }
// 转换为数组(如果返回的是对象)
if (is_object($user)) {
$user = $user->toArray();
}
// 构建简历数据结构 // 构建简历数据结构
$resume = [ $resume = [
'user_id' => $userId, 'user_id' => $userId,
@@ -160,7 +165,7 @@ class MatchService
private function filterPositionsFromDb(array $resume): array private function filterPositionsFromDb(array $resume): array
{ {
$query = Db::name('no_notice_position') $query = Db::name('no_notice_position')
->where('deleted_at', null); // 排除已删除的岗位 ->whereNull('deleted_at'); // 排除已删除的岗位
// 计算年龄 // 计算年龄
$age = 0; $age = 0;

View File

@@ -1,93 +0,0 @@
<?php
// 查看数据库表结构
require __DIR__ . '/vendor/autoload.php';
// 加载ThinkPHP框架
$app = new think\App();
$app->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";
}

View File

@@ -1,40 +0,0 @@
<?php
// 调试专业匹配
require __DIR__ . '/vendor/autoload.php';
$position = [
"position_require" => [
"专业-硕士" => "教育学、心理学"
]
];
$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";

View File

@@ -1,123 +0,0 @@
<?php
// 测试新的岗位简历匹配度计算机制
require __DIR__ . '/vendor/autoload.php';
// 岗位信息
$position = [
"id" => 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";

View File

@@ -1,82 +0,0 @@
<?php
// 测试通过硬性条件的案例
require __DIR__ . '/vendor/autoload.php';
// 岗位信息
$position = [
"position_require" => [
"学历要求" => "本科及以上",
"学位要求" => "学士及以上",
"年龄要求" => "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";

View File

@@ -1,198 +0,0 @@
<?php
// 使用简历-岗位.md中的真实数据测试
require __DIR__ . '/vendor/autoload.php';
// 岗位信息(从简历-岗位.md
$position = [
"id" => 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";

View File

@@ -1,80 +0,0 @@
<?php
// 测试简化后的匹配度接口(只返回分数)
require __DIR__ . '/vendor/autoload.php';
// 岗位信息
$position = [
"position_require" => [
"学历要求" => "本科及以上",
"学位要求" => "学士及以上",
"年龄要求" => "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";

View File

@@ -1,78 +0,0 @@
<?php
// 测试用户提供的新数据
require __DIR__ . '/vendor/autoload.php';
$position = [
"position_require" => [
"学历要求" => "本科",
"学位要求" => "学士学位",
"年龄要求" => "",
"性别要求" => "不限制",
"民族要求" => "",
"政治面貌要求" => "",
"专业-本科" => "教育学",
"专业-硕士" => "教育学、心理学"
]
];
$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";

View File

@@ -1,72 +0,0 @@
<?php
// 测试用户提供的数据
require __DIR__ . '/vendor/autoload.php';
$position = [
"id" => 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";

Binary file not shown.

View File

@@ -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": "伦理学"
}
]
}
```