From fcacdbf9aa2598cbb08a880069abf892d69d061f Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 27 十一月 2023 17:24:06 +0800 Subject: [PATCH] fix --- api/v1/task.go | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/api/v1/task.go b/api/v1/task.go index 7ee8678..afe8397 100644 --- a/api/v1/task.go +++ b/api/v1/task.go @@ -268,6 +268,10 @@ ctx.Fail(code) return } + if procedure.DeviceID != conf.Conf.CurrentDeviceID { + ctx.FailWithMsg(ecode.ParamsErr, "璇ヤ换鍔′笉灞炰簬褰撳墠璁惧") + return + } order, err := taskService.GetOrderByWorkOrderId(procedure.WorkOrderID) if err != nil { ctx.Fail(ecode.UnknownErr) @@ -281,7 +285,7 @@ var processModelNumber string plcConfig, code := service.NewDevicePlcService().GetDevicePlc() - if code == ecode.OK && plcConfig.ID != 0 { + if code == ecode.OK && plcConfig.ID != 0 && len(plcConfig.Details) > 0 { plcConfig.MaxTryTimes = 2 device, err := service.GetCurrentDevice() if err != nil { -- Gitblit v1.8.0