新增批量

This commit is contained in:
杨志
2026-01-06 11:23:52 +08:00
parent e41dd33d23
commit cb7ad9a4b7
15 changed files with 1371 additions and 75 deletions

78
test_new_case.php Normal file
View File

@@ -0,0 +1,78 @@
<?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";