api/v1/plc.go
@@ -6,6 +6,7 @@ _ "apsClient/model/response" "apsClient/pkg/contextx" "apsClient/pkg/ecode" "apsClient/pkg/safe" "apsClient/service" "github.com/gin-gonic/gin" "github.com/spf13/cast" @@ -61,10 +62,9 @@ return } err := service.PlcWrite(plcConfig, constvar.PlcStartAddressTypeTotalNumber, taskData.Order.Amount.IntPart()) if err != nil { ctx.FailWithMsg(ecode.UnknownErr, "设置失败,请检查plc配置") return } safe.Go(func() { _ = service.PlcWrite(plcConfig, constvar.PlcStartAddressTypeTotalNumber, taskData.Order.Amount.IntPart()) }) ctx.Ok() }