| | |
| | | // @Tags 生产数量 |
| | | // @Summary 获取生产进度 |
| | | // @Produce application/json |
| | | // @Param object body request.SendProcessParams true "查询参数" |
| | | // @Param object body request.GetProductProgress true "查询参数" |
| | | // @Success 200 {object} contextx.Response{data=response.ProductProgress} "成功" |
| | | // @Router /v1/plc/productProgress [post] |
| | | func (slf *PlcApi) GetProductProgress(c *gin.Context) { |
| | |
| | | ProblemCodeNetwork ProblemCode = "network" //网络错误 |
| | | ProblemCodeDB ProblemCode = "db" //数据库连接错误 |
| | | ProblemCodeSerf ProblemCode = "serf" //未加入serf集群 |
| | | ProblemCodeNsq ProblemCode = "nsq" //未连接消息队列 |
| | | ProblemCodeCloud ProblemCode = "cloud" //未连接云端 |
| | | ProblemCodeDevice ProblemCode = "device" //未绑定设备 |
| | | ProblemCodeProcessModel ProblemCode = "process_model" //工艺参数缺失 |
| | | ProblemCodePlcConfig ProblemCode = "plc_config" //plc配置缺失 |
| | |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.SendProcessParams" |
| | | "$ref": "#/definitions/request.GetProductProgress" |
| | | } |
| | | } |
| | | ], |
| | |
| | | "network", |
| | | "db", |
| | | "serf", |
| | | "nsq", |
| | | "cloud", |
| | | "device", |
| | | "process_model", |
| | | "plc_config", |
| | |
| | | "plc_connect" |
| | | ], |
| | | "x-enum-comments": { |
| | | "ProblemCodeCloud": "未连接云端", |
| | | "ProblemCodeDB": "数据库连接错误", |
| | | "ProblemCodeDevice": "未绑定设备", |
| | | "ProblemCodeNetwork": "网络错误", |
| | | "ProblemCodeNsq": "未连接消息队列", |
| | | "ProblemCodePlcAddressList": "plc地址表缺失", |
| | | "ProblemCodePlcConfig": "plc配置缺失", |
| | | "ProblemCodePlcConnect": "plc连接失败", |
| | |
| | | "ProblemCodeNetwork", |
| | | "ProblemCodeDB", |
| | | "ProblemCodeSerf", |
| | | "ProblemCodeNsq", |
| | | "ProblemCodeCloud", |
| | | "ProblemCodeDevice", |
| | | "ProblemCodeProcessModel", |
| | | "ProblemCodePlcConfig", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.GetProductProgress": { |
| | | "type": "object", |
| | | "properties": { |
| | | "channel": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.SendProcessParams" |
| | | "$ref": "#/definitions/request.GetProductProgress" |
| | | } |
| | | } |
| | | ], |
| | |
| | | "network", |
| | | "db", |
| | | "serf", |
| | | "nsq", |
| | | "cloud", |
| | | "device", |
| | | "process_model", |
| | | "plc_config", |
| | |
| | | "plc_connect" |
| | | ], |
| | | "x-enum-comments": { |
| | | "ProblemCodeCloud": "未连接云端", |
| | | "ProblemCodeDB": "数据库连接错误", |
| | | "ProblemCodeDevice": "未绑定设备", |
| | | "ProblemCodeNetwork": "网络错误", |
| | | "ProblemCodeNsq": "未连接消息队列", |
| | | "ProblemCodePlcAddressList": "plc地址表缺失", |
| | | "ProblemCodePlcConfig": "plc配置缺失", |
| | | "ProblemCodePlcConnect": "plc连接失败", |
| | |
| | | "ProblemCodeNetwork", |
| | | "ProblemCodeDB", |
| | | "ProblemCodeSerf", |
| | | "ProblemCodeNsq", |
| | | "ProblemCodeCloud", |
| | | "ProblemCodeDevice", |
| | | "ProblemCodeProcessModel", |
| | | "ProblemCodePlcConfig", |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.GetProductProgress": { |
| | | "type": "object", |
| | | "properties": { |
| | | "channel": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.QueryType": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | - network |
| | | - db |
| | | - serf |
| | | - nsq |
| | | - cloud |
| | | - device |
| | | - process_model |
| | | - plc_config |
| | |
| | | - plc_connect |
| | | type: string |
| | | x-enum-comments: |
| | | ProblemCodeCloud: 未连接云端 |
| | | ProblemCodeDB: 数据库连接错误 |
| | | ProblemCodeDevice: 未绑定设备 |
| | | ProblemCodeNetwork: 网络错误 |
| | | ProblemCodeNsq: 未连接消息队列 |
| | | ProblemCodePlcAddressList: plc地址表缺失 |
| | | ProblemCodePlcConfig: plc配置缺失 |
| | | ProblemCodePlcConnect: plc连接失败 |
| | |
| | | - ProblemCodeNetwork |
| | | - ProblemCodeDB |
| | | - ProblemCodeSerf |
| | | - ProblemCodeNsq |
| | | - ProblemCodeCloud |
| | | - ProblemCodeDevice |
| | | - ProblemCodeProcessModel |
| | | - ProblemCodePlcConfig |
| | |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | request.GetProductProgress: |
| | | properties: |
| | | channel: |
| | | type: integer |
| | | type: object |
| | | request.QueryType: |
| | | enum: |
| | |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.SendProcessParams' |
| | | $ref: '#/definitions/request.GetProductProgress' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | |
| | | constvar.ProblemCodeNetwork, |
| | | constvar.ProblemCodeDB, |
| | | constvar.ProblemCodeSerf, |
| | | constvar.ProblemCodeNsq, |
| | | constvar.ProblemCodeCloud, |
| | | constvar.ProblemCodeDevice, |
| | | constvar.ProblemCodeProcessModel, |
| | | constvar.ProblemCodePlcConfig, |
| | |
| | | constvar.ProblemCodeNetwork: "网络连接", |
| | | constvar.ProblemCodeDB: "数据库", |
| | | constvar.ProblemCodeSerf: "serf集群", |
| | | constvar.ProblemCodeNsq: "消息队列", |
| | | constvar.ProblemCodeCloud: "消息队列", |
| | | constvar.ProblemCodeDevice: "生产设备绑定", |
| | | constvar.ProblemCodeProcessModel: "工艺参数", |
| | | constvar.ProblemCodePlcConfig: "plc配置", |
| | |
| | | checkObj = &DB{} |
| | | case constvar.ProblemCodeSerf: |
| | | checkObj = &Serf{} |
| | | case constvar.ProblemCodeNsq: |
| | | case constvar.ProblemCodeCloud: |
| | | checkObj = &Nsq{} |
| | | case constvar.ProblemCodeDevice: |
| | | checkObj = &Device{} |