From 732e1e344addd02a4fa56531c7ffd0319e2d5b6c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 28 十一月 2023 17:44:31 +0800 Subject: [PATCH] 进度更改兼容新旧模板 --- api/v1/task.go | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/api/v1/task.go b/api/v1/task.go index d65ab6c..f866127 100644 --- a/api/v1/task.go +++ b/api/v1/task.go @@ -108,6 +108,9 @@ nowTs := time.Now().Unix() flagMap := make(map[int32]struct{}, 0) for _, task := range taskResponse.Tasks { + if task.Procedure.Status != model.ProcedureStatusWaitProcess { + continue + } if _, ok := flagMap[task.Channel]; !ok && !service.TaskFlagGet(conf.Conf.CurrentDeviceID, task.Channel) && task.Procedure.StartTime <= nowTs { task.CanStarted = true flagMap[task.Channel] = struct{}{} @@ -285,7 +288,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