吸收数字员工业务事实物化查询

This commit is contained in:
baiyanyun
2026-06-12 22:24:38 +08:00
parent 8a5d5d6474
commit 26fbf51fc8
20 changed files with 721 additions and 1 deletions

View File

@@ -1241,6 +1241,71 @@ function checkDigitalAdminPolicySnapshots() {
console.log("[DigitalEmployeeCheck] admin policy snapshot conflict view hooks OK");
}
function checkDigitalBackendMaterializedFacts() {
console.log("\n[DigitalEmployeeCheck] Verify backend materialized business fact hooks");
const backendRoot = path.resolve(packageRoot, "..", "..", "..", "qiming-backend");
const qimingRoot = path.resolve(packageRoot, "..", "..", "..", "qiming");
const servicePath = path.join(
backendRoot,
"app-platform-modules",
"app-platform-agent",
"app-platform-agent-core-application",
"src",
"main",
"java",
"com",
"xspaceagi",
"agent",
"core",
"application",
"service",
"DigitalEmployeeSyncApplicationServiceImpl.java",
);
const sqlPath = path.join(backendRoot, "sql", "update-20260612.sql");
const dtoPath = path.join(
backendRoot,
"app-platform-modules",
"app-platform-agent",
"app-platform-agent-core-adapter",
"src",
"main",
"java",
"com",
"xspaceagi",
"agent",
"core",
"adapter",
"dto",
"digital",
"DigitalEmployeeBusinessViewRowDto.java",
);
const qimingTypesPath = path.join(qimingRoot, "src", "types", "interfaces", "systemManage.ts");
const docsPath = path.resolve(packageRoot, "..", "..", "docs", "digital-employee-frontend-integration-plan.md");
const service = fs.readFileSync(servicePath, "utf8");
const sql = fs.readFileSync(sqlPath, "utf8");
const dto = fs.readFileSync(dtoPath, "utf8");
const qimingTypes = fs.readFileSync(qimingTypesPath, "utf8");
const docs = fs.readFileSync(docsPath, "utf8");
const requiredSnippets = [
[sql, "digital_employee_business_fact", "business fact table migration"],
[sql, "digital_employee_artifact_lifecycle", "artifact lifecycle table migration"],
[sql, "digital_employee_daily_report_fact", "daily report fact table migration"],
[service, "materializeSyncRecord", "sync materialization hook"],
[service, "upsertBySyncRecord", "materialized upsert call"],
[service, "queryMaterializedBusinessRows", "materialized query preference"],
[dto, "materialized", "business row materialized flag"],
[qimingTypes, "materialized", "qiming materialized type field"],
[docs, "业务事实物化查询", "docs materialized fact absorption"],
];
const missing = requiredSnippets
.filter(([content, snippet]) => !content.includes(snippet))
.map(([, , label]) => label);
if (missing.length > 0) {
throw new Error(`Missing backend materialized fact hooks: ${missing.join(", ")}`);
}
console.log("[DigitalEmployeeCheck] backend materialized business fact hooks OK");
}
function checkLocalDatabaseSchema() {
console.log("\n[DigitalEmployeeCheck] Verify local SQLite digital schema");
const dbPath = path.join(os.homedir(), ".qimingclaw", "qimingclaw.db");
@@ -1301,6 +1366,7 @@ function main() {
checkDigitalPolicySchedulerWorkbenches();
checkDigitalAdminActionLoop();
checkDigitalAdminPolicySnapshots();
checkDigitalBackendMaterializedFacts();
checkLocalDatabaseSchema();
console.log("\n[DigitalEmployeeCheck] All checks passed");
} catch (error) {