Commit Graph
100 Commits
Author SHA1 Message Date
adminandClaude Fable 5 f7eff14342 feat(mobile): voice-first master replies with WeChat-style unread dot and 转文字
客户 2026-07-18 追加要求:师傅回复先以语音消息呈现(微信式),
未读带红点,点击播放,可选「转文字」展开全文;同时优化长文刷屏布局。

speech.ts:
- 播放控制器新增 preload(text):预合成 TTS 并写入源缓存(不播放),
  供语音气泡在首次点击前显示时长;失败返回 null
- 新增 measureAudioDuration(source):经 metadata 探测音频秒长(8s 超时兜底)

sop/index.vue:
- MasterMsg 增加 voiceStatus(preparing/ready/unavailable)/voiceDuration/
  unread/transcriptOpen
- 答案到达即后台预合成语音(说话内容=直接答案 answer 字段),
  就绪后气泡显示「🔊 N"」+未读红点;点击播放(再点停止,播放态变色),
  播放即清红点;「转文字」灰 chip 展开完整结构化内容
  (要点/提醒/引用/总结卡/反馈),微信同款交互
- TTS 不可用或答案为空时自动回退为纯文本气泡(播报按钮保留),
  训练概况等数据型回复直接文本呈现
- 布局优化:头部压缩,长文默认收进「转文字」,线程不再整段刷屏

验证:
- 本地:时长 13" 真实测得、红点播放后消失、转文字展开全文,3 张截图目检
- 生产冒烟:语音气泡+时长+红点+转文字 chip 全部就位
- H5 已发布(备份 h5-before-20260718045801)

说明:每条答案一次 TTS 合成调用(有缓存),试点量级成本可忽略;
练页会话化(批次二)将复用同一套语音气泡形态。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:59:11 +08:00
adminandClaude Fable 5 bf1e881a8c feat(mobile): rebuild SOP ask page as WeChat-style chat (batch 1)
客户 2026-07-18 新要求:语音文字交互改为微信聊天式,替代表单式操作
(客户原话 > Figma,已记入版本对比冲突表)。

新增 components/chat/ChatComposer.vue(可复用,练页批次二直接使用):
- 微信式输入条:⊕功能面板(图片/视频、选音频转文字、训练概况)、
  按住说话(touch+mouse,松开即发送/滑出取消)、麦克风⇄键盘切换、
  文本发送;录音兜底:环境不支持自动转选音频
- 快捷问题 chips 横向滚动置于输入条上方;附件以可移除 chip 展示

pages/user/sop/index.vue 重构为消息流模型:
- user/master/system/pending 四类消息;答案气泡内含要点/提醒/无依据提示,
  操作行=播报、引用N条(折叠展开)、总结卡、有帮助/没解决(逐条反馈)
- 语音松开即发送(按用户决策):转写成功直接成为消息(带🎤标),
  失败以系统气泡提示;选音频同语义
- 登录守卫、pending query/tool、主管学员态、生成计数取消、
  onHide/onUnload 清理全部保留;总结卡弹窗(下载/播报)原样保留

验证:
- 本地(构建产物+生产API)9 张截图人工目检:空态/快捷词问答/引用展开/
  键盘输入发送/按住录音/语音失败系统气泡/⊕面板/总结卡/超大字号档
- 生产冒烟:composer 存在 + 完整问答回合渲染通过
- H5 已发布(备份 h5-before-20260718044611)

批次二(待办):练页会话化(复用 ChatComposer)、web-ai 页统一、
旧表单样式清理。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:47:33 +08:00
adminandClaude Fable 5 dfd82e1886 fix: unify all aihr collations, stop silent logout on biz 403, enable knowledge apps
线上现象:「问」页语音提问报 401(请求不带 token),用户观察为
「点了几个页面后登录状态失效」。

根因链(逐环生产验证):
1. 问师傅 /api/knowledge/query 对真实登录返回业务 403
   「当前登录端未启用知识问答应用」——生产 aihr_knowledge_app 为空表,
   多租户知识平台的应用注册/空间绑定/角色授权从未在生产配置(P1 遗留)。
2. 前端 readPayload 把 403 也视为认证失败并 clearAuth() —— 业务 403
   触发静默登出,localStorage token 被清。
3. 之后语音 ASR 请求裸奔 -> 401「未能读取到有效 token」。

同期回归:凌晨对 aihr_practice_assignment.ext_party_id 的单列 collation
热修复,使其与 aihr_practice_session(仍 0900_ai_ci)的 JOIN 反向失配,
/practice/mistakes 500。

修复:
- backend/script/sql/update/aihr_20260718_unify_all_collations_mysql8.sql:
  47 张 aihr 表全部 CONVERT 到运行时基准 collation(生产=general_ci),
  终结 collation 打地鼠;本地验证后已在生产执行
  (schema 备份 /opt/wygj/backups/aihr-schema-before-unify-20260718041407.sql),
  13 项移动端接口回归全 200(含 mistakes)。
- api.ts/auth.ts:本地登录态仅在真正 401(HTTP 或业务码)时清除,并经
  redirectToLoginForAuthLoss 记住当前页自动回登录(2s 防抖,登录页内不跳);
  业务 403(权限拒绝,如录音归属/知识空间)只报错不登出;
  authenticatedFileUrl 同步收紧(403 不再清登录态)。
- 生产数据配置(幂等 INSERT,业务范围保守):
  · aihr_knowledge_app 注册 yc_admin(pc)/yc_mobile(app) SESSION 应用
  · yc_mobile 绑定 SOP 域 5 库(1001/1002/1003/1201/1202),
    employee/supervisor ROLE READ;yc_admin 绑定全部 13 库,
    hr_operator/superadmin MANAGE
  · 财务/销售/行政等大库(1004-1010)暂仅管理端,待业务确认再放开

生产验证:
- 问师傅 query 200,真实回答+引用「投诉处理 SOP v1.0」
- E2E:登录后全 tab 浏览+语音+文字提问,token 全程稳定(storage 打桩零触发)
- 无效 token 点语音提问 -> 自动回登录页(原为死胡同 toast)
- H5 已发布(备份 h5-before-20260718042238)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:24:45 +08:00
adminandClaude Fable 5 a4bbfc2222 fix: stop snowflake ossId precision loss and daily-drill audio identity mismatch
线上现象:对练页录音转写后提交回应,报「录音不属于当前账号,请重新录音后提交」。

根因A(前端,截图直接原因):OSS 编号是雪花 ID(如 2078204068457525249),
超出 JS Number 安全整数范围,后端按 RuoYi 规范序列化为字符串,但前端 4 处
用 Number() 强转(对练 ASR、每日题 ASR、每日题恢复列表、候选人面试 ASR),
精度丢失成 …5200,后端按错误 oss_id 查归属 COUNT=0 → 误报。
生产铁证:同一暂存行,正确 id 查得 1 行,JS 强转后的 id 查得 0 行;
用损坏 id 提交 turn 复现原报错,用字符串正确 id 提交成功。

修复A:speech.ts 新增 normalizeOssId(纯字符串校验透传,禁止 Number 强转),
4 处调用点改为字符串保存,practice/candidate 服务签名与状态类型放宽为
number|string(types/api.ts 本就是 number|string,Jackson 字符串转 Long 无损)。

根因B(后端,潜伏):answerDailyDrill 用组织 extPartyId(如 1003)做录音
归属身份校验,而暂存写入的是登录手机号——每日题语音提交必失败。
修复B:新增 validateAudioOwnershipByUser,按服务端登录 owner_user_id
(与暂存同源、不可伪造)校验,对练路径(身份一致)保持原校验不变。

发布与验证:
- H5 已发布(备份 /opt/wygj/backups/h5-before-20260718035416)
- 后端 jar 已发布重启(备份 /opt/wygj/app/ruoyi-admin.jar.bak-20260718035552),
  15s 恢复,重启后对练 turn+字符串 ossId 生产复核通过
- 每日题语音路径为逻辑级+数据级验证(该账号今日无待训练每日题,
  业务级复验待下一次每日题窗口)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:57:47 +08:00
adminandClaude Fable 5 0ec0e585f7 fix(mobile): distinguish auth failure from HR mismatch on position sync page
问题:登录态失效(token 冻结/无效,后端返 401)时,同步岗位页把认证错误
误显示成「人力系统中未匹配到当前手机号的在职岗位,请联系 HR」,员工被
困在该页无路可退。

修复:
- api.ts: 新增 ApiError(statusCode/bizCode) 类型化错误与 isAuthApiError,
  readPayload/parsePayloadText/XHR 路径统一抛出带状态码的错误,消息不变
- position.ts: fetchOrgPositionResult 返回四态判别结果
  matched/unmatched/unauthorized/error;hydratePositionFromOrg 行为不变
- position/index.vue: 按四态分支处理——
  · unauthorized -> 清除登录态并自动回登录页(保留 redirect)
  · error -> 提示「网络异常…请重试」,保留重试按钮
  · unmatched -> 才显示联系 HR 文案
  并新增「退出重新登录」链接(确认弹窗后清登录态回登录页),
  避免任何异常场景下用户被困无退出路径

验证(构建产物 + 生产 API,Playwright 五场景全过,截图见
.data/visual-audit-20260718/position-fix/):
S1 固定码真实登录->今日页(保洁岗匹配) S2 无效token->自动回登录
S3 断网->网络异常提示留在本页 S4 有效token->自动通过
S5 退出链接->确认->回登录且登录态已清

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:39:20 +08:00
adminandClaude Fable 5 3baed336c7 docs: add P0 pilot acceptance checklist with production test user list
基于生产库 TEST_PROJECT_001 实际名单起草 P0 试点验收执行清单:

试点名单:
- 管理侧10人(项目经理1+主管9),覆盖权限正例、切换学员、派发、考试、团队查看
- 员工侧10人(一线员工),覆盖权限正例、语音、图片、视频、字号、每日题、问题榜、问师傅
- 越权反例3人,验证员工访问主管功能被拦截

验收范围:
- P0-1 正式OTP权限正反例(固定验证码123456,无需真实短信)
  - 员工/主管/项目经理登录流程
  - 主管切换学员模式往返
  - 主管功能访问(派发/考试/团队)
  - 员工越权访问拦截(3个反例)
  - 每日题去重与确定性轮换

- P0-2 真机能力验收(iOS+Android各2台)
  - 语音录音+ASR转文字+TTS播报+降级
  - 图片/视频上传(≤10MB/≤100MB)
  - 总结卡下载PNG到相册/Downloads
  - 全局字号三档(标准/大/超大)持久化+全局覆盖
  - 键盘导航+读屏(VoiceOver/TalkBack)

- P0-3 严格试点窗口统计(2026-07-01至07-31)
  - 完成率≥80%(≥16人完成≥10次训练)
  - 人工校准样本≥20份,AI-人工分数段一致率≥70%
  - SOP评审可用率稳定≥80%
  - 满意度问卷≥15份,平均≥4/5分

时间表:
- 2026-07-19: P0-1权限+P0-2真机验证
- 2026-07-24: P0-3中期检查
- 2026-07-31: 试点窗口结束
- 2026-08-08: P0验收报告输出

风险应急:
- 完成率不达标 → 1对1催促+任务包+延长窗口
- 真机能力失败 → 切换备用提供方/降级/扩容
- 越权拦截失效 → 立即下线+修复+重新验证

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 02:43:50 +08:00
adminandClaude Fable 5 680b4cf83c fix: align aihr_practice_assignment.ext_party_id collation to utf8mb4_general_ci
根因:生产库 aihr_practice_assignment.ext_party_id 继承表级默认 utf8mb4_0900_ai_ci,
与 aihr_practice_question_feedback.ext_party_id (utf8mb4_general_ci) 冲突,
导致 AihrPracticeSeedService.assignments() 子查询抛 ERROR 1267,
/me 接口异常,员工端误报'人力系统未匹配'。

修复:
- ALTER TABLE 对齐 ext_party_id 列排序规则为 utf8mb4_general_ci
- 已在生产热修复并验证,查询恢复正常
- 本地 docker 容器复现+修复验证通过
- 前端无需改动,H5 重新构建确认流程无误

影响范围:
- 仅 aihr_practice_assignment 表单列 MODIFY
- 保留所有数据与索引,无业务中断
- 回滚材料在 /opt/wygj/backups/release-20260718005151

遗留:
- position 页异常场景退出入口待下轮补充(P1)
- schema 规范:后续 DDL 显式声明 COLLATE,不依赖表级默认

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 02:27:11 +08:00
admin 267bb3525f docs: sync production release truth 2026-07-18 01:30:13 +08:00
admin 32fa376d63 fix: align release table collations 2026-07-18 01:04:17 +08:00
admin 6bdc86e3fc feat: restore learning feedback and knowledge capabilities 2026-07-18 00:50:11 +08:00
admin 876a23a123 feat(knowledge): add application and principal space grants 2026-07-16 10:26:28 +08:00
admin 735e9a78c1 feat(knowledge): add multi-space platform schema 2026-07-16 10:21:35 +08:00
admin 5a131b57ef fix(frontend): hide empty failure warning 2026-07-15 14:01:36 +08:00
admin 5e89e4930c docs(brd): record production organization data gate 2026-07-15 11:38:38 +08:00
admin 360067d5bf docs(brd): record production release and zip ingestion evidence 2026-07-15 11:37:56 +08:00
admin eacf1a0aea feat(mobile): align employee practice screens for release 2026-07-15 11:23:08 +08:00
admin 3541aab3fe fix(release): stabilize remote backend hash preflight 2026-07-15 08:44:37 +08:00
admin 41d223de3e docs(release): record schema gate detection 2026-07-15 03:01:05 +08:00
admin a2244c0a83 feat(release): add optional remote schema preflight 2026-07-15 03:00:10 +08:00
admin 41d37c508a docs(brd): record migration regression evidence 2026-07-15 02:58:25 +08:00
admin ce4ff716de docs(brd): record production schema gap 2026-07-15 02:57:45 +08:00
admin 197014edf7 docs(release): record current artifact preflight 2026-07-15 02:54:22 +08:00
admin 7c8ba2b30c docs(brd): record latest production resource drift 2026-07-15 02:53:01 +08:00
admin a78784393d docs(brd): sync onboarding task completion status 2026-07-15 02:51:25 +08:00
admin 82d93a1af1 feat(aihr): allow employees to complete onboarding tasks 2026-07-15 02:49:40 +08:00
admin 2f21895597 feat(aihr): add candidate voice interview answers 2026-07-15 02:45:00 +08:00
admin 40574c204d fix(aihr): separate onboarding and candidate review states 2026-07-15 02:39:29 +08:00
admin 21a13d806c docs(aihr): record release preflight drift 2026-07-15 02:27:47 +08:00
admin 14adc3e61a docs(aihr): record BRD audit checkpoint 2026-07-15 02:25:01 +08:00
admin e7611f701d test(aihr): verify project scoped sop query 2026-07-15 02:21:20 +08:00
admin 799d91a32d docs(aihr): record post-scope release drift 2026-07-15 02:19:07 +08:00
admin ab54b04f76 fix(aihr): scope formal sop topics by app projects 2026-07-15 02:17:04 +08:00
admin 4d09d068e4 docs(aihr): reconcile position sop audit status 2026-07-15 02:11:04 +08:00
admin 747112910c feat(aihr): read formal position SOP mappings 2026-07-15 02:08:51 +08:00
admin c2a0611f50 docs(aihr): refresh production audit checkpoint 2026-07-15 02:05:39 +08:00
admin d44e9440ce feat(aihr): add position qualification schema contract 2026-07-15 02:04:05 +08:00
admin 27fe838225 test(aihr): guard migration runbook coverage 2026-07-15 01:57:14 +08:00
admin e069714b76 fix(aihr): expose missing case schema in pilot gates 2026-07-15 01:56:07 +08:00
admin 1f31dfd506 fix(aihr): keep pilot gate readable on old case schema 2026-07-15 01:53:33 +08:00
admin bb810b5567 docs(aihr): reconcile BRD local pilot evidence 2026-07-15 01:50:59 +08:00
admin e7c94e7ccb docs(aihr): record post-fix release drift 2026-07-15 01:47:55 +08:00
admin 03a691c770 fix(aihr): sanitize mobile review responses 2026-07-15 01:45:57 +08:00
admin 78600ff509 docs(aihr): record current production drift 2026-07-15 01:36:00 +08:00
admin 2f44e6b7d1 fix(aihr): close practice audio URL exposure 2026-07-15 01:32:02 +08:00
admin 09c3cbecb0 fix(aihr): protect case media playback 2026-07-15 01:23:41 +08:00
admin 05ba1a249b docs(aihr): record interview release drift 2026-07-15 01:13:33 +08:00
admin 217edb09d2 fix(aihr): reject unknown interview sessions 2026-07-15 01:12:36 +08:00
admin cb429908e0 fix(aihr): restrict candidate interview flow roles 2026-07-15 01:11:08 +08:00
admin 1b3997d410 docs(aihr): record current production drift 2026-07-15 01:07:33 +08:00
admin 7272fce56f fix(aihr): require login for position sop navigation 2026-07-15 01:03:42 +08:00
admin 1ca5d1eca4 fix(aihr): version candidate interview review migration 2026-07-15 00:59:08 +08:00
admin ef21d4d61b fix(aihr): version practice session evidence migration 2026-07-15 00:53:52 +08:00
admin d9fec80e6c fix(aihr): version knowledge feedback migrations 2026-07-15 00:51:42 +08:00
admin d246bbeae7 docs(aihr): record remaining brd blockers 2026-07-15 00:48:34 +08:00
admin 34effb2319 fix(aihr): suppress rejected sop answers 2026-07-15 00:43:26 +08:00
admin 05be324738 docs(aihr): remove stale release baseline 2026-07-15 00:34:42 +08:00
admin 90d3465f7b fix(aihr): expose missing catalog schema gate 2026-07-15 00:33:27 +08:00
admin 20ae0b7ab3 docs(aihr): correct scenario audit status 2026-07-15 00:31:56 +08:00
admin 53491e075a fix(aihr): gate built-in prompt content 2026-07-15 00:30:26 +08:00
admin 357c45da31 docs(aihr): refresh production BRD audit 2026-07-15 00:28:23 +08:00
admin a5890d8463 docs(aihr): record migration contract evidence 2026-07-15 00:25:41 +08:00
admin 3478315a8d docs(aihr): record production schema drift 2026-07-15 00:24:42 +08:00
admin 60ebd37b0e docs(aihr): correct migration audit status 2026-07-15 00:23:19 +08:00
admin 69738712c2 docs(aihr): record current regression evidence 2026-07-15 00:22:15 +08:00
admin 74c8e981c7 docs(aihr): record current release drift 2026-07-15 00:19:01 +08:00
admin e37590dd25 fix(aihr): gate case learning pii 2026-07-14 23:51:24 +08:00
admin 6cebf0193d docs(aihr): refresh production release status 2026-07-14 23:47:24 +08:00
admin e01378d9ad fix(aihr): align case learning status copy 2026-07-14 23:46:27 +08:00
admin 83fdcee124 docs(aihr): sync case audit and release evidence 2026-07-14 23:45:19 +08:00
admin 0bfaee7d22 feat(aihr): complete case learning review loop 2026-07-14 23:41:59 +08:00
admin 4fc394e993 docs(aihr): add production migration runbook 2026-07-14 23:26:32 +08:00
admin 804bc62de7 fix(aihr): seed production prompt templates 2026-07-14 23:22:34 +08:00
admin 258cc95696 fix(aihr): gate pilot schema completeness 2026-07-14 23:19:28 +08:00
admin 3c5ca58425 test(aihr): cover catalog migration ordering 2026-07-14 23:17:27 +08:00
admin 82aec83cb5 fix(aihr): add practice catalog schema migration 2026-07-14 23:16:51 +08:00
admin c61edf6ea1 docs(aihr): record production case schema drift 2026-07-14 23:14:11 +08:00
admin 94f48f4c1b fix(aihr): version case media schema gate 2026-07-14 23:12:22 +08:00
admin 3c0803e0e8 docs(aihr): record case gate and release drift 2026-07-14 23:05:39 +08:00
admin 0a30fe7034 feat(aihr): align BRD scenarios and SOP seed content 2026-07-14 23:04:23 +08:00
admin cabdfafa17 docs(aihr): record pilot gate verification limit 2026-07-14 22:45:23 +08:00
admin 8c9dbf1757 docs(aihr): record normalized release verification 2026-07-14 22:43:34 +08:00
admin 48f4de0366 fix(release): normalize backend module evidence 2026-07-14 22:38:23 +08:00
admin 2f3caa46ba fix(release): validate remote backend path 2026-07-14 22:32:09 +08:00
admin 17c1ef4f06 chore(aihr): harden release evidence checks 2026-07-14 22:27:10 +08:00
admin 442082bfc9 chore(release): verify remote backend artifact 2026-07-14 22:19:52 +08:00
admin 5f8dc82462 docs(aihr): record production release evidence 2026-07-14 22:17:32 +08:00
admin ee261568a6 docs(aihr): record current release drift 2026-07-14 22:03:48 +08:00
admin ab10e56523 fix(aihr): expire unbound practice audio 2026-07-14 22:00:12 +08:00
admin d9b609b1cc fix(aihr): enforce practice audio ownership 2026-07-14 21:54:27 +08:00
admin 04b9b1bb96 fix(aihr): clean up orphaned knowledge uploads 2026-07-14 21:43:27 +08:00
admin 30a473b365 fix(aihr): clean up orphaned upload objects 2026-07-14 21:41:22 +08:00
admin dd5c0dadff fix(aihr): sanitize multipart filenames before storage 2026-07-14 21:34:45 +08:00
admin 39febf87b2 docs(aihr): record current production drift 2026-07-14 21:28:45 +08:00
admin d2b0035e3a fix(aihr): harden tenant resource boundaries 2026-07-14 21:27:47 +08:00
admin bf4c069dd7 fix(aihr): preserve dynamic tenant context 2026-07-14 21:15:37 +08:00
admin 6dfbb1458d docs(aihr): align BRD and Figma gap accounting 2026-07-14 21:12:13 +08:00
admin 8a1bee2eb7 docs(aihr): record latest online resource drift 2026-07-14 21:08:47 +08:00
admin 0de9704e65 fix(aihr): reject empty org sync requests 2026-07-14 21:05:00 +08:00
admin 2c5ed28ba3 docs(aihr): clarify figma online release status 2026-07-14 20:59:58 +08:00
admin 77c576bf5c fix(aihr): require explicit org sync dry run 2026-07-14 20:57:50 +08:00