refactor: 合并 biz_support_unit/biz_execution_unit/biz_service_org 为 biz_org, 删除 2 张孤儿表, 改 biz_person.work_unit → org_id FK
主要改动: - SQL: biz_support_unit → biz_org, 加 org_type, 加 business_nature; 删 biz_execution_unit, biz_service_org - SQL: biz_project.support_unit_id/name + service_org_id/name → org_id/name/type - SQL: biz_meeting.support_unit_name → org_name - SQL: biz_person.work_unit → org_id (FK) - 后端: 新 BizOrg entity/mapper/service/controller - 后端: BizProject/BizMeeting 字段重命名 - 后端: 删 12 个 BizSupportUnit/BizExecutionUnit/BizServiceOrg Java 文件 - 后端: BizPersonImportVO.workUnit → orgName (导入时查 biz_org 取 org_id) - 后端: BizAuthController.registerExecutor 完整实现 (原 registerSupplier stub) - 前端: 新 admin/Orgs.vue + manager/Orgs.vue (原 SupportUnits) - 前端: RegisterExecutor.vue (原 RegisterSupplier, 单页 2 步) - 前端: sponsor/executor/manager 多个文件 workUnit → orgId/orgName 重命名 - 前端: 统一 supplier → executor, 业务命名 sponsor(赞助方) / executor(执行方=供应商) - 前端: 全工程 execution → executor (company type / role / person unit_type)
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
// 公开门户 API
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 首页:项目公示 + 公示公告 + 资源
|
||||
export const getPublicIndex = () => request.get('/business/public/index')
|
||||
|
||||
// 项目公示分页
|
||||
export const listPublicProjects = (params) => request.get('/business/public/announcements', { params })
|
||||
|
||||
// 公示详情
|
||||
export const getPublicAnnouncement = (annId) => request.get(`/business/public/announcement/${annId}`)
|
||||
|
||||
// 支持函详情
|
||||
export const getPublicSupportLetter = (annId) => request.get(`/business/public/supportLetter/${annId}`)
|
||||
|
||||
// 邀请函详情(参会邀请)
|
||||
export const getPublicInvitation = (annId) => request.get(`/business/public/invitation/${annId}`)
|
||||
|
||||
// 业务字典
|
||||
export const getDictTypes = () => request.get('/business/dict/types')
|
||||
export const getDictData = (dictType) => request.get('/business/dict/data', { params: { dictType } })
|
||||
|
||||
// 业务认证
|
||||
export const bizLogin = (data) => request.post('/business/auth/login', data)
|
||||
export const registerExpert = (data) => request.post('/business/auth/registerExpert', data)
|
||||
export const registerExecutor = (data) => request.post('/business/auth/registerExecutor', data)
|
||||
export const registerSponsor = (data) => request.post('/business/auth/registerSponsor', data)
|
||||
|
||||
// 业务 CRUD(generic)
|
||||
// announcement 后端接口未实现, 已改为调 RuoYi 系统通知接口 /system/notice/list
|
||||
const STUB_ENTITIES = new Set(['announcement'])
|
||||
export const bizList = (entity, params) => {
|
||||
if (STUB_ENTITIES.has(entity)) {
|
||||
return Promise.resolve({ code: 200, msg: 'ok', data: { rows: [], total: 0 } })
|
||||
}
|
||||
return request.get(`/business/${entity}/list`, { params })
|
||||
}
|
||||
|
||||
// 系统通知(RuoYi sys_notice 表)
|
||||
// 返回 {id, title, category, text, time, read, type, content}
|
||||
export const listNotices = async (params = { pageNum: 1, pageSize: 5 }) => {
|
||||
const { data } = await request.get('/system/notice/list', { params })
|
||||
const rows = data?.rows || []
|
||||
return rows.map(n => {
|
||||
// notice_content 是 longblob HTML, 提取纯文本
|
||||
const html = String(n.noticeContent || '')
|
||||
const text = html.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim().slice(0, 200)
|
||||
return {
|
||||
id: n.noticeId,
|
||||
title: n.noticeTitle,
|
||||
category: n.noticeType === '2' ? '公告' : '通知',
|
||||
text: text || (n.remark || '请查看通知内容'),
|
||||
time: n.createTime ? new Date(n.createTime.replace(/-/g, '/')).toLocaleString('zh-CN') : '',
|
||||
read: !!n.isRead,
|
||||
type: n.noticeType,
|
||||
content: html,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 个人通知 (biz_message 表) — 给当前用户发
|
||||
// 返回 {rows: [{id, title, text, time, read, type, content, bizType, bizId}], unread, total}
|
||||
const MSG_TYPE_LABEL = { '1': '通知', '2': '待办', '3': '系统' }
|
||||
export const listMyMessages = async (params = { limit: 5 }) => {
|
||||
const { data } = await request.get('/business/message/my', { params })
|
||||
const rows = data?.rows || []
|
||||
return {
|
||||
rows: rows.map(m => ({
|
||||
id: m.msgId,
|
||||
title: m.title,
|
||||
category: MSG_TYPE_LABEL[m.msgType] || '通知',
|
||||
text: String(m.content || '').replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim().slice(0, 200),
|
||||
time: m.createTime ? new Date(m.createTime.replace(/-/g, '/')).toLocaleString('zh-CN') : '',
|
||||
read: m.isRead === '1',
|
||||
type: m.msgType,
|
||||
content: m.content,
|
||||
bizType: m.bizType,
|
||||
bizId: m.bizId,
|
||||
})),
|
||||
unread: data?.unread || 0,
|
||||
total: data?.total || 0,
|
||||
}
|
||||
}
|
||||
|
||||
// 标记单条已读
|
||||
export const markMessageRead = (msgId) => request.put(`/business/message/read/${msgId}`)
|
||||
// 全部标记已读
|
||||
export const markAllMessagesRead = () => request.put('/business/message/readAll')
|
||||
|
||||
export const bizGet = (entity, id) => request.get(`/business/${entity}/${id}`)
|
||||
export const bizAdd = (entity, data) => request.post(`/business/${entity}`, data)
|
||||
export const bizUpdate = (entity, data) => request.put(`/business/${entity}`, data)
|
||||
export const bizDelete = (entity, ids) => request.delete(`/business/${entity}/${ids}`)
|
||||
Reference in New Issue
Block a user