From 21e0e02fd465fef04f1834b078c621a0e3594308 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期六, 02 九月 2023 16:51:48 +0800
Subject: [PATCH] 任务开始和结束都发送消息通知apsserver
---
api/v1/plc.go | 24 ------------------------
1 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/api/v1/plc.go b/api/v1/plc.go
index 69e6fda..cba0bbd 100644
--- a/api/v1/plc.go
+++ b/api/v1/plc.go
@@ -5,7 +5,6 @@
"apsClient/model/response"
_ "apsClient/model/response"
"apsClient/pkg/contextx"
- "apsClient/pkg/ecode"
"apsClient/service"
"github.com/gin-gonic/gin"
"github.com/spf13/cast"
@@ -41,29 +40,6 @@
func (slf *PlcApi) SetProductNumber(c *gin.Context) {
ctx, ok := contextx.NewContext(c, nil)
if !ok {
- return
- }
-
- taskData, code := service.NewTaskService().GetTask()
- if code != ecode.OK {
- ctx.Fail(code)
- return
- }
-
- if taskData.Order == nil {
- ctx.FailWithMsg(ecode.UnknownErr, "褰撳墠娌℃湁寰呯敓浜у伐鍗�")
- return
- }
-
- plcConfig, code := service.NewDevicePlcService().GetDevicePlc()
- if code != ecode.OK {
- ctx.FailWithMsg(ecode.UnknownErr, "璇峰厛閰嶇疆PLC")
- return
- }
-
- err := service.PlcWrite(plcConfig, constvar.PlcStartAddressTypeFinishNumber, taskData.Order.Amount.IntPart())
- if err != nil {
- ctx.FailWithMsg(ecode.UnknownErr, "璁剧疆澶辫触锛岃妫�鏌lc閰嶇疆")
return
}
ctx.Ok()
--
Gitblit v1.8.0