From ad3149a954aee93896a010d514de8e38c013b744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Wed, 19 Jun 2024 12:21:54 +0800 Subject: [PATCH] Sss --- .../LjDeliver/DeliverInitAction.cs | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs index 9241163..73f565c 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliver/DeliverInitAction.cs @@ -263,25 +263,49 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver data.Remark = "开始"; FreeDb.FreeSqlUnit.Instance.Insert(data).ExecuteAffrows(); - //if (no == 1) - //{ - // Db2101HelperWriter.WriterLinAStart(false); - //} - //if (no == 2) - //{ - // Db2101HelperWriter.WriterLinBStart(false); - //} - //if (no == 3) - //{ - // Db2101HelperWriter.WriterLinCStart(false); - //} + } + + if (a.Start == true && a.End == false) + { + SuSong su = FreeDb.FreeSqlUnit.Instance. + Queryable().Where(s => s.No == no) + .Where(x => x.Start == 1) + .Where(s => s.EndInfo == 0).OrderByDescending(s => s.CreateTime).First(); + + if (su != null) + { + FreeDb.FreeSqlUnit.Instance.Update() + .Set(x => x.UpdateTime, DateTime.Now) + .Set(x => x.Destination, a.Get()) + .Set(x => x.Number == entity.number) + .Set(x => x.Remark == "运行中") + .Where(x => x.Id == su.Id).ExecuteUpdated(); + } + } //结束 - if (a.End==true && a.Start==false) + if (a.End==true && a.Start==true) { - SuSong su=FreeDb.FreeSqlUnit.Instance. + + 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().Where(s => s.No == no) .Where(x=>x.Start==1) .Where(s => s.EndInfo==0).OrderByDescending(s => s.CreateTime).First(); @@ -301,23 +325,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver } - if(a.Start==true && a.End == false) - { - SuSong su = FreeDb.FreeSqlUnit.Instance. - Queryable().Where(s => s.No == no) - .Where(x => x.Start == 1) - .Where(s => s.EndInfo == 0).OrderByDescending(s => s.CreateTime).First(); - - if (su != null) - { - FreeDb.FreeSqlUnit.Instance.Update() - .Set(x=>x.UpdateTime,DateTime.Now) - .Set(x=>x.Destination, a.Get()) - .Set(x=>x.Number==entity.number) - .Set(x => x.Remark == "运行中") - .Where(x=>x.Id==su.Id).ExecuteUpdated(); - } - } + }