openapi: 3.0.3 info: title: 机构端-首页驾驶舱 API description: | 重庆市安全评价服务平台 - 机构端首页(驾驶舱)接口(`/container/driver?pageMode=3`)。 - 统一前缀:`/safetyEval/institution/dashboard` - 全部为**新增**聚合接口(落在 `InstitutionDashboardController`),不依赖/不改动既有机构端接口 - 鉴权:`orgId` 取自机构端请求上下文;未取到时返回空数据(不报错) - 成功响应 `code = "0"` - 大屏建议对 5 个接口加 30~60s 短 TTL 缓存,面板级相互独立 **Apifox 导入方式**:项目设置 → 导入数据 → 选择本文件(OpenAPI/Swagger 格式) version: 1.0.0 contact: name: safety-eval-service servers: - url: http://localhost:8095 description: 本地开发 - url: http://192.168.20.100:30140 description: 测试网关(100) tags: - name: 机构端-首页驾驶舱 description: 机构端首页(驾驶舱)相关聚合接口 paths: /safetyEval/institution/dashboard/project-node-stats: get: tags: - 机构端-首页驾驶舱 summary: 当前项目节点统计 description: | 当前机构项目节点统计:项目总数/法定项目 + 8 个流程节点待办数 + 已归档/项目延期。 - 数据源:`eval_project`(orgId)、`EvalProjectNodeOverviewAssembler.buildForInstitution`、延期计数 - 节点待办口径:节点状态为「未开始」 - 单项目装配异常跳过,不影响其余节点 operationId: projectNodeStats responses: '200': description: 成功 content: application/json: schema: $ref: '#/components/schemas/SingleResponseInstitutionDashboardProjectNodeStatsCO' example: success: true code: "0" data: totalProjects: 12 statutoryProjects: 8 nodeStats: - nodeCode: NODE_01 nodeName: 待风险分析 pendingCount: 3 - nodeCode: NODE_02 nodeName: 待合同录入 pendingCount: 3 - nodeCode: NODE_03 nodeName: 待项目组成立 pendingCount: 2 - nodeCode: NODE_04 nodeName: 待现场踏勘 pendingCount: 4 - nodeCode: NODE_05 nodeName: 待报告编制 pendingCount: 2 - nodeCode: NODE_06 nodeName: 待内部审核 pendingCount: 1 - nodeCode: NODE_07 nodeName: 待技术审核 pendingCount: 1 - nodeCode: NODE_08 nodeName: 待过程控制审核 pendingCount: 2 archivedProjectCount: 5 delayedProjectCount: 1 /safetyEval/institution/dashboard/notices: get: tags: - 机构端-首页驾驶舱 summary: 通知提醒 description: | 通知提醒:资质现场审查通知 / 监督检查通知 / 未读监管通知。 - 数据源:`safety_message`(按 orgId + sendType;未读=sendState!=1) - `qualOnSiteReviewCount`:sendType=ON_SITE_REVIEW_NOTICE - `inspectionCount`:sendType=INSP_NOTICE_ORG - `unreadRegulatoryCount`:本机构 sendState!=1 的消息数 operationId: notices responses: '200': description: 成功 content: application/json: schema: $ref: '#/components/schemas/SingleResponseInstitutionDashboardNoticeCO' example: success: true code: "0" data: qualOnSiteReviewCount: 2 inspectionCount: 5 unreadRegulatoryCount: 7 /safetyEval/institution/dashboard/industry-stat: get: tags: - 机构端-首页驾驶舱 summary: 服务行业项目统计 description: | 按行业统计项目数与法定项目数(柱状图)。 - 数据源:`eval_project`(orgId)按 industry_code 分组 - 行业名称取自 IndustryEnum;仅返回有项目的行业(前端按固定类目轴合并补 0) operationId: industryStat responses: '200': description: 成功 content: application/json: schema: $ref: '#/components/schemas/SingleResponseInstitutionDashboardIndustryStatCO' example: success: true code: "0" data: list: - industryCode: METAL_SMELTING industryName: 金属冶炼 projectCount: 4 statutoryProjectCount: 3 - industryCode: PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL industryName: 石油加工业,化学原料、化学品及医药制造业 projectCount: 6 statutoryProjectCount: 5 - industryCode: FIREWORKS_FIRECRACKERS industryName: 烟花爆竹制造业和仓储业 projectCount: 2 statutoryProjectCount: 0 /safetyEval/institution/dashboard/eval-type-ratio: get: tags: - 机构端-首页驾驶舱 summary: 评价类别占比 description: | 按评价类型统计项目数(环形图)。 - 数据源:`eval_project`(orgId)按 eval_type_code 分组 - 名称取自 EvalTypeEnum(PRE/ACCEPT/STATUS) operationId: evalTypeRatio responses: '200': description: 成功 content: application/json: schema: $ref: '#/components/schemas/SingleResponseInstitutionDashboardEvalTypeRatioCO' example: success: true code: "0" data: totalProjectCount: 12 items: - evalTypeCode: PRE evalTypeName: 安全预评价 count: 5 - evalTypeCode: ACCEPT evalTypeName: 安全设施竣工验收评价 count: 4 - evalTypeCode: STATUS evalTypeName: 安全现状评价 count: 3 /safetyEval/institution/dashboard/project-execution: get: tags: - 机构端-首页驾驶舱 summary: 项目执行情况 description: | 项目执行情况列表(表格)。 - 数据源:`eval_project`(orgId)、`eval_customer`(被评价企业名称) - 按 planEndDate 升序取前 limit 条(最近到期在前,空日期置尾) - 被评价企业名称解析失败置空,不影响其余行 operationId: projectExecution parameters: - name: limit in: query required: false description: 返回条数(默认 10,范围 1~50) schema: type: integer format: int32 default: 10 minimum: 1 maximum: 50 responses: '200': description: 成功 content: application/json: schema: $ref: '#/components/schemas/SingleResponseInstitutionDashboardProjectExecutionCO' example: success: true code: "0" data: list: - projectId: 101 projectNo: P-2026-001 projectName: 某化工企业安全预评价 customerName: 某化工有限公司 evalTypeCode: PRE evalTypeName: 安全预评价 projectLeaderName: 张工 planEndDate: "2026-08-15" - projectId: 102 projectNo: P-2026-002 projectName: 某金属冶炼验收评价 customerName: 某冶炼厂 evalTypeCode: ACCEPT evalTypeName: 安全设施竣工验收评价 projectLeaderName: 李工 planEndDate: "2026-09-01" components: schemas: SingleResponseInstitutionDashboardProjectNodeStatsCO: type: object properties: success: type: boolean example: true code: type: string example: "0" message: type: string errMessage: type: string data: $ref: '#/components/schemas/InstitutionDashboardProjectNodeStatsCO' SingleResponseInstitutionDashboardNoticeCO: type: object properties: success: type: boolean example: true code: type: string example: "0" message: type: string errMessage: type: string data: $ref: '#/components/schemas/InstitutionDashboardNoticeCO' SingleResponseInstitutionDashboardIndustryStatCO: type: object properties: success: type: boolean example: true code: type: string example: "0" message: type: string errMessage: type: string data: $ref: '#/components/schemas/InstitutionDashboardIndustryStatCO' SingleResponseInstitutionDashboardEvalTypeRatioCO: type: object properties: success: type: boolean example: true code: type: string example: "0" message: type: string errMessage: type: string data: $ref: '#/components/schemas/InstitutionDashboardEvalTypeRatioCO' SingleResponseInstitutionDashboardProjectExecutionCO: type: object properties: success: type: boolean example: true code: type: string example: "0" message: type: string errMessage: type: string data: $ref: '#/components/schemas/InstitutionDashboardProjectExecutionCO' InstitutionDashboardProjectNodeStatsCO: type: object description: 当前项目节点统计 properties: totalProjects: type: integer format: int32 description: 项目总数 statutoryProjects: type: integer format: int32 description: 法定项目数 nodeStats: type: array description: 8 个流程节点待办数(待办=节点状态未开始) items: $ref: '#/components/schemas/NodeStat' archivedProjectCount: type: integer format: int32 description: 已归档项目数 delayedProjectCount: type: integer format: int32 description: 项目延期数 NodeStat: type: object properties: nodeCode: type: string description: 节点编码(NODE_01..NODE_08) nodeName: type: string description: 节点展示名称(待X) pendingCount: type: integer format: int32 description: 待办数 InstitutionDashboardNoticeCO: type: object description: 通知提醒 properties: qualOnSiteReviewCount: type: integer format: int32 description: 资质现场审查通知数(sendType=ON_SITE_REVIEW_NOTICE) inspectionCount: type: integer format: int32 description: 监督检查通知数(sendType=INSP_NOTICE_ORG) unreadRegulatoryCount: type: integer format: int32 description: 未读监管通知数(sendState!=1) InstitutionDashboardIndustryStatCO: type: object description: 服务行业项目统计 properties: list: type: array description: 行业分布统计(仅返回有项目的行业) items: $ref: '#/components/schemas/IndustryStat' IndustryStat: type: object properties: industryCode: type: string description: 行业编码(IndustryEnum) industryName: type: string description: 行业名称 projectCount: type: integer format: int32 description: 项目数 statutoryProjectCount: type: integer format: int32 description: 法定项目数 InstitutionDashboardEvalTypeRatioCO: type: object description: 评价类别占比 properties: totalProjectCount: type: integer format: int32 description: 项目总数 items: type: array description: 各评价类别项目数 items: $ref: '#/components/schemas/EvalTypeRatio' EvalTypeRatio: type: object properties: evalTypeCode: type: string description: 评价类型编码(EvalTypeEnum) evalTypeName: type: string description: 评价类型名称 count: type: integer format: int32 description: 项目数 InstitutionDashboardProjectExecutionCO: type: object description: 项目执行情况 properties: list: type: array description: 项目执行情况列表(按 planEndDate 升序取前 N 条) items: $ref: '#/components/schemas/ProjectExecutionItem' ProjectExecutionItem: type: object properties: projectId: type: integer format: int64 description: 项目ID projectNo: type: string description: 项目编号 projectName: type: string description: 项目名称 customerName: type: string description: 被评价企业 evalTypeCode: type: string description: 评价类型编码 evalTypeName: type: string description: 评价类型名称 projectLeaderName: type: string description: 项目负责人 planEndDate: type: string description: 项目结束日期(yyyy-MM-dd)