移仓日志

master
rszn 5 months ago
parent dae4641c59
commit 47d2522c2b

@ -17,7 +17,7 @@ public class PlcTaskMgr
public bool QueryPlcTask(int taskNo, int ingStatus, int exceptionStatus) 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; bool isSuccess = false;
InvokeStatus invokeStatus = Invoker.Invoke("QueryPlcTask", 1000, 5, InvokeStatus invokeStatus = Invoker.Invoke("QueryPlcTask", 1000, 5,
@ -57,7 +57,7 @@ public class PlcTaskMgr
{ {
return false; return false;
} }
Log.Info($"PlcTaskMgr.QueryPlcTask taskNo={taskNo} execute end success-------------------");
return true; return true;
} }

@ -6,6 +6,7 @@ using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity; using HybirdFrameworkCore.Entity;
using log4net; using log4net;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using Repository.Station; using Repository.Station;
using Service.Cloud.Client; using Service.Cloud.Client;
@ -218,7 +219,11 @@ public class MonitorService
result = PlcMgr.HoldOn(); result = PlcMgr.HoldOn();
if (!result) if (!result)
{ PlcMgr.PlcClient?.ExChangeTaskNo(0); {
moveBinRecord.Status = 3;
MoveBinRecordRepository.Update(moveBinRecord);
PlcMgr.PlcClient?.ExChangeTaskNo(0);
Log.Error("BatteryRelocation PlcMgr.HoldOn() =false"); Log.Error("BatteryRelocation PlcMgr.HoldOn() =false");
return Result<bool>.Fail(); return Result<bool>.Fail();
} }
@ -230,6 +235,7 @@ public class MonitorService
if (!queryPlcTask) if (!queryPlcTask)
{ {
PlcMgr.PlcClient?.ExChangeTaskNo(0); PlcMgr.PlcClient?.ExChangeTaskNo(0);
Log.Info($"move battery fail update moveBin={JsonConvert.SerializeObject(moveBinRecord)}");
moveBinRecord.Status = 3; moveBinRecord.Status = 3;
MoveBinRecordRepository.Update(moveBinRecord); MoveBinRecordRepository.Update(moveBinRecord);
return Result<bool>.Fail(); return Result<bool>.Fail();
@ -261,6 +267,7 @@ public class MonitorService
removeBin.BatteryEnterSeq = 0; removeBin.BatteryEnterSeq = 0;
BinInfoRepository.Update(removeBin); BinInfoRepository.Update(removeBin);
moveBinRecord.Status = 2; moveBinRecord.Status = 2;
Log.Info($"move battery success update moveBin={JsonConvert.SerializeObject(moveBinRecord)}");
MoveBinRecordRepository.Update(moveBinRecord); MoveBinRecordRepository.Update(moveBinRecord);
PlcMgr.PlcClient?.ExChangeTaskNo(0); PlcMgr.PlcClient?.ExChangeTaskNo(0);
return Result<bool>.Success(); return Result<bool>.Success();

Loading…
Cancel
Save