| | |
| | | // @Tags Task |
| | | // @Summary 获取任务列表2 |
| | | // @Produce application/json |
| | | // @Param object query request.SimpleTaskList true "查询参数" |
| | | // @Success 200 {object} contextx.Response{data=map[int32]response.taskResponse} "成功" |
| | | // @Param object query request.TaskListByChannel true "查询参数" |
| | | // @Success 200 {object} contextx.Response{data=map[int32]response.TaskResponse} "成功" |
| | | // @Router /v1/task/listByChannel [get] |
| | | func (slf *TaskApi) TaskListByChannel(c *gin.Context) { |
| | | var params request.TaskListByChannel |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/list": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Device" |
| | | ], |
| | | "summary": "获取当前面板绑定的设备列表", |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.DeviceListResponse" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/set": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "设备" |
| | | ], |
| | | "summary": "设置当前设备id", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.SetCurrentDevice" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/plc/productProgress": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.ProductProgress" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/plc/productProgressRealTime": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产数量" |
| | | ], |
| | | "summary": "实时获取生产进度", |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | |
| | | "summary": "获取任务", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "deviceID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/task/listByChannel": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Task" |
| | | ], |
| | | "summary": "获取任务列表2", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "description": "通道号。不传取全部的", |
| | | "name": "channel", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "deviceID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "默认3", |
| | | "name": "limit", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "默认0", |
| | | "name": "offset", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "type": "integer", |
| | | "x-enum-varnames": [ |
| | | "QueryTypeUnFinish", |
| | | "QueryTypeToday", |
| | | "QueryTypeFinished" |
| | | ], |
| | | "description": "1 未完成 2 今天未完成 3 已完成", |
| | | "name": "type", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "object", |
| | | "additionalProperties": { |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "constvar.Parity": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "x-enum-comments": { |
| | | "ParityEven": "奇校验", |
| | | "ParityNull": "无校验", |
| | | "ParityOdd": "偶校验" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "ParityEven", |
| | | "ParityOdd", |
| | | "ParityNull" |
| | | ] |
| | | }, |
| | | "constvar.PlcMethod": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "modbusTCP", |
| | | "modbusRTU", |
| | | "serial", |
| | | "网络", |
| | | "串口" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "PlcMethodModbusTCP", |
| | | "PlcMethodModbusRTU", |
| | | "PlcMethodSerial", |
| | | "PlcMethodModbusTCPChinese", |
| | | "PlcMethodSerialChinese" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "address": { |
| | | "description": "PortName string ` + "`" + `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"` + "`" + `\nFrequency int ` + "`" + `gorm:\"comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"` + "`" + `", |
| | | "description": "plc ip地址, method = modbusTCP用", |
| | | "type": "string" |
| | | }, |
| | | "baudRate": { |
| | |
| | | "brand": { |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "dataBit": { |
| | | "description": "数据位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.DevicePlcAddress" |
| | | } |
| | | }, |
| | | "deviceID": { |
| | | "description": "设备编号", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "method": { |
| | | "$ref": "#/definitions/constvar.PlcMethod" |
| | | }, |
| | | "parity": { |
| | | "description": "校验方式,method = modbusRTU 用", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Parity" |
| | | } |
| | | ] |
| | | }, |
| | | "port": { |
| | | "description": "plc 端口号, method = modbusTCP用", |
| | | "type": "integer" |
| | | }, |
| | | "serialName": { |
| | | "description": "串口名称,method = serial时 用", |
| | | "type": "string" |
| | | }, |
| | | "stopBit": { |
| | | "description": "停止位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "networkCard" |
| | | ], |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "dns": { |
| | | "description": "dns", |
| | | "type": "string" |
| | |
| | | "$ref": "#/definitions/model.NetConfigStatus" |
| | | } |
| | | ] |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "amount": { |
| | | "type": "number" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "customer": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deliverDate": { |
| | | "type": "string" |
| | | }, |
| | | "endTime": { |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderAttr": { |
| | |
| | | "unit": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "workOrderId": { |
| | | "type": "string" |
| | | } |
| | |
| | | "model.PlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "channel": { |
| | | "description": "通道", |
| | | "type": "integer" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deviceId": { |
| | | "type": "string" |
| | |
| | | "description": "工艺模型编号", |
| | | "type": "string" |
| | | }, |
| | | "realEndTime": { |
| | | "type": "integer" |
| | | }, |
| | | "realStartTime": { |
| | | "type": "integer" |
| | | }, |
| | | "startTime": { |
| | | "type": "integer" |
| | | }, |
| | | "status": { |
| | | "$ref": "#/definitions/model.ProcedureStatus" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "model.ProcessModel": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deviceId": { |
| | | "description": "用于过滤获取nsq消息", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "isUpdate": { |
| | | "description": "前端用", |
| | |
| | | "product": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "QueryTypeUnFinish", |
| | | "QueryTypeToday", |
| | | "QueryTypeFinished" |
| | | ] |
| | | }, |
| | | "request.SendProcessParams": { |
| | | "type": "object", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.SetCurrentDevice": { |
| | | "type": "object", |
| | | "properties": { |
| | | "currentDeviceID": { |
| | | "description": "当前选定的生产设备", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlc": { |
| | | "type": "object", |
| | | "properties": { |
| | | "address": { |
| | | "description": "PortName string ` + "`" + `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"` + "`" + `\nFrequency int ` + "`" + `gorm:\"comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"` + "`" + `", |
| | | "description": "plc ip地址, method = modbusTCP用", |
| | | "type": "string" |
| | | }, |
| | | "baudRate": { |
| | |
| | | "brand": { |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "dataBit": { |
| | | "description": "数据位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.DevicePlcAddress" |
| | | } |
| | | }, |
| | | "deviceID": { |
| | | "description": "设备编号", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "method": { |
| | | "$ref": "#/definitions/constvar.PlcMethod" |
| | | }, |
| | | "parity": { |
| | | "description": "校验方式,method = modbusRTU 用", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Parity" |
| | | } |
| | | ] |
| | | }, |
| | | "port": { |
| | | "description": "plc 端口号, method = modbusTCP用", |
| | | "type": "integer" |
| | |
| | | "serialName": { |
| | | "description": "串口名称,method = serial时 用", |
| | | "type": "string" |
| | | }, |
| | | "stopBit": { |
| | | "description": "停止位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.DeviceListResponse": { |
| | | "type": "object", |
| | | "properties": { |
| | | "currentDeviceID": { |
| | | "description": "当前选定的生产设备", |
| | | "type": "string" |
| | | }, |
| | | "deviceIDList": { |
| | | "description": "生产设备id列表", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "string" |
| | | } |
| | | }, |
| | | "systemDeviceID": { |
| | | "description": "工控机设备ID", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/list": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Device" |
| | | ], |
| | | "summary": "获取当前面板绑定的设备列表", |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.DeviceListResponse" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/device/set": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "设备" |
| | | ], |
| | | "summary": "设置当前设备id", |
| | | "parameters": [ |
| | | { |
| | | "description": "查询参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.SetCurrentDevice" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/plc/productProgress": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.ProductProgress" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/plc/productProgressRealTime": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "生产数量" |
| | | ], |
| | | "summary": "实时获取生产进度", |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | |
| | | "summary": "获取任务", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "deviceID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/v1/task/listByChannel": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "Task" |
| | | ], |
| | | "summary": "获取任务列表2", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "description": "通道号。不传取全部的", |
| | | "name": "channel", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "deviceID", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "默认3", |
| | | "name": "limit", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "默认0", |
| | | "name": "offset", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "type": "integer", |
| | | "x-enum-varnames": [ |
| | | "QueryTypeUnFinish", |
| | | "QueryTypeToday", |
| | | "QueryTypeFinished" |
| | | ], |
| | | "description": "1 未完成 2 今天未完成 3 已完成", |
| | | "name": "type", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/contextx.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "object", |
| | | "additionalProperties": { |
| | | "$ref": "#/definitions/response.TaskResponse" |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "constvar.Parity": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "x-enum-comments": { |
| | | "ParityEven": "奇校验", |
| | | "ParityNull": "无校验", |
| | | "ParityOdd": "偶校验" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "ParityEven", |
| | | "ParityOdd", |
| | | "ParityNull" |
| | | ] |
| | | }, |
| | | "constvar.PlcMethod": { |
| | | "type": "string", |
| | | "enum": [ |
| | | "modbusTCP", |
| | | "modbusRTU", |
| | | "serial", |
| | | "网络", |
| | | "串口" |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "PlcMethodModbusTCP", |
| | | "PlcMethodModbusRTU", |
| | | "PlcMethodSerial", |
| | | "PlcMethodModbusTCPChinese", |
| | | "PlcMethodSerialChinese" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "address": { |
| | | "description": "PortName string `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"`\nFrequency int `gorm:\"comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"`", |
| | | "description": "plc ip地址, method = modbusTCP用", |
| | | "type": "string" |
| | | }, |
| | | "baudRate": { |
| | |
| | | "brand": { |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "dataBit": { |
| | | "description": "数据位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.DevicePlcAddress" |
| | | } |
| | | }, |
| | | "deviceID": { |
| | | "description": "设备编号", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "method": { |
| | | "$ref": "#/definitions/constvar.PlcMethod" |
| | | }, |
| | | "parity": { |
| | | "description": "校验方式,method = modbusRTU 用", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Parity" |
| | | } |
| | | ] |
| | | }, |
| | | "port": { |
| | | "description": "plc 端口号, method = modbusTCP用", |
| | | "type": "integer" |
| | | }, |
| | | "serialName": { |
| | | "description": "串口名称,method = serial时 用", |
| | | "type": "string" |
| | | }, |
| | | "stopBit": { |
| | | "description": "停止位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "networkCard" |
| | | ], |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "dns": { |
| | | "description": "dns", |
| | | "type": "string" |
| | |
| | | "$ref": "#/definitions/model.NetConfigStatus" |
| | | } |
| | | ] |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "amount": { |
| | | "type": "number" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "customer": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deliverDate": { |
| | | "type": "string" |
| | | }, |
| | | "endTime": { |
| | | "type": "integer" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "orderAttr": { |
| | |
| | | "unit": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "workOrderId": { |
| | | "type": "string" |
| | | } |
| | |
| | | "model.PlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | |
| | | "channel": { |
| | | "description": "通道", |
| | | "type": "integer" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deviceId": { |
| | | "type": "string" |
| | |
| | | "description": "工艺模型编号", |
| | | "type": "string" |
| | | }, |
| | | "realEndTime": { |
| | | "type": "integer" |
| | | }, |
| | | "realStartTime": { |
| | | "type": "integer" |
| | | }, |
| | | "startTime": { |
| | | "type": "integer" |
| | | }, |
| | | "status": { |
| | | "$ref": "#/definitions/model.ProcedureStatus" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "model.ProcessModel": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "deviceId": { |
| | | "description": "用于过滤获取nsq消息", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "isUpdate": { |
| | | "description": "前端用", |
| | |
| | | "product": { |
| | | "description": "产品名称", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddPlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3 |
| | | ], |
| | | "x-enum-varnames": [ |
| | | "QueryTypeUnFinish", |
| | | "QueryTypeToday", |
| | | "QueryTypeFinished" |
| | | ] |
| | | }, |
| | | "request.SendProcessParams": { |
| | | "type": "object", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.SetCurrentDevice": { |
| | | "type": "object", |
| | | "properties": { |
| | | "currentDeviceID": { |
| | | "description": "当前选定的生产设备", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlc": { |
| | | "type": "object", |
| | | "properties": { |
| | | "address": { |
| | | "description": "PortName string `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"`\nFrequency int `gorm:\"comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"`", |
| | | "description": "plc ip地址, method = modbusTCP用", |
| | | "type": "string" |
| | | }, |
| | | "baudRate": { |
| | |
| | | "brand": { |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "dataBit": { |
| | | "description": "数据位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "details": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/model.DevicePlcAddress" |
| | | } |
| | | }, |
| | | "deviceID": { |
| | | "description": "设备编号", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | |
| | | "method": { |
| | | "$ref": "#/definitions/constvar.PlcMethod" |
| | | }, |
| | | "parity": { |
| | | "description": "校验方式,method = modbusRTU 用", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Parity" |
| | | } |
| | | ] |
| | | }, |
| | | "port": { |
| | | "description": "plc 端口号, method = modbusTCP用", |
| | | "type": "integer" |
| | |
| | | "serialName": { |
| | | "description": "串口名称,method = serial时 用", |
| | | "type": "string" |
| | | }, |
| | | "stopBit": { |
| | | "description": "停止位,method = modbusRTU 用", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdatePlcBrand": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.DeviceListResponse": { |
| | | "type": "object", |
| | | "properties": { |
| | | "currentDeviceID": { |
| | | "description": "当前选定的生产设备", |
| | | "type": "string" |
| | | }, |
| | | "deviceIDList": { |
| | | "description": "生产设备id列表", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "string" |
| | | } |
| | | }, |
| | | "systemDeviceID": { |
| | | "description": "工控机设备ID", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | safeProduce: |
| | | type: string |
| | | type: object |
| | | constvar.Parity: |
| | | enum: |
| | | - 1 |
| | | - 2 |
| | | - 3 |
| | | type: integer |
| | | x-enum-comments: |
| | | ParityEven: 奇校验 |
| | | ParityNull: 无校验 |
| | | ParityOdd: 偶校验 |
| | | x-enum-varnames: |
| | | - ParityEven |
| | | - ParityOdd |
| | | - ParityNull |
| | | constvar.PlcMethod: |
| | | enum: |
| | | - modbusTCP |
| | | - modbusRTU |
| | | - serial |
| | | - 网络 |
| | | - 串口 |
| | | type: string |
| | | x-enum-varnames: |
| | | - PlcMethodModbusTCP |
| | | - PlcMethodModbusRTU |
| | | - PlcMethodSerial |
| | | - PlcMethodModbusTCPChinese |
| | | - PlcMethodSerialChinese |
| | |
| | | model.DevicePlc: |
| | | properties: |
| | | address: |
| | | description: |- |
| | | PortName string `gorm:"type:varchar(191);comment:端口名称" json:"portName"` |
| | | Frequency int `gorm:"comment:数据更新频率 0-实时更新 1-1次/秒" json:"frequency"` |
| | | description: plc ip地址, method = modbusTCP用 |
| | | type: string |
| | | baudRate: |
| | | description: 串口波特率, method = serial时 用 |
| | | type: integer |
| | | brand: |
| | | type: string |
| | | createdAt: |
| | | type: string |
| | | dataBit: |
| | | description: 数据位,method = modbusRTU 用 |
| | | type: integer |
| | | deletedAt: |
| | | type: string |
| | | details: |
| | | items: |
| | | $ref: '#/definitions/model.DevicePlcAddress' |
| | | type: array |
| | | deviceID: |
| | | description: 设备编号 |
| | | type: string |
| | | id: |
| | | type: integer |
| | | isOpen: |
| | | type: boolean |
| | | method: |
| | | $ref: '#/definitions/constvar.PlcMethod' |
| | | parity: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.Parity' |
| | | description: 校验方式,method = modbusRTU 用 |
| | | port: |
| | | description: plc 端口号, method = modbusTCP用 |
| | | type: integer |
| | | serialName: |
| | | description: 串口名称,method = serial时 用 |
| | | type: string |
| | | stopBit: |
| | | description: 停止位,method = modbusRTU 用 |
| | | type: integer |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | model.DevicePlcAddress: |
| | |
| | | type: object |
| | | model.NetConfig: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | dns: |
| | | description: dns |
| | | type: string |
| | |
| | | allOf: |
| | | - $ref: '#/definitions/model.NetConfigStatus' |
| | | description: 状态(1启用2禁用) |
| | | updatedAt: |
| | | type: string |
| | | required: |
| | | - gateway |
| | | - ip |
| | |
| | | properties: |
| | | amount: |
| | | type: number |
| | | createdAt: |
| | | type: string |
| | | customer: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | deliverDate: |
| | | type: string |
| | | endTime: |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | orderAttr: |
| | | description: 订单属性拼接的字符串,即货物描述 |
| | |
| | | $ref: '#/definitions/model.OrderStatus' |
| | | unit: |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | workOrderId: |
| | | type: string |
| | | type: object |
| | |
| | | - OrderStatusFinished |
| | | model.PlcBrand: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | model.ProcedureStatus: |
| | |
| | | channel: |
| | | description: 通道 |
| | | type: integer |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | deviceId: |
| | | type: string |
| | | endTime: |
| | |
| | | processModelNumber: |
| | | description: 工艺模型编号 |
| | | type: string |
| | | realEndTime: |
| | | type: integer |
| | | realStartTime: |
| | | type: integer |
| | | startTime: |
| | | type: integer |
| | | status: |
| | | $ref: '#/definitions/model.ProcedureStatus' |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | model.ProcessModel: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | deviceId: |
| | | description: 用于过滤获取nsq消息 |
| | | type: string |
| | | id: |
| | | type: integer |
| | | isUpdate: |
| | | description: 前端用 |
| | | type: boolean |
| | |
| | | product: |
| | | description: 产品名称 |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | request.AddPlcBrand: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | request.QueryType: |
| | | enum: |
| | | - 1 |
| | | - 2 |
| | | - 3 |
| | | type: integer |
| | | x-enum-varnames: |
| | | - QueryTypeUnFinish |
| | | - QueryTypeToday |
| | | - QueryTypeFinished |
| | | request.SendProcessParams: |
| | | properties: |
| | | procedureId: |
| | |
| | | required: |
| | | - procedureId |
| | | type: object |
| | | request.SetCurrentDevice: |
| | | properties: |
| | | currentDeviceID: |
| | | description: 当前选定的生产设备 |
| | | type: string |
| | | type: object |
| | | request.UpdatePlc: |
| | | properties: |
| | | address: |
| | | description: |- |
| | | PortName string `gorm:"type:varchar(191);comment:端口名称" json:"portName"` |
| | | Frequency int `gorm:"comment:数据更新频率 0-实时更新 1-1次/秒" json:"frequency"` |
| | | description: plc ip地址, method = modbusTCP用 |
| | | type: string |
| | | baudRate: |
| | | description: 串口波特率, method = serial时 用 |
| | | type: integer |
| | | brand: |
| | | type: string |
| | | createdAt: |
| | | type: string |
| | | dataBit: |
| | | description: 数据位,method = modbusRTU 用 |
| | | type: integer |
| | | deletedAt: |
| | | type: string |
| | | details: |
| | | items: |
| | | $ref: '#/definitions/model.DevicePlcAddress' |
| | | type: array |
| | | deviceID: |
| | | description: 设备编号 |
| | | type: string |
| | | id: |
| | | type: integer |
| | | isOpen: |
| | | type: boolean |
| | | method: |
| | | $ref: '#/definitions/constvar.PlcMethod' |
| | | parity: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.Parity' |
| | | description: 校验方式,method = modbusRTU 用 |
| | | port: |
| | | description: plc 端口号, method = modbusTCP用 |
| | | type: integer |
| | | serialName: |
| | | description: 串口名称,method = serial时 用 |
| | | type: string |
| | | stopBit: |
| | | description: 停止位,method = modbusRTU 用 |
| | | type: integer |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | request.UpdatePlcBrand: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | type: string |
| | | id: |
| | | type: integer |
| | | name: |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | response.DeviceListResponse: |
| | | properties: |
| | | currentDeviceID: |
| | | description: 当前选定的生产设备 |
| | | type: string |
| | | deviceIDList: |
| | | description: 生产设备id列表 |
| | | items: |
| | | type: string |
| | | type: array |
| | | systemDeviceID: |
| | | description: 工控机设备ID |
| | | type: string |
| | | type: object |
| | | response.ListResponse: |
| | |
| | | summary: 更新plc配置 |
| | | tags: |
| | | - Config |
| | | /v1/device/list: |
| | | post: |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/contextx.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/response.DeviceListResponse' |
| | | type: object |
| | | summary: 获取当前面板绑定的设备列表 |
| | | tags: |
| | | - Device |
| | | /v1/device/set: |
| | | post: |
| | | parameters: |
| | | - description: 查询参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.SetCurrentDevice' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/contextx.Response' |
| | | summary: 设置当前设备id |
| | | tags: |
| | | - 设备 |
| | | /v1/plc/productProgress: |
| | | post: |
| | | parameters: |
| | |
| | | $ref: '#/definitions/response.ProductProgress' |
| | | type: object |
| | | summary: 获取生产进度 |
| | | tags: |
| | | - 生产数量 |
| | | /v1/plc/productProgressRealTime: |
| | | post: |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/contextx.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/response.ProductProgress' |
| | | type: object |
| | | summary: 实时获取生产进度 |
| | | tags: |
| | | - 生产数量 |
| | | /v1/plc/setProductNumber: |
| | |
| | | /v1/task/get: |
| | | get: |
| | | parameters: |
| | | - in: query |
| | | name: deviceID |
| | | type: string |
| | | - description: 页码 |
| | | in: query |
| | | name: page |
| | |
| | | summary: 获取任务 |
| | | tags: |
| | | - Task |
| | | /v1/task/listByChannel: |
| | | get: |
| | | parameters: |
| | | - description: 通道号。不传取全部的 |
| | | in: query |
| | | name: channel |
| | | type: integer |
| | | - in: query |
| | | name: deviceID |
| | | type: string |
| | | - description: 默认3 |
| | | in: query |
| | | name: limit |
| | | type: integer |
| | | - description: 默认0 |
| | | in: query |
| | | name: offset |
| | | type: integer |
| | | - description: 1 未完成 2 今天未完成 3 已完成 |
| | | enum: |
| | | - 1 |
| | | - 2 |
| | | - 3 |
| | | in: query |
| | | name: type |
| | | type: integer |
| | | x-enum-varnames: |
| | | - QueryTypeUnFinish |
| | | - QueryTypeToday |
| | | - QueryTypeFinished |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/contextx.Response' |
| | | - properties: |
| | | data: |
| | | additionalProperties: |
| | | $ref: '#/definitions/response.TaskResponse' |
| | | type: object |
| | | type: object |
| | | summary: 获取任务列表2 |
| | | tags: |
| | | - Task |
| | | /v1/task/sendProcessParams: |
| | | post: |
| | | parameters: |