zhangqian
2023-11-01 372e5032b10eddc00b7a87a862a71dea6705609c
docs/docs.go
@@ -152,26 +152,15 @@
                }
            }
        },
        "/v1/plc/productProgress": {
        "/v1/device/list": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "生产数量"
                    "Device"
                ],
                "summary": "获取生产进度",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SendProcessParams"
                        }
                    }
                ],
                "summary": "获取当前面板绑定的设备列表",
                "responses": {
                    "200": {
                        "description": "成功",
@@ -184,7 +173,7 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.ProductProgress"
                                            "$ref": "#/definitions/response.DeviceListResponse"
                                        }
                                    }
                                }
@@ -194,7 +183,37 @@
                }
            }
        },
        "/v1/plc/productProgressRealTime": {
        "/v1/device/setCurrentDeviceId": {
            "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": [
                    "application/json"
@@ -202,7 +221,7 @@
                "tags": [
                    "生产数量"
                ],
                "summary": "实时获取生产进度",
                "summary": "获取生产进度",
                "parameters": [
                    {
                        "description": "查询参数",
@@ -377,6 +396,68 @@
                }
            }
        },
        "/v1/processModel/list": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "工艺模型"
                ],
                "summary": "获取工艺模型列表",
                "parameters": [
                    {
                        "type": "string",
                        "description": "当前正在使用的工艺参数编号",
                        "name": "number",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "当前的工序id",
                        "name": "procedureId",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/model.ProcessModel"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/task/countdown": {
            "get": {
                "produces": [
@@ -447,6 +528,11 @@
                "summary": "获取任务",
                "parameters": [
                    {
                        "type": "string",
                        "name": "deviceID",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
@@ -456,6 +542,26 @@
                        "type": "integer",
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "enum": [
                            1,
                            2,
                            3
                        ],
                        "type": "integer",
                        "x-enum-comments": {
                            "TaskModeCurrent": "未开始的和进行中的",
                            "TaskModeLastFinished": "上一个结束的",
                            "TaskModeUnStarted": "未开始的"
                        },
                        "x-enum-varnames": [
                            "TaskModeUnStarted",
                            "TaskModeCurrent",
                            "TaskModeLastFinished"
                        ],
                        "name": "taskMode",
                        "in": "query"
                    }
                ],
@@ -471,7 +577,82 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.TaskData"
                                            "$ref": "#/definitions/response.TaskResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/task/list": {
            "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"
                                            }
                                        }
                                    }
                                }
@@ -550,6 +731,36 @@
                    }
                }
            }
        },
        "/v1/task/updateProcessParams": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Task"
                ],
                "summary": "更新工艺参数(进行中的任务)",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SendProcessParams"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
@@ -599,6 +810,10 @@
                    "items": {
                        "type": "string"
                    }
                },
                "channel": {
                    "description": "通道序号",
                    "type": "integer"
                },
                "deviceId": {
                    "type": "string"
@@ -650,16 +865,47 @@
                }
            }
        },
        "conf.Prompt": {
            "type": "object",
            "properties": {
                "plcNotConnected": {
                    "type": "string"
                },
                "safeProduce": {
                    "type": "string"
                }
            }
        },
        "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"
@@ -687,6 +933,24 @@
                "PlcStartAddressValueTypeInt"
            ]
        },
        "constvar.TaskMode": {
            "type": "integer",
            "enum": [
                1,
                2,
                3
            ],
            "x-enum-comments": {
                "TaskModeCurrent": "未开始的和进行中的",
                "TaskModeLastFinished": "上一个结束的",
                "TaskModeUnStarted": "未开始的"
            },
            "x-enum-varnames": [
                "TaskModeUnStarted",
                "TaskModeCurrent",
                "TaskModeLastFinished"
            ]
        },
        "contextx.Response": {
            "type": "object",
            "properties": {
@@ -703,7 +967,7 @@
            "type": "object",
            "properties": {
                "address": {
                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"type:int(11);comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"` + "`" + `",
                    "description": "plc ip地址, method = modbusTCP用",
                    "type": "string"
                },
                "baudRate": {
@@ -713,11 +977,25 @@
                "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"
@@ -728,6 +1006,14 @@
                "method": {
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "parity": {
                    "description": "校验方式,method = modbusRTU 用",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.Parity"
                        }
                    ]
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
@@ -735,12 +1021,23 @@
                "serialName": {
                    "description": "串口名称,method = serial时 用",
                    "type": "string"
                },
                "stopBit": {
                    "description": "停止位,method = modbusRTU 用",
                    "type": "integer"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
        "model.DevicePlcAddress": {
            "type": "object",
            "properties": {
                "channel": {
                    "description": "数据起始地址",
                    "type": "integer"
                },
                "fieldName": {
                    "description": "对应系统字段",
                    "allOf": [
@@ -751,10 +1048,6 @@
                },
                "length": {
                    "description": "数据长度",
                    "type": "integer"
                },
                "position": {
                    "description": "数据起始地址",
                    "type": "integer"
                },
                "startAddress": {
@@ -780,6 +1073,12 @@
                "networkCard"
            ],
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "dns": {
                    "description": "dns",
                    "type": "string"
@@ -810,6 +1109,9 @@
                            "$ref": "#/definitions/model.NetConfigStatus"
                        }
                    ]
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
@@ -834,13 +1136,22 @@
                "amount": {
                    "type": "number"
                },
                "createdAt": {
                    "type": "string"
                },
                "customer": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "deliverDate": {
                    "type": "string"
                },
                "endTime": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "orderAttr": {
@@ -868,6 +1179,9 @@
                "unit": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                },
                "workOrderId": {
                    "type": "string"
                }
@@ -889,10 +1203,19 @@
        "model.PlcBrand": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
@@ -913,6 +1236,16 @@
        "model.Procedures": {
            "type": "object",
            "properties": {
                "channel": {
                    "description": "通道",
                    "type": "integer"
                },
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "deviceId": {
                    "type": "string"
                },
@@ -920,10 +1253,6 @@
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "position": {
                    "description": "每个设备可能有多个机位同时生产,用position表示位置",
                    "type": "integer"
                },
                "procedure": {
@@ -937,24 +1266,110 @@
                "procedureId": {
                    "type": "string"
                },
                "processModelNumber": {
                    "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": "前端用",
                    "type": "boolean"
                },
                "newNumber": {
                    "type": "string"
                },
                "newParamsMap": {
                    "type": "object",
                    "additionalProperties": true
                },
                "number": {
                    "description": "工艺模型编号",
                    "type": "string"
                },
                "params": {
                    "type": "string"
                },
                "paramsMap": {
                    "type": "object",
                    "additionalProperties": true
                },
                "procedure": {
                    "description": "工序",
                    "type": "string"
                },
                "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",
@@ -962,11 +1377,17 @@
                "procedureId"
            ],
            "properties": {
                "position": {
                    "type": "integer"
                },
                "procedureId": {
                    "type": "integer"
                }
            }
        },
        "request.SetCurrentDevice": {
            "type": "object",
            "properties": {
                "currentDeviceID": {
                    "description": "当前选定的生产设备",
                    "type": "string"
                }
            }
        },
@@ -974,7 +1395,7 @@
            "type": "object",
            "properties": {
                "address": {
                    "description": "PortName   string ` + "`" + `gorm:\"type:varchar(191);comment:端口名称\" json:\"portName\"` + "`" + `\nFrequency  int    ` + "`" + `gorm:\"type:int(11);comment:数据更新频率 0-实时更新 1-1次/秒\" json:\"frequency\"` + "`" + `",
                    "description": "plc ip地址, method = modbusTCP用",
                    "type": "string"
                },
                "baudRate": {
@@ -984,11 +1405,25 @@
                "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"
@@ -999,6 +1434,14 @@
                "method": {
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "parity": {
                    "description": "校验方式,method = modbusRTU 用",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.Parity"
                        }
                    ]
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
@@ -1006,16 +1449,52 @@
                "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"
                }
            }
@@ -1098,20 +1577,59 @@
                        "type": "string"
                    }
                },
                "canStarted": {
                    "description": "是否可以开始生产",
                    "type": "boolean"
                },
                "channel": {
                    "description": "当前任务在设备第几个通道",
                    "type": "integer"
                },
                "currentProcedureIndex": {
                    "type": "integer"
                },
                "order": {
                    "$ref": "#/definitions/model.Order"
                },
                "position": {
                    "description": "当前任务在设备第几个位置",
                    "type": "integer"
                },
                "procedure": {
                    "$ref": "#/definitions/model.Procedures"
                }
            }
        },
        "response.TaskResponse": {
            "type": "object",
            "properties": {
                "channelAmount": {
                    "description": "通道数量",
                    "type": "integer"
                },
                "prompt": {
                    "description": "提示语",
                    "allOf": [
                        {
                            "$ref": "#/definitions/conf.Prompt"
                        }
                    ]
                },
                "taskCount": {
                    "description": "任务数量",
                    "type": "integer"
                },
                "tasks": {
                    "description": "任务列表",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/response.TaskData"
                    }
                },
                "workers": {
                    "description": "人员列表",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/common.ProcedureWorker"
                    }
                }
            }
        }
    }
}`