硬件运行状态:本地加密环境已锁定
物理隔离 · IC卡认证 · SOC2 合规
GPU 正常
延迟 12ms

Ledger Weaver

核算与开票助理 · 业务流程画布

报关单数据拉取

自动获取海关结关数据

五要素对撞

品名·规格·数量·币种·汇率强校验

差异识别与冻结

微差/多单对一票异常处理

开票指令生成

匹配无误,向供应商下发开票通知

凭证自动生成

基于匹配结果生成会计凭证

红冲监控

报关单变动时自动触发红冲流程

五要素对撞逻辑

workflow.ts
// Ledger Weaver - Five Elements Collision Engine
import { CustomsDeclaration, PurchaseOrder } from '@axon/types';

interface CollisionResult {
  matched: boolean;
  discrepancies: Discrepancy[];
  invoiceInstruction?: InvoiceInstruction;
}

async function fiveElementCollision(
  declaration: CustomsDeclaration,
  order: PurchaseOrder
): Promise<CollisionResult> {
  const checks = [
    // 品名校验 - 允许同义词映射
    checkProductName(declaration.productName, order.productName),
    // 规格校验 - 精确匹配
    checkSpecification(declaration.specs, order.specs),
    // 数量校验 - 允许 ±0.1% 误差
    checkQuantity(declaration.qty, order.qty, 0.001),
    // 币种校验 - 必须完全一致
    checkCurrency(declaration.currency, order.currency),
    // 汇率校验 - 取申报日央行中间价
    checkExchangeRate(declaration.rate, getCentralBankRate(declaration.date))
  ];
  
  const results = await Promise.all(checks);
  const discrepancies = results.filter(r => !r.passed);
  
  if (discrepancies.length === 0) {
    return {
      matched: true,
      discrepancies: [],
      invoiceInstruction: generateInvoiceInstruction(declaration, order)
    };
  }
  
  // 差异率 > 0.1% 触发冻结
  return {
    matched: false,
    discrepancies,
    // 冻结异常单据,推送补正提示
  };
}

此代码已锁定发布 · 运行时确定性执行 · 无 LLM 实时干预