refactor(doctor/submissions): 合并到 biz_project_plan + 删除 biz_submission 死代码

- /doctor/submissions 改走 biz_project_plan,与 /manager/plans 字段/组件/状态字典完全对齐
- BizProjectPlan 加 submitter_id (BIGINT) + submitter_name (LEFT JOIN 查询字段)
- mapper 改 LEFT JOIN biz_person + sys_user,COALESCE(bp.name, u.user_name) 兜底
- biz_person.user_id 加 UNIQUE 索引 (1:1 LEFT JOIN 无笛卡尔积)
- controller 加 doctor 角色自动过滤: list 按 submitter_id, add/edit 强制 submitter_id
- 删除 7 个 BizSubmission 死代码 (Controller/Service/Mapper/Domain/XML/Enum) + 1 utils
- 路由参数 :subId → :planId (路径名 submission 保留产品文案)
- 新增 migration_submission_to_projectPlan_2026_08_18.sql
This commit is contained in:
郭庆泰
2026-08-18 00:28:40 +08:00
parent b41cf77cac
commit c9fc6ebdb8
17 changed files with 245 additions and 562 deletions
-41
View File
@@ -1,41 +0,0 @@
// 投稿状态字典 - 与后端 SubmissionStatus 枚举同步
// value 用英文 code (PENDING/APPROVED/REJECTED/DRAFT), 前端通过 label 映射中文
// locked=true 表示锁定(不可修改/提交)
export const SUBMISSION_STATUS = {
PENDING: { code: 'PENDING', label: '待审核', type: 'warning', locked: true },
APPROVED: { code: 'APPROVED', label: '审核通过', type: 'success', locked: true },
REJECTED: { code: 'REJECTED', label: '已退回', type: 'danger', locked: false },
DRAFT: { code: 'DRAFT', label: '待提交', type: 'info', locked: false }
}
// 容错: 把数据库返回的 status (字符串) 规范成 enum, 找不到原样返回
export function parseStatus(val) {
if (val === null || val === undefined || val === '') return null
const key = String(val).trim().toUpperCase()
return SUBMISSION_STATUS[key] ? key : null
}
// 获取状态 label, 容错返回 val 原值
export function statusLabel(val) {
const key = parseStatus(val)
return key ? SUBMISSION_STATUS[key].label : (val ?? '')
}
// 获取 el-tag type
export function statusType(val) {
const key = parseStatus(val)
return key ? SUBMISSION_STATUS[key].type : 'info'
}
// 是否锁定 (待审核/审核通过不可修改/提交)
export function isLocked(val) {
const key = parseStatus(val)
if (!key) return false
return SUBMISSION_STATUS[key].locked === true
}
// 筛选项列表 (用于 el-select options)
export const STATUS_OPTIONS = Object.values(SUBMISSION_STATUS).map(s => ({
label: s.label,
value: s.code
}))