diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs index 23aa468..2a0928d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs @@ -304,21 +304,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver if (a.End==true && a.Start==true) { - //if (no == 1) - //{ - // Db2101HelperWriter.WriterLinAStart(false); - // Db2101HelperWriter.WriterLinAEnd(false); - //} - //if (no == 2) - //{ - // Db2101HelperWriter.WriterLinBStart(false); - // Db2101HelperWriter.WriterLinBEnd(false); - //} - //if (no == 3) - //{ - // Db2101HelperWriter.WriterLinCStart(false); - // Db2101HelperWriter.WriterLinCEnd(false); - //} + SuSong su =FreeDb.FreeSqlUnit.Instance. Queryable(). @@ -342,7 +328,28 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver } - + //处理异常数据 + var datetime = DateTime.Now.AddMinutes(-5); + + var ist= FreeSqlUnit.Instance. + Queryable(). + Where(s => s.No == no) + .Where(x => x.Start == 1) + .Where(s => s.EndInfo == 0) + .Where(x => x.UpdateTime < datetime) + .ToList(); + + foreach (var item in ist) + { + FreeDb.FreeSqlUnit.Instance.Update() + .Set(x => x.UpdateTime, DateTime.Now) + .Set(x => x.EndInfo == 1) + .Set(x => x.Start, 0) + .Set(x => x.Remark == "结束") + .Where(x => x.Id == item.Id).ExecuteUpdated(); + } + + }