v1.0.27: 碎片处理中心(完整方案) - 完整度计算引擎(四表分层/阈值)+is_incomplete标记(写操作挂钩)+api/fragment八接口(统计/硬碎片列表详情转换废弃/软碎片列表详情补全)+fragment.html前端(指标卡+硬软碎片双区块)
This commit is contained in:
@@ -8,6 +8,7 @@ require_once __DIR__ . '/../common/response.php';
|
||||
require_once __DIR__ . '/../common/auth.php';
|
||||
require_once __DIR__ . '/../common/logger.php';
|
||||
require_once __DIR__ . '/../common/helpers.php';
|
||||
require_once __DIR__ . '/../common/completeness.php';
|
||||
|
||||
checkAjax();
|
||||
checkPermission('company');
|
||||
@@ -61,5 +62,9 @@ if (array_key_exists('financials', $_POST) || array_key_exists('certifications',
|
||||
}
|
||||
}
|
||||
|
||||
// 完整度检查:企业主表 + 其 social_accounts
|
||||
updateIncomplete($pdo, 'companies', $newId);
|
||||
updateAccountsIncomplete($pdo, 'company', $newId);
|
||||
|
||||
logCurrent('add', 'company', 'companies', $newId, $data);
|
||||
Response::success(['id' => $newId], '新增成功');
|
||||
|
||||
@@ -10,6 +10,7 @@ require_once __DIR__ . '/../common/db.php';
|
||||
require_once __DIR__ . '/../common/response.php';
|
||||
require_once __DIR__ . '/../common/auth.php';
|
||||
require_once __DIR__ . '/../common/logger.php';
|
||||
require_once __DIR__ . '/../common/completeness.php';
|
||||
|
||||
checkAjax();
|
||||
checkPermission('company');
|
||||
@@ -75,6 +76,8 @@ while (($row = fgetcsv($handle)) !== false) {
|
||||
($rec['is_listed'] ?? 0) ? 1 : 0, $rec['stock_code'] ?? null,
|
||||
$rec['source_channel'] ?? null, $rec['source_detail'] ?? null,
|
||||
]);
|
||||
// 完整度检查(导入每行入库后)
|
||||
updateIncomplete($pdo, 'companies', (int)$pdo->lastInsertId());
|
||||
$inserted++;
|
||||
} catch (Exception $e) {
|
||||
$failed++;
|
||||
|
||||
@@ -10,6 +10,7 @@ require_once __DIR__ . '/../common/response.php';
|
||||
require_once __DIR__ . '/../common/auth.php';
|
||||
require_once __DIR__ . '/../common/helpers.php';
|
||||
require_once __DIR__ . '/../common/logger.php';
|
||||
require_once __DIR__ . '/../common/completeness.php';
|
||||
|
||||
checkAjax();
|
||||
checkPermission('company');
|
||||
@@ -44,5 +45,9 @@ $ins->execute([
|
||||
]);
|
||||
$newId = (int)$pdo->lastInsertId();
|
||||
|
||||
// 完整度检查:新官媒账号 + 所属企业全部联系方式
|
||||
updateIncomplete($pdo, 'social_accounts', $newId);
|
||||
updateAccountsIncomplete($pdo, 'company', $companyId);
|
||||
|
||||
logCurrent('add', 'official_media', 'social_accounts', $newId, ['company_id' => $companyId, 'platform' => $platform, 'account_id' => $accountId]);
|
||||
Response::success(['id' => $newId], '新增成功');
|
||||
|
||||
@@ -8,6 +8,7 @@ require_once __DIR__ . '/../common/response.php';
|
||||
require_once __DIR__ . '/../common/auth.php';
|
||||
require_once __DIR__ . '/../common/logger.php';
|
||||
require_once __DIR__ . '/../common/helpers.php';
|
||||
require_once __DIR__ . '/../common/completeness.php';
|
||||
|
||||
checkAjax();
|
||||
checkPermission('company');
|
||||
@@ -76,6 +77,10 @@ if ($hasFinancials || $hasCertifications || $hasAccounts) {
|
||||
}
|
||||
}
|
||||
|
||||
// 完整度检查:企业主表 + 其 social_accounts
|
||||
updateIncomplete($pdo, 'companies', $id);
|
||||
updateAccountsIncomplete($pdo, 'company', $id);
|
||||
|
||||
if (!empty($data)) {
|
||||
logCurrent('update', 'company', 'companies', $id, ['before' => $old, 'after' => $data]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user