Files
oneos-backend/yudao-module-ocr/sql/mysql/ocr.sql
kkfluous 78a6cde22d feat: 实现 OCR 模块和车辆上牌管理功能
- 新增 yudao-module-ocr 模块
  - OCR API 模块:定义 Feign 接口和 DTO
  - OCR Server 模块:实现行驶证识别功能
  - 集成百度 OCR SDK
  - 支持多厂商扩展(百度/腾讯/阿里云)

- 新增车辆上牌管理功能
  - 数据库表:asset_vehicle_registration
  - 完整的 CRUD 接口
  - 行驶证识别接口(集成 OCR)
  - 车辆匹配功能(根据 VIN)
  - 确认上牌功能(更新车辆信息)

- 技术实现
  - 遵循 BPM/System 模块的 RPC API 模式
  - 使用 Feign 实现服务间调用
  - Base64 编码传输图片数据
  - 统一返回格式 CommonResult<T>

- 文档
  - OCR 模块使用文档
  - OCR 部署指南
  - 车辆上牌管理总结
  - API 集成规划和总结
2026-03-12 20:33:21 +08:00

57 lines
2.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- OCR 识别记录表
CREATE TABLE IF NOT EXISTS `ocr_record` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`scene` VARCHAR(50) NOT NULL COMMENT '识别场景vehicle_license/driver_license/id_card等',
`provider` VARCHAR(50) NOT NULL COMMENT 'OCR 厂商baidu/tencent/aliyun',
`image_url` VARCHAR(500) COMMENT '图片URL',
`image_size` INT COMMENT '图片大小(字节)',
`result` TEXT COMMENT '识别结果JSON格式',
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '识别状态0-成功 1-失败)',
`error_msg` VARCHAR(500) COMMENT '错误信息',
`cost_time` INT COMMENT '识别耗时(毫秒)',
`creator` VARCHAR(64) DEFAULT '' COMMENT '创建者',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` VARCHAR(64) DEFAULT '' COMMENT '更新者',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` BIT(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` BIGINT NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`),
INDEX `idx_scene` (`scene`),
INDEX `idx_provider` (`provider`),
INDEX `idx_create_time` (`create_time`),
INDEX `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='OCR 识别记录表';
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'OCR 识别', '', 1, 100, 0,
'/ocr', 'eye', NULL, 0, NULL
);
-- 获取刚插入的菜单ID需要手动替换 @menuId
SET @menuId = LAST_INSERT_ID();
-- 行驶证识别菜单
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'行驶证识别', 'ocr:vehicle-license:recognize', 2, 1, @menuId,
'vehicle-license', 'car', 'ocr/vehicleLicense/index', 0, 'OcrVehicleLicense'
);
-- 识别记录菜单
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'识别记录', 'ocr:record:query', 2, 2, @menuId,
'record', 'list', 'ocr/record/index', 0, 'OcrRecord'
);