From 47d2522c2b7092cb81ba20af190168d39043dfef Mon Sep 17 00:00:00 2001 From: rszn <645583145@qq.com> Date: Sun, 30 Jun 2024 23:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E4=BB=93=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Mgr/PlcTaskMgr.cs | 4 ++-- Service/Station/MonitorService.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Service/Mgr/PlcTaskMgr.cs b/Service/Mgr/PlcTaskMgr.cs index ab035f4..5284992 100644 --- a/Service/Mgr/PlcTaskMgr.cs +++ b/Service/Mgr/PlcTaskMgr.cs @@ -17,7 +17,7 @@ public class PlcTaskMgr public bool QueryPlcTask(int taskNo, int ingStatus, int exceptionStatus) { - Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo}"); + Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo} execute start -------------------"); bool isSuccess = false; InvokeStatus invokeStatus = Invoker.Invoke("QueryPlcTask", 1000, 5, @@ -57,7 +57,7 @@ public class PlcTaskMgr { return false; } - + Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo} execute end success-------------------"); return true; } diff --git a/Service/Station/MonitorService.cs b/Service/Station/MonitorService.cs index 3799e72..a97d8b8 100644 --- a/Service/Station/MonitorService.cs +++ b/Service/Station/MonitorService.cs @@ -6,6 +6,7 @@ using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Entity; using log4net; +using Newtonsoft.Json; using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; using Repository.Station; using Service.Cloud.Client; @@ -218,7 +219,11 @@ public class MonitorService result = PlcMgr.HoldOn(); if (!result) - { PlcMgr.PlcClient?.ExChangeTaskNo(0); + { + moveBinRecord.Status = 3; + MoveBinRecordRepository.Update(moveBinRecord); + PlcMgr.PlcClient?.ExChangeTaskNo(0); + Log.Error("BatteryRelocation PlcMgr.HoldOn() =false"); return Result.Fail(); } @@ -230,6 +235,7 @@ public class MonitorService if (!queryPlcTask) { PlcMgr.PlcClient?.ExChangeTaskNo(0); + Log.Info($"move battery fail update moveBin={JsonConvert.SerializeObject(moveBinRecord)}"); moveBinRecord.Status = 3; MoveBinRecordRepository.Update(moveBinRecord); return Result.Fail(); @@ -261,6 +267,7 @@ public class MonitorService removeBin.BatteryEnterSeq = 0; BinInfoRepository.Update(removeBin); moveBinRecord.Status = 2; + Log.Info($"move battery success update moveBin={JsonConvert.SerializeObject(moveBinRecord)}"); MoveBinRecordRepository.Update(moveBinRecord); PlcMgr.PlcClient?.ExChangeTaskNo(0); return Result.Success();