| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- import 'package:flutter/material.dart';
- import '../models/document.dart';
- import '../models/element.dart';
- import '../models/annotation.dart';
- import '../models/graph.dart';
- /// 模拟数据服务
- class MockDataService {
- // 模拟文档数据
- static List<Document> getMockDocuments() {
- return [
- Document(
- id: '1',
- name: '智能票据处理系统-项目计划书.pdf',
- type: DocumentType.pdf,
- status: DocumentStatus.completed,
- createdAt: DateTime.now().subtract(const Duration(days: 1)),
- updatedAt: DateTime.now().subtract(const Duration(hours: 2)),
- fileSize: 2048000,
- parsedText: _getMockParsedText(),
- ),
- Document(
- id: '2',
- name: '投资分析报告.docx',
- type: DocumentType.word,
- status: DocumentStatus.processing,
- createdAt: DateTime.now().subtract(const Duration(hours: 5)),
- fileSize: 1536000,
- ),
- Document(
- id: '3',
- name: '合同扫描件.jpg',
- type: DocumentType.image,
- status: DocumentStatus.parsing,
- createdAt: DateTime.now().subtract(const Duration(hours: 1)),
- fileSize: 1024000,
- ),
- ];
- }
- // 模拟解析后的文本
- static String _getMockParsedText() {
- return '''一、项目概述
- 本项目由腾讯科技有限公司(以下简称"腾讯")投资建设,旨在打造一套面向大型企业财务共享中心的"智能票据处理系统"。系统通过OCR识别、版面理解、要素抽取与人机协同核验,提升发票、合同、报销单据等票据类文档的处理效率与准确率。
- 二、投资与资金安排
- 项目总投资金额为人民币3,700万元,其中已支付1,000万元用于样机研制、数据治理与前期试点。剩余资金将依据阶段性里程碑进行分批拨付,涵盖核心算法优化、系统平台化改造、以及与客户生态的对接集成。
- 三、技术与产品路线
- 系统采用多模态文档理解技术,将版面结构、语义上下文与业务词典结合,实现对复杂票据的鲁棒解析。产品形态包含:上传解析端、人工牵引标注端、规则与关系构建端,以及结果交付端。
- 四、收益预期
- 预计上线后,票据处理效率提升60%以上,人工核验工作量下降40%,并显著降低AI"幻觉"导致的错判风险,从而提升财务数据的可靠性与可审计性。''';
- }
- // 模拟要素数据
- static List<DocumentElement> getMockElements() {
- return [
- DocumentElement(
- id: 'e1',
- type: ElementType.company,
- label: '公司',
- value: '腾讯科技有限公司',
- documentId: '1',
- ),
- DocumentElement(
- id: 'e2',
- type: ElementType.amount,
- label: '总投资',
- value: '3700万',
- documentId: '1',
- ),
- DocumentElement(
- id: 'e3',
- type: ElementType.amount,
- label: '已支付',
- value: '1000万',
- documentId: '1',
- ),
- DocumentElement(
- id: 'e4',
- type: ElementType.amount,
- label: '剩余投资',
- value: '2700万',
- documentId: '1',
- ),
- ];
- }
- // 模拟批注数据
- static List<Annotation> getMockAnnotations() {
- return [
- Annotation(
- id: 'a1',
- text: '腾讯科技有限公司',
- start: const Offset(0, 0),
- end: const Offset(100, 20),
- type: AnnotationType.highlight,
- documentId: '1',
- createdAt: DateTime.now(),
- ),
- Annotation(
- id: 'a2',
- text: '3700万元',
- start: const Offset(0, 50),
- end: const Offset(80, 70),
- type: AnnotationType.highlight,
- documentId: '1',
- createdAt: DateTime.now(),
- ),
- ];
- }
- // 模拟关系网络数据
- static List<GraphNode> getMockGraphNodes() {
- return [
- GraphNode(
- id: 'n1',
- label: '总投资: 3700万',
- type: NodeType.element,
- position: const Offset(100, 100),
- ),
- GraphNode(
- id: 'n2',
- label: '已支付: 1000万',
- type: NodeType.element,
- position: const Offset(100, 200),
- ),
- GraphNode(
- id: 'n3',
- label: '减去',
- type: NodeType.operator,
- position: const Offset(300, 150),
- ),
- GraphNode(
- id: 'n4',
- label: '剩余投资: 2700万',
- type: NodeType.result,
- position: const Offset(500, 150),
- ),
- ];
- }
- static List<GraphEdge> getMockGraphEdges() {
- return [
- GraphEdge(id: 'e1', source: 'n1', target: 'n3', type: EdgeType.calculate),
- GraphEdge(id: 'e2', source: 'n2', target: 'n3', type: EdgeType.calculate),
- GraphEdge(id: 'e3', source: 'n3', target: 'n4', type: EdgeType.calculate),
- ];
- }
- // 模拟Prompt
- static String getMockPrompt() {
- return '''原文参考:"项目由腾讯投资,总投资金额为3700万元。根据进度,目前已支付1000万元。"
- 要求:请根据上述原文,计算项目剩余投资金额。''';
- }
- // 模拟AI回复
- static String getMockAIResponse() {
- return '''根据您提供的信息,项目剩余投资金额为:
- 3700万 - 1000万 = 2700万元
- 计算过程:
- - 总投资金额:3700万元
- - 已支付金额:1000万元
- - 剩余投资金额 = 总投资金额 - 已支付金额 = 3700 - 1000 = 2700万元''';
- }
- }
|