safety-eval-service/docs/openapi/监管端-安评报告数据库.openapi.yaml

511 lines
17 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

openapi: 3.0.3
info:
title: 监管端-安评报告数据库 API
description: |
对齐监管端原型页 `mod-report-library`(安评报告数据库)。
## 原型能力对照
| 原型 | 后端 |
|------|------|
| 近三年报告 / 本年度 | `GET /summary` |
| 筛选:名称编号、报送机构、年度、评价类型、行业、报送时间起止 | `GET /page` |
| 列表列:编号/名称/机构/类型/行业/签发日/报送时间 | `EvalReportLibraryCO`(含 `orgName` |
| 查看报告 | `GET /get``fileUrl` |
| AI分析 | **前端静态,无后端接口** |
| 批量下载 / 导出目录 | `POST /batch-download`ZIP、`POST /export-catalog`CSV |
| 补录历史报告 | `POST /add`(与机构端上传字段对齐,强制已报送) |
| 抽查发起/复核(与机构端整改闭环,本页列表未直出按钮) | `/eval-report-spotcheck/**` |
与机构端关系:机构 `submit`/`archive`/`add(submitToRegulator)` → `submit_flag=1` 后进入监管库;监管抽查 → 机构整改 → 监管复核。
**Apifox 导入**:项目设置 → 导入数据 → OpenAPI → 选择本文件。
成功:`success=true` 且 `code="0"`(文件流接口直接返回附件,失败时返回 JSON
version: 1.1.0
contact:
name: safety-eval-service
servers:
- url: http://localhost:8095
description: 本地开发
- url: http://192.168.20.100:30140
description: 测试网关100
tags:
- name: 监管端-安评报告库
description: 报告数据库列表/详情/汇总/补录
- name: 监管端-报告抽查
description: 发起抽查与复核(机构整改闭环)
paths:
/safetyEval/regulator/eval-report/summary:
get:
tags: [监管端-安评报告库]
summary: 报告数据库页顶栏汇总
operationId: regulatorEvalReportSummary
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseRegulatorEvalReportSummaryCO'
example:
success: true
code: "0"
data:
recentThreeYearCount: 286
currentYearCount: 92
submittedTotalCount: 310
/safetyEval/regulator/eval-report/page:
get:
tags: [监管端-安评报告库]
summary: 分页查询已报送报告
description: 默认仅返回 `submitFlag=1`(机构已报送/归档入库)的报告。
operationId: regulatorEvalReportPage
parameters:
- $ref: '#/components/parameters/current'
- $ref: '#/components/parameters/size'
- name: keyword
in: query
description: 报告名称 / 编号
schema: { type: string }
- name: orgId
in: query
description: 机构 id精确
schema: { type: integer, format: int64 }
- name: orgName
in: query
description: 报送机构名称(模糊,按机构表 unitName 解析)
schema: { type: string }
- name: reportYear
in: query
schema: { type: integer, example: 2026 }
- name: evalTypeCode
in: query
description: PRE / ACCEPT / STATUS
schema: { type: string, example: PRE }
- name: industryCode
in: query
schema: { type: string, example: HAZCHEM }
- name: reportStatusCode
in: query
description: 1已入库 2抽查中 3待整改 4已复核
schema: { type: integer }
- name: archiveTimeStart
in: query
description: 报送时间起 yyyy-MM-dd
schema: { type: string, example: '2026-01-01' }
- name: archiveTimeEnd
in: query
description: 报送时间止 yyyy-MM-dd
schema: { type: string, example: '2026-12-31' }
- name: submitFlag
in: query
description: 默认 1一般无需传
schema: { type: integer, example: 1 }
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/PageResponseEvalReportLibraryCO'
/safetyEval/regulator/eval-report/get:
get:
tags: [监管端-安评报告库]
summary: 报告详情
operationId: regulatorEvalReportGet
parameters:
- name: id
in: query
required: true
schema: { type: string }
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportLibraryCO'
/safetyEval/regulator/eval-report/add:
post:
tags: [监管端-安评报告库]
summary: 补录历史报告
description: |
监管侧补录;`submitFlag` 固定为已报送。
字段与机构端上传对齐(行业、被评价单位、签发日、页数、保密等)。
文件先走统一上传拿 `fileUrl`。
operationId: regulatorEvalReportAdd
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegulatorEvalReportAddCmd'
example:
orgId: 10001
reportNo: CQAP-2026-0715
reportName: 华安化工园区安全预评价报告
reportYear: 2026
evalTypeCode: PRE
evalTypeName: 安全预评价
industryCode: HAZCHEM
industryName: 危险化学品
evaluatedUnitName: 重庆华安化工有限公司
issueDate: '2026-07-15'
pageCount: 186
fileUrl: https://oss.example.com/reports/xxx.pdf
fileName: 华安化工预评价.pdf
secretLevelCode: NORMAL
secretLevelName: 普通
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportLibraryCO'
/safetyEval/regulator/eval-report/batch-download:
post:
tags: [监管端-安评报告库]
summary: 批量下载报告文件ZIP
description: |
按勾选报告 ID 拉取各自 `fileUrl` 打包为 ZIP。
上限 50 份;无有效文件地址时报错 06-07-012。
成功直接返回 `application/zip` 附件流。
operationId: regulatorEvalReportBatchDownload
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegulatorEvalReportBatchDownloadCmd'
example:
ids: [10001, 10002, 10003]
responses:
'200':
description: ZIP 文件流,或业务失败时的 JSON
content:
application/zip:
schema:
type: string
format: binary
application/json:
schema:
$ref: '#/components/schemas/SingleResponseBase'
/safetyEval/regulator/eval-report/export-catalog:
post:
tags: [监管端-安评报告库]
summary: 导出报告目录CSV
description: |
导出「安评报告数据库目录」。
- `ids` 非空或 `scope=SELECTED`:导出勾选
- `scope=FILTERED`(默认无 ids导出当前筛选结果
- `scope=ALL`:导出全部已报送
上限 5000 行UTF-8 BOMExcel 可直接打开。
operationId: regulatorEvalReportExportCatalog
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegulatorEvalReportExportCmd'
example:
scope: FILTERED
reportYear: 2026
industryCode: HAZCHEM
responses:
'200':
description: CSV 文件流,或业务失败时的 JSON
content:
text/csv:
schema:
type: string
format: binary
application/json:
schema:
$ref: '#/components/schemas/SingleResponseBase'
/safetyEval/regulator/eval-report-spotcheck/start:
post:
tags: [监管端-报告抽查]
summary: 发起抽查
description: 报告须已入库(status=1);不合格须填整改要求,并消息通知机构。
operationId: regulatorSpotcheckStart
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegulatorSpotcheckStartCmd'
example:
reportId: 10001
checkResultCode: 2
checkResultName: 不合格
checkOpinion: 危险辨识不完整
rectifyRequire: 请补充重大危险源辨识章节并重新签章
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportSpotcheckCO'
/safetyEval/regulator/eval-report-spotcheck/review:
post:
tags: [监管端-报告抽查]
summary: 复核抽查
operationId: regulatorSpotcheckReview
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegulatorSpotcheckReviewCmd'
example:
spotcheckId: 20001
reviewResultCode: 1
reviewResultName: 通过
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportSpotcheckCO'
/safetyEval/regulator/eval-report-spotcheck/list:
get:
tags: [监管端-报告抽查]
summary: 按报告查询抽查记录
operationId: regulatorSpotcheckList
parameters:
- name: reportId
in: query
required: true
schema: { type: integer, format: int64 }
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportSpotcheckCOList'
/safetyEval/regulator/eval-report-spotcheck/get:
get:
tags: [监管端-报告抽查]
summary: 抽查详情
operationId: regulatorSpotcheckGet
parameters:
- name: id
in: query
required: true
schema: { type: string }
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/SingleResponseEvalReportSpotcheckCO'
components:
parameters:
current:
name: current
in: query
schema: { type: integer, default: 1 }
size:
name: size
in: query
schema: { type: integer, default: 10 }
schemas:
SingleResponseBase:
type: object
properties:
success: { type: boolean, example: true }
code: { type: string, example: "0" }
message: { type: string }
errCode: { type: string }
errMessage: { type: string }
EvalReportLibraryCO:
type: object
properties:
id: { type: string }
orgId: { type: string }
orgName: { type: string, description: 报送机构名称 }
projectId: { type: string }
customerId: { type: string }
evaluatedUnitName: { type: string }
reportNo: { type: string }
reportName: { type: string }
reportYear: { type: integer }
evalTypeCode: { type: string }
evalTypeName: { type: string }
industryCode: { type: string }
industryName: { type: string }
fileUrl: { type: string }
fileName: { type: string }
submitFlag: { type: integer, description: "1已报送2未报送" }
reportStatusCode: { type: integer }
reportStatusName: { type: string }
displayStatusName: { type: string }
archiveTime: { type: string, format: date-time, description: 报送/入库时间 }
issueDate: { type: string, format: date, description: 签发日期 }
pageCount: { type: integer }
secretLevelCode: { type: string }
secretLevelName: { type: string }
remarks: { type: string }
RegulatorEvalReportSummaryCO:
type: object
properties:
recentThreeYearCount: { type: integer, format: int64 }
currentYearCount: { type: integer, format: int64 }
submittedTotalCount: { type: integer, format: int64 }
RegulatorEvalReportAddCmd:
type: object
required: [orgId, reportName, fileUrl]
properties:
orgId: { type: integer, format: int64 }
projectId: { type: integer, format: int64 }
reportName: { type: string }
reportNo: { type: string }
reportYear: { type: integer }
evalTypeCode: { type: string }
evalTypeName: { type: string }
industryCode: { type: string }
industryName: { type: string }
evaluatedUnitName: { type: string }
customerId: { type: integer, format: int64 }
issueDate: { type: string, format: date }
pageCount: { type: integer }
businessScope: { type: string }
fileUrl: { type: string }
fileName: { type: string }
secretLevelCode: { type: string }
secretLevelName: { type: string }
remarks: { type: string }
RegulatorEvalReportBatchDownloadCmd:
type: object
required: [ids]
properties:
ids:
type: array
items: { type: integer, format: int64 }
maxItems: 50
RegulatorEvalReportExportCmd:
allOf:
- $ref: '#/components/schemas/RegulatorEvalReportPageQueryFields'
- type: object
properties:
ids:
type: array
items: { type: integer, format: int64 }
scope:
type: string
enum: [SELECTED, FILTERED, ALL]
description: 有 ids 时默认 SELECTED无 ids 默认 FILTERED
RegulatorEvalReportPageQueryFields:
type: object
properties:
orgId: { type: integer, format: int64 }
orgName: { type: string }
keyword: { type: string }
reportYear: { type: integer }
evalTypeCode: { type: string }
industryCode: { type: string }
reportStatusCode: { type: integer }
archiveTimeStart: { type: string }
archiveTimeEnd: { type: string }
submitFlag: { type: integer }
RegulatorSpotcheckStartCmd:
type: object
required: [reportId, checkResultCode]
properties:
reportId: { type: integer, format: int64 }
checkResultCode: { type: integer, description: "1合格2不合格" }
checkResultName: { type: string }
checkOpinion: { type: string }
rectifyRequire: { type: string, description: 不合格必填 }
RegulatorSpotcheckReviewCmd:
type: object
required: [spotcheckId, reviewResultCode]
properties:
spotcheckId: { type: integer, format: int64 }
reviewResultCode: { type: integer, description: "1通过2不通过" }
reviewResultName: { type: string }
EvalReportSpotcheckCO:
type: object
properties:
id: { type: string }
orgId: { type: string }
reportId: { type: string }
checkResultCode: { type: integer }
checkResultName: { type: string }
checkOpinion: { type: string }
rectifyRequire: { type: string }
rectifyFeedback: { type: string }
reviewResultCode: { type: integer }
reviewResultName: { type: string }
checkerId: { type: string }
checkerName: { type: string }
checkTime: { type: string, format: date-time }
SingleResponseEvalReportLibraryCO:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data: { $ref: '#/components/schemas/EvalReportLibraryCO' }
SingleResponseRegulatorEvalReportSummaryCO:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data: { $ref: '#/components/schemas/RegulatorEvalReportSummaryCO' }
PageResponseEvalReportLibraryCO:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/EvalReportLibraryCO' }
total: { type: integer, format: int64 }
SingleResponseEvalReportSpotcheckCO:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data: { $ref: '#/components/schemas/EvalReportSpotcheckCO' }
SingleResponseEvalReportSpotcheckCOList:
allOf:
- $ref: '#/components/schemas/SingleResponseBase'
- type: object
properties:
data:
type: array
items: { $ref: '#/components/schemas/EvalReportSpotcheckCO' }