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,21 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function login(data) {
|
||||
return request({ url: '/login', method: 'post', data })
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return request({ url: '/logout', method: 'post' })
|
||||
}
|
||||
|
||||
export function getInfo() {
|
||||
return request({ url: '/getInfo', method: 'get' })
|
||||
}
|
||||
|
||||
export function getCaptcha() {
|
||||
return request({ url: '/captchaImage', method: 'get' })
|
||||
}
|
||||
|
||||
export function getRouters() {
|
||||
return request({ url: '/getRouters', method: 'get' })
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listBizPerson(query) {
|
||||
return request({ url: '/business/person/list', method: 'get', params: query })
|
||||
}
|
||||
|
||||
/**
|
||||
* sponsor 端专属人员列表 (后端按当前主账号 + 子账号团队强制隔离)
|
||||
* 后端返回 TableDataInfo 风格 {total, code, msg, rows}, 经 request.js 拦截器包装为 {code, msg, data: {total, rows}}
|
||||
* 这里显式解包, 让调用方直接读 res.rows / res.total
|
||||
*/
|
||||
export async function listSponsorPerson(query) {
|
||||
const { data } = await request({ url: '/business/person/sponsorList', method: 'get', params: query })
|
||||
const payload = data?.data || data
|
||||
return {
|
||||
rows: payload?.rows || [],
|
||||
total: payload?.total || 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* sponsor 专属项目列表 (团队模式: 主账号+子账号关联的项目)
|
||||
* 后端返回 TableDataInfo 风格 {total, code, msg, rows}, 经 request.js 拦截器包装为 {code, msg, data: {total, rows}}
|
||||
* 这里显式解包, 让调用方直接读 res.rows / res.total
|
||||
*/
|
||||
export async function listSponsorProjects(query) {
|
||||
const { data } = await request({ url: '/business/project/sponsorList', method: 'get', params: query })
|
||||
// 兼容两种形态: 包装后 {code, msg, data: {total, rows}} / 原始 {total, rows}
|
||||
const payload = data?.data || data
|
||||
return {
|
||||
rows: payload?.rows || [],
|
||||
total: payload?.total || 0
|
||||
}
|
||||
}
|
||||
|
||||
export function rateProject(data) {
|
||||
return request({ url: '/business/project/rate', method: 'post', data })
|
||||
}
|
||||
|
||||
export function sponsorAssignProject(data) {
|
||||
return request({ url: '/business/project/sponsorAssign', method: 'post', data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 赞助方批量分配 (多个项目同一个监察员 + 同一份说明)
|
||||
* body: [{projectId, monitorUserId, assignDesc, assignPoints}, ...]
|
||||
*/
|
||||
export function sponsorAssignBatch(data) {
|
||||
return request({ url: '/business/project/sponsorAssignBatch', method: 'post', data })
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 字典类型常量 (前端统一引用,避免拼写错误)
|
||||
export const DICT_TYPE = {
|
||||
DEPARTMENT: 'department', // 科室
|
||||
TITLE: 'title' // 医生职称
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取某类型字典的启用项 (匿名可访问)
|
||||
* @param {string} type - DICT_TYPE.*
|
||||
* @returns {Promise<{value: number, label: string, raw: object}[]>}
|
||||
* - value: deptId/titleId
|
||||
* - label: name
|
||||
* - raw: 完整字段 (含 sort/status/...)
|
||||
*/
|
||||
export async function getActiveDict(type) {
|
||||
const url = `/business/dict/${type}/active`
|
||||
const r = await request({ url, method: 'get' })
|
||||
const raw = r.data || r || []
|
||||
const idField = type === DICT_TYPE.DEPARTMENT ? 'deptId' : 'titleId'
|
||||
return raw.map(item => ({
|
||||
value: item[idField],
|
||||
label: item.name,
|
||||
raw: item
|
||||
}))
|
||||
}
|
||||
|
||||
// ===== 管理员维护接口 =====
|
||||
export function listDepartments(query) {
|
||||
return request({ url: '/business/dict/department/list', method: 'get', params: query })
|
||||
}
|
||||
export function addDepartment(data) {
|
||||
return request({ url: '/business/dict/department', method: 'post', data })
|
||||
}
|
||||
export function updateDepartment(data) {
|
||||
return request({ url: '/business/dict/department', method: 'put', data })
|
||||
}
|
||||
export function deleteDepartments(ids) {
|
||||
return request({ url: `/business/dict/department/${ids}`, method: 'delete' })
|
||||
}
|
||||
|
||||
export function listTitles(query) {
|
||||
return request({ url: '/business/dict/title/list', method: 'get', params: query })
|
||||
}
|
||||
export function addTitle(data) {
|
||||
return request({ url: '/business/dict/title', method: 'post', data })
|
||||
}
|
||||
export function updateTitle(data) {
|
||||
return request({ url: '/business/dict/title', method: 'put', data })
|
||||
}
|
||||
export function deleteTitles(ids) {
|
||||
return request({ url: `/business/dict/title/${ids}`, method: 'delete' })
|
||||
}
|
||||
@@ -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}`)
|
||||
@@ -0,0 +1,22 @@
|
||||
// 系统管理 API (用户列表 / 角色)
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 用户列表(按 userName 模糊搜索)
|
||||
export function listUser(query) {
|
||||
return request({ url: '/system/user/list', method: 'get', params: query })
|
||||
}
|
||||
|
||||
// 角色列表
|
||||
export function listRole(query) {
|
||||
return request({ url: '/system/role/list', method: 'get', params: query })
|
||||
}
|
||||
|
||||
// 按角色查询用户列表 (绕开 sys_user:list 权限)
|
||||
// 用法: listByRole({ roleType: 'executor', userName: 'exe' })
|
||||
export function listByRole(query) {
|
||||
return request({ url: '/business/executor/list', method: 'get', params: query })
|
||||
}
|
||||
|
||||
// 兼容旧名
|
||||
export const listExecutor = (query) => listByRole({ roleType: 'executor', ...query })
|
||||
export const listSupporters = (query) => listByRole({ roleType: 'sponsor', ...query })
|
||||
Reference in New Issue
Block a user