更新时间:2026-05-25
Authorization: Bearer ${token}POST /login普通接口统一返回 AjaxResult:
{
"code": 200,
"msg": "操作成功",
"data": {}
}
safety 模块列表接口返回 MyBatis Plus Page,核心字段:
data.recordsdata.totaldata.currentdata.size分页参数建议统一使用:
pageNumpageSizeLocalDate:yyyy-MM-ddLocalDateTime:yyyy-MM-dd HH:mm:ss所有 safety 实体都包含以下公共字段(新增时无需传):
idcreateBycreateTimeupdateByupdateTimeremarkdelFlag(逻辑删除)tenantIdGET /safety/personnel/listPOST /safety/personnel/addPUT /safety/personnel/updateDELETE /safety/personnel/delete/{id}GET /safety/personnel/detail/{id}GET /safety/risk/listPOST /safety/risk/addPUT /safety/risk/updateDELETE /safety/risk/delete/{id}GET /safety/risk/detail/{id}GET /safety/workArea/listGET /safety/workArea/allPOST /safety/workArea/addPUT /safety/workArea/updateDELETE /safety/workArea/delete/{id}GET /safety/workArea/detail/{id}GET /safety/equipment/listPOST /safety/equipment/addPUT /safety/equipment/updateDELETE /safety/equipment/delete/{id}GET /safety/equipment/detail/{id}GET /safety/emergency/listPOST /safety/emergency/addPUT /safety/emergency/updateDELETE /safety/emergency/delete/{id}GET /safety/emergency/detail/{id}GET /safety/inspection/record/listPOST /safety/inspection/record/addPUT /safety/inspection/record/updateDELETE /safety/inspection/record/delete/{id}POST /safety/inspection/record/sync(新增:模拟子系统同步,自动创建18条)GET /safety/inspection/statistics/todayGET /safety/inspection/statistics/trendGET /safety/inspection/statistics/typeGET /safety/inspection/statistics/inspectorGET /safety/training/material/listPOST /safety/training/material/upload(保存元数据)PUT /safety/training/material/updateDELETE /safety/training/material/delete/{id}GET /safety/training/material/detail/{id}GET /safety/training/plan/listPOST /safety/training/plan/addPUT /safety/training/plan/updateDELETE /safety/training/plan/delete/{id}GET /safety/training/plan/detail/{id}GET /safety/training/record/listPOST /safety/training/record/addPUT /safety/training/record/updateDELETE /safety/training/record/delete/{id}GET /safety/training/record/detail/{id}GET /safety/training/record/exportGET /safety/learning/record/listGET /safety/learning/record/statisticsGET /safety/learning/assessment/listPOST /safety/learning/assessment/startPOST /safety/learning/assessment/submitGET /safety/learning/report/listGET /safety/learning/report/detail/{id}GET /safety/inspection/record/list
可用筛选参数:
startDate、endDate(按巡检时间区间)inspectorId、inspectorareaId、areatypestatuspageNum、pageSize关键字段:
inspectionTimeinspectorId、inspectorareaId、areatypestatusabnormalDescisMissedstatus=0:已完成(正常)status=1:已完成(异常)status=2:已完成(漏检)status=3:未执行isMissed=1:也计入漏检统计接口:POST /safety/inspection/record/sync
用途:前端点击“同步数据”按钮时调用,系统会自动生成 18 条模拟巡检数据写入数据库,并将这 18 条记录返回给前端。
请求参数:无
调用限制:每天只能成功调用 1 次(Redis 按“租户+日期”控制)。同一天重复调用会返回失败提示:今日已同步,明天再试。
返回示例:
{
"code": 200,
"msg": "操作成功",
"data": {
"count": 18,
"records": [
{
"inspectionTime": "2026-05-25 08:20:00",
"inspectorId": 101,
"inspector": "inspector-a",
"areaId": 1,
"area": "workshop-a",
"type": "daily",
"status": 0,
"abnormalDesc": null,
"isMissed": 0
}
]
}
}
联调建议调用顺序:
POST /safety/inspection/record/syncGET /safety/inspection/record/listGET /safety/inspection/statistics/todayGET /safety/inspection/statistics/trendGET /safety/inspection/statistics/typeGET /safety/inspection/statistics/inspectortrend/type/inspector 三个统计接口若不传 startDate/endDate,后端默认最近 7 天(当天往前推 6 天)。
/safety/training/material/upload 只保存资料元数据,不接收二进制文件。
推荐流程:
POST /common/upload 上传文件url/fileName/originalFilename 后调用 POST /safety/training/material/upload 保存元数据import request from '@/utils/request'
export function syncInspectionData() {
return request({
url: '/safety/inspection/record/sync',
method: 'post'
})
}
基础地址:/safety/training/record
已开放接口:
GET /list:分页查询POST /add:新增PUT /update:修改DELETE /delete/{id}:删除GET /detail/{id}:详情GET /export:导出新增/修改请求体示例:
{
"planId": 1,
"employeeId": 1001,
"employeeName": "张三",
"content": "三级安全教育培训",
"completeTime": "2026-05-25 10:00:00",
"duration": 2.0,
"method": "线下授课",
"result": "通过",
"score": 92,
"status": 1,
"remark": "补录"
}