From 30c549c7e4d63ab3ea5bd0a7cfd69fa89339df33 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 18 九月 2023 19:46:27 +0800 Subject: [PATCH] 增加重试,地址-1 --- api/v1/plc.go | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/v1/plc.go b/api/v1/plc.go index 69edb19..6a6392f 100644 --- a/api/v1/plc.go +++ b/api/v1/plc.go @@ -36,7 +36,7 @@ resp.TotalNumber = cast.ToInt(totalNumber) plcStatus := 1 //鏂紑杩炴帴 - isConnect := apacheplc4x.IsConnect() + isConnect := service.PlcIsConnect() if isConnect { if resp.FinishNumber > 0 { //鐢熶骇 plcStatus = 2 @@ -67,10 +67,13 @@ // @Tags 鐢熶骇鏁伴噺 // @Summary 瀹炴椂鑾峰彇鐢熶骇杩涘害 // @Produce application/json -// @Param object body request.SendProcessParams true "鏌ヨ鍙傛暟" // @Success 200 {object} contextx.Response{data=response.ProductProgress} "鎴愬姛" // @Router /v1/plc/productProgressRealTime [post] func (slf *PlcApi) GetProductProgressRealTime(c *gin.Context) { + ctx, ok := contextx.NewContext(c, nil) + if !ok { + return + } var finishNumber, totalNumber int64 plcConfig, code := service.NewDevicePlcService().GetDevicePlc() if code != ecode.OK { -- Gitblit v1.8.0