zhangqian
2023-11-01 372e5032b10eddc00b7a87a862a71dea6705609c
docs/docs.go
@@ -152,6 +152,128 @@
                }
            }
        },
        "/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/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"
                ],
                "tags": [
                    "生产数量"
                ],
                "summary": "获取生产进度",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SendProcessParams"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.ProductProgress"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/plc/setProductNumber": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "生产数量"
                ],
                "summary": "设置生产总量",
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/v1/plcBrand/add": {
            "post": {
                "produces": [
@@ -274,6 +396,99 @@
                }
            }
        },
        "/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": [
                    "application/json"
                ],
                "tags": [
                    "Task"
                ],
                "summary": "新任务倒计时",
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.TaskCountdown"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/task/finish/{id}": {
            "put": {
                "produces": [
@@ -311,6 +526,45 @@
                    "Task"
                ],
                "summary": "获取任务",
                "parameters": [
                    {
                        "type": "string",
                        "name": "deviceID",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "页码",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "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"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
@@ -323,7 +577,7 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/response.TaskData"
                                            "$ref": "#/definitions/response.TaskResponse"
                                        }
                                    }
                                }
@@ -333,7 +587,82 @@
                }
            }
        },
        "/v1/task/sendProcessParams/{id}": {
        "/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"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/v1/task/sendProcessParams": {
            "post": {
                "produces": [
                    "application/json"
@@ -341,14 +670,16 @@
                "tags": [
                    "Task"
                ],
                "summary": "下发工艺参数",
                "summary": "下发工艺参数(开始任务)",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "工序id",
                        "name": "id",
                        "in": "path",
                        "required": true
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SendProcessParams"
                        }
                    }
                ],
                "responses": {
@@ -369,7 +700,7 @@
                "tags": [
                    "Task"
                ],
                "summary": "任务开始",
                "summary": "任务开始(获取工艺参数)",
                "parameters": [
                    {
                        "type": "integer",
@@ -391,14 +722,41 @@
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/response.ProcessParams"
                                            }
                                            "$ref": "#/definitions/response.ProcessParamsResponse"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/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"
                        }
                    }
                }
@@ -446,6 +804,17 @@
        "common.ProductProcedure": {
            "type": "object",
            "properties": {
                "allProcedureNames": {
                    "description": "所属工单工序列表",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "channel": {
                    "description": "通道序号",
                    "type": "integer"
                },
                "deviceId": {
                    "type": "string"
                },
@@ -461,6 +830,12 @@
                    "items": {
                        "$ref": "#/definitions/common.ProcedureMaterial"
                    }
                },
                "nextProcedureId": {
                    "type": "string"
                },
                "nextProcedureName": {
                    "type": "string"
                },
                "outputMaterials": {
                    "description": "输出物料列表",
@@ -490,6 +865,92 @@
                }
            }
        },
        "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"
            ]
        },
        "constvar.PlcStartAddressType": {
            "type": "integer",
            "enum": [
                1,
                2
            ],
            "x-enum-varnames": [
                "PlcStartAddressTypeFinishNumber",
                "PlcStartAddressTypeTotalNumber"
            ]
        },
        "constvar.PlcStartAddressValueType": {
            "type": "string",
            "enum": [
                "string",
                "int"
            ],
            "x-enum-varnames": [
                "PlcStartAddressValueTypeString",
                "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": {
@@ -506,9 +967,24 @@
            "type": "object",
            "properties": {
                "address": {
                    "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": {
@@ -517,8 +993,9 @@
                        "$ref": "#/definitions/model.DevicePlcAddress"
                    }
                },
                "frequency": {
                    "type": "integer"
                "deviceID": {
                    "description": "设备编号",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
@@ -527,12 +1004,29 @@
                    "type": "boolean"
                },
                "method": {
                    "type": "string"
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "parity": {
                    "description": "校验方式,method = modbusRTU 用",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.Parity"
                        }
                    ]
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
                },
                "portName": {
                "serialName": {
                    "description": "串口名称,method = serial时 用",
                    "type": "string"
                },
                "stopBit": {
                    "description": "停止位,method = modbusRTU 用",
                    "type": "integer"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
@@ -540,9 +1034,17 @@
        "model.DevicePlcAddress": {
            "type": "object",
            "properties": {
                "channel": {
                    "description": "数据起始地址",
                    "type": "integer"
                },
                "fieldName": {
                    "description": "对应系统字段",
                    "type": "string"
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.PlcStartAddressType"
                        }
                    ]
                },
                "length": {
                    "description": "数据长度",
@@ -554,7 +1056,11 @@
                },
                "type": {
                    "description": "数据类型",
                    "type": "string"
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.PlcStartAddressValueType"
                        }
                    ]
                }
            }
        },
@@ -567,6 +1073,12 @@
                "networkCard"
            ],
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "dns": {
                    "description": "dns",
                    "type": "string"
@@ -597,6 +1109,9 @@
                            "$ref": "#/definitions/model.NetConfigStatus"
                        }
                    ]
                },
                "updatedAt": {
                    "type": "string"
                }
            }
        },
@@ -621,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": {
@@ -655,6 +1179,9 @@
                "unit": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                },
                "workOrderId": {
                    "type": "string"
                }
@@ -664,20 +1191,31 @@
            "type": "integer",
            "enum": [
                1,
                2
                2,
                3
            ],
            "x-enum-varnames": [
                "OrderStatusUnFinished",
                "OrderStatusWaitProcess",
                "OrderStatusProcessing",
                "OrderStatusFinished"
            ]
        },
        "model.PlcBrand": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
@@ -686,16 +1224,31 @@
            "type": "integer",
            "enum": [
                1,
                2
                2,
                3
            ],
            "x-enum-varnames": [
                "ProcedureStatusUnFinished",
                "ProcedureStatusWaitProcess",
                "ProcedureStatusProcessing",
                "ProcedureStatusFinished"
            ]
        },
        "model.Procedures": {
            "type": "object",
            "properties": {
                "channel": {
                    "description": "通道",
                    "type": "integer"
                },
                "createdAt": {
                    "type": "string"
                },
                "deletedAt": {
                    "type": "string"
                },
                "deviceId": {
                    "type": "string"
                },
                "endTime": {
                    "type": "integer"
                },
@@ -710,21 +1263,130 @@
                        }
                    ]
                },
                "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",
            "required": [
                "procedureId"
            ],
            "properties": {
                "procedureId": {
                    "type": "integer"
                }
            }
        },
        "request.SetCurrentDevice": {
            "type": "object",
            "properties": {
                "currentDeviceID": {
                    "description": "当前选定的生产设备",
                    "type": "string"
                }
            }
@@ -733,9 +1395,24 @@
            "type": "object",
            "properties": {
                "address": {
                    "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": {
@@ -744,8 +1421,9 @@
                        "$ref": "#/definitions/model.DevicePlcAddress"
                    }
                },
                "frequency": {
                    "type": "integer"
                "deviceID": {
                    "description": "设备编号",
                    "type": "string"
                },
                "id": {
                    "type": "integer"
@@ -754,12 +1432,29 @@
                    "type": "boolean"
                },
                "method": {
                    "type": "string"
                    "$ref": "#/definitions/constvar.PlcMethod"
                },
                "parity": {
                    "description": "校验方式,method = modbusRTU 用",
                    "allOf": [
                        {
                            "$ref": "#/definitions/constvar.Parity"
                        }
                    ]
                },
                "port": {
                    "description": "plc 端口号,  method =  modbusTCP用",
                    "type": "integer"
                },
                "portName": {
                "serialName": {
                    "description": "串口名称,method = serial时 用",
                    "type": "string"
                },
                "stopBit": {
                    "description": "停止位,method = modbusRTU 用",
                    "type": "integer"
                },
                "updatedAt": {
                    "type": "string"
                }
            }
@@ -767,10 +1462,39 @@
        "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"
                }
            }
@@ -799,17 +1523,70 @@
                "value": {}
            }
        },
        "response.ProcessParamsResponse": {
            "type": "object",
            "properties": {
                "number": {
                    "type": "string"
                },
                "params": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/response.ProcessParams"
                    }
                }
            }
        },
        "response.ProductProgress": {
            "type": "object",
            "properties": {
                "finishNumber": {
                    "type": "integer"
                },
                "plcStatus": {
                    "type": "integer"
                },
                "totalNumber": {
                    "type": "integer"
                }
            }
        },
        "response.TaskCountdown": {
            "type": "object",
            "properties": {
                "countDownHour": {
                    "description": "倒计时 时",
                    "type": "integer"
                },
                "countDownMinute": {
                    "description": "倒计时 分",
                    "type": "integer"
                },
                "showCountDown": {
                    "description": "是否展示倒计时",
                    "type": "boolean"
                }
            }
        },
        "response.TaskData": {
            "type": "object",
            "properties": {
                "deviceName": {
                    "type": "string"
                "allProcedures": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "deviceStatus": {
                    "type": "string"
                "canStarted": {
                    "description": "是否可以开始生产",
                    "type": "boolean"
                },
                "nextProcedure": {
                    "$ref": "#/definitions/model.Procedures"
                "channel": {
                    "description": "当前任务在设备第几个通道",
                    "type": "integer"
                },
                "currentProcedureIndex": {
                    "type": "integer"
                },
                "order": {
                    "$ref": "#/definitions/model.Order"
@@ -818,6 +1595,41 @@
                    "$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"
                    }
                }
            }
        }
    }
}`