Files
fad_oa/sql/hrm_invoice_item.sql
wangyu c412f73b80 feat(报销/拨款): 新增发票明细子表与OCR自动识别
- 新增 hrm_invoice_item 共享子表(biz_type区分报销/拨款),每条记录对应一张发票条目
- 新增 HrmInvoiceOcrService,上传附件后自动调用 ai-ocr Python服务识别发票,结果逐条回填表单
- 报销/拨款申请提交及更新时同步保存发票明细;queryById 返回关联发票条目列表
- 前端:附件上传后自动触发OCR,展示"模型思考中"状态,识别完成后自动填充金额
- 详情页新增发票明细只读表格展示,兼容无明细的历史记录
- application.yml 增加 fad.ocr 配置项

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 17:34:08 +08:00

16 lines
856 B
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.

-- 发票条目子表(报销单/拨款单共用biz_type 区分)
CREATE TABLE IF NOT EXISTS hrm_invoice_item
(
id BIGINT NOT NULL PRIMARY KEY COMMENT '主键(雪花ID)',
biz_type VARCHAR(32) NOT NULL COMMENT '业务类型 reimburse/appropriation',
biz_id BIGINT NOT NULL COMMENT '关联业务单ID',
oss_id BIGINT COMMENT '来源附件ossId',
sort_no INT DEFAULT 0 COMMENT '排序序号',
item_name VARCHAR(256) COMMENT 'OCR识别项目名称',
reason VARCHAR(512) COMMENT '事由说明(用户可编辑)',
amount DECIMAL(12, 2) DEFAULT 0 COMMENT '金额',
del_flag TINYINT DEFAULT 0 COMMENT '删除标识 0正常 2删除'
) COMMENT = '发票条目子表';
CREATE INDEX idx_biz ON hrm_invoice_item (biz_type, biz_id);