feat: OCR 服务 + 会议材料模块

ry-ocr/ (新)
  本地发票识别微服务 (PaddleOCR 3.x + FastAPI, 8801)
  - QR 优先: 扫到二维码即取开票时间/发票号/金额; 没扫到/格式不合法直接判非发票, 不跑 OCR
  - 配置 QR_FULL_OCR 控制快路径(false, 0.2s)还是全字段(true, 4.5s)
  - /recognize/invoice (multipart) + /recognize/invoice/by-path (本地路径, 白名单) + /recognize/text
  - is_invoice / from_qr / qr_raw / qr_error / error_code 字段
  - 12 字段发票抽取 (regex + 启发式, 左右主体识别)
  - 超时保护 (15s 单页 / 60s 总流程) + PaddleOCR 单例 + ThreadPoolExecutor

ry-api/ruoyi-business/
  - pom.xml: 加 hutool-http/json/core 5.8.27, lombok 1.18.30 (OcrClient @Slf4j 所需)
  - ocr/: OcrClient + InvoiceResult/Fields/Line + ZipExtractor + InvoiceOcrScheduler
  - oss/: OssUploader + OssConfMeta (OCR 识别后重传 OSS)
  - config/: OcrConfig + OcrExecutorConfig (后台线程池)
  - service/impl/InvoiceOcrService: 后台提交 OCR, ZIP 路径解压识别, 替换场景先清旧
  - 会议材料 CRUD 全套 (BizMeetingAuditLog/Executor/Invoice/Material/Supervisor):
    controller + service + mapper + domain + xml

ry-vue3/
  - MeetingDetail.vue (新建): 会议详情页 (含评分维度章节, 改只读)
  - Meetings.vue / OssFileUploader.vue / router / Login.vue: 适配新字段

ry-api/ruoyi-admin/
  - RuoYiApplication.java + application.yml: 启用 @Async 异步支持

_self/
  - manager_meetings.md / manager_meeting_detail.md: 文档
This commit is contained in:
郭庆泰
2026-08-22 00:23:22 +08:00
parent edfaf4e7f5
commit c3eb8ed9c3
88 changed files with 6710 additions and 240 deletions
+16 -28
View File
@@ -243,7 +243,7 @@ async function onSubmit() {
loading.value = true
try {
const res = await login({ username: form.username, password: form.password, code: form.code || '', uuid: form.uuid || '' })
await afterLogin(res.token, form.username, autoRole(form.username))
await afterLogin(res.token, form.username)
} catch (e) {
// 错误提示已由 utils/request.js 拦截器统一弹 (ElMessage.error), 这里只刷新验证码
loadCaptcha()
@@ -255,14 +255,20 @@ async function onSubmit() {
/**
* 登录后置: 存 token → 调 /getInfo 拿真实 user → 跳角色首页
* 密码登录和短信登录共用
* 角色单一可信源: sys_user.role_type (由 /getInfo 返回), 不再按用户名推断
*/
async function afterLogin(token, displayName, fallbackRole) {
async function afterLogin(token, displayName) {
userStore.setToken(token)
let role = fallbackRole
let role = ''
try {
const info = await getInfo()
const u = info.user || {}
role = u.roleType || fallbackRole
role = u.roleType
if (!role) {
// /getInfo 拿不到 roleType → 用户无业务角色, 不让进系统
ElMessage.error('账号角色未配置, 请联系管理员')
return router.replace({ name: 'login' })
}
userStore.setUser({
userId: u.userId,
userName: u.userName || displayName,
@@ -273,20 +279,13 @@ async function afterLogin(token, displayName, fallbackRole) {
role
})
} catch {
// /getInfo 失败时回退: 只存基本信息
userStore.setUser({
userId: null,
userName: displayName,
nickName: displayName,
phonenumber: '',
accountType: 'MAIN',
parentUserId: null,
role: fallbackRole
})
// /getInfo 失败: 不存残缺 user, 让用户重新登录
ElMessage.error('获取用户信息失败, 请重新登录')
return router.replace({ name: 'login' })
}
ElMessage.success(`欢迎,${displayName}${userTypes.find(u => u.value === role)?.name || role}`)
// 没拿到角色就跳回登录页
if (!role || !roleHome[role]) return router.replace({ name: 'login' })
// 角色不在角色首页映射里 → 拒绝
if (!roleHome[role]) return router.replace({ name: 'login' })
// 带 redirect 回跳 (401/守卫带过来的原页面), 否则跳角色首页
const redirect = route.query.redirect
if (redirect) {
@@ -345,24 +344,13 @@ async function onSmsLoginSubmit() {
try {
const res = await smsLogin({ phone: smsForm.phone, smsCode: smsForm.smsCode, uuid: smsForm.uuid })
// 短信登录后无 username, 用 phone 作为显示名; fallbackRole 留空, 让 /getInfo 决定
await afterLogin(res.token, smsForm.phone, '')
await afterLogin(res.token, smsForm.phone)
} catch (e) {
// request.js 已弹错误
}
})
}
function autoRole(username) {
const u = (username || '').toLowerCase()
if (u === 'admin' || u === 'ry') return 'admin'
if (u.startsWith('manager')) return 'manager'
if (u.startsWith('doctor')) return 'doctor'
if (u.startsWith('executor')) return 'executor'
if (u.startsWith('sponsor')) return 'sponsor'
// 不匹配返回空串, 让 /getInfo 决定
return ''
}
const roleHome = {
admin: '/admin/workbench',
manager: '/manager/workbench',