v1.0.29: 碎片处理按dp方案2修订 - 完整度改三层独立判定(核心100%/重要60%/非必要40%,任一不达标即碎片)+字段分层调整(persons email升核心,companies核心扩5字段)+指标卡5张(新增累计处理,本月/累计=硬+软合计)+软碎片列表加各层完整度列+硬碎片完整度改已填/总可填

This commit is contained in:
nanguaboss
2026-08-09 21:13:33 +08:00
parent 616da931fa
commit 17dc5d434b
11 changed files with 216 additions and 151 deletions
+11 -6
View File
@@ -1,7 +1,8 @@
<?php
/**
* 软碎片详情接口 GET /api/fragment/soft_detail.php?table=persons&id=1
* 返回:{ table, id, name, score, level, missing_core, missing_important, missing_supp, threshold, row }
* 返回:{ table, table_label, id, name, overall, level, layers, missing_core, missing_important,
* missing_optional, missing_labels, row }
*/
require_once __DIR__ . '/../common/db.php';
require_once __DIR__ . '/../common/response.php';
@@ -41,16 +42,20 @@ switch ($table) {
break;
}
$label = function ($f) { return ['key' => $f, 'label' => COMPLETENESS_LABELS[$f] ?? $f]; };
Response::success([
'table' => $table,
'table_label' => $tableLabels[$table],
'id' => $id,
'name' => $name ?: ('#' . $id),
'score' => $info['score'],
'overall' => $info['overall'],
'level' => $info['level'],
'threshold' => $info['threshold'],
'missing_core' => array_map(function ($f) { return ['key' => $f, 'label' => COMPLETENESS_LABELS[$f] ?? $f]; }, $info['missing_core']),
'missing_important' => array_map(function ($f) { return ['key' => $f, 'label' => COMPLETENESS_LABELS[$f] ?? $f]; }, $info['missing_important']),
'missing_supp' => array_map(function ($f) { return ['key' => $f, 'label' => COMPLETENESS_LABELS[$f] ?? $f]; }, $info['missing_supp']),
'layers' => $info['layers'],
'missing_core' => array_map($label, $info['missing']['core']),
'missing_important' => array_map($label, $info['missing']['important']),
'missing_optional' => array_map($label, $info['missing']['optional']),
'missing_labels' => array_map(function ($f) { return COMPLETENESS_LABELS[$f] ?? $f; },
array_merge($info['missing']['core'], $info['missing']['important'], $info['missing']['optional'])),
'row' => $info['row'],
]);