From 47a9a79a392461a501ea63dbf8586fe119fd5dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Tue, 9 Jan 2024 18:26:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B2=E6=B7=B7=E6=9C=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControl/MainDetailControlAction.cs | 5 +++-- .../Report/DryMixer/SelectRowAction.cs | 8 ++++---- .../Report/ReportReadDb.cs | 11 ++++------- .../Entity/DB2106Entity/DryReportEntity.cs | 4 +++- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 531ac8c..5790bd0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -285,12 +285,13 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl Timer1_Tick(); try { - + if (UserJudge.IsNormalUser()) { - ReportReadDb.ReadFeededDry(); ReportReadDb.ReadReport(); + ReportReadDb.ReadFeededDry(); + } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs index aa0ee13..37a9969 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs @@ -1,5 +1,5 @@ using Mesnac.Action.Base; - +using Mesnac.Action.ChemicalWeighing.MainDetailControl.Entity; using Mesnac.Codd.Session; using Mesnac.Controls.Default; @@ -115,9 +115,9 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer dbHelper.ClearParameter(); - string sql = $"select t1.actCode, t1.mixBatch as 批次,t1.mixStep as 步号," + - $"t2.ActionName as 动作,t1.mixTime as 时间,t1.mixTemp as 温度," + - $"t1.mixSpeed as 速度 from Report_DryMixer_Detail t1\r\nleft join ActionCode t2 on t2.Code=t1.actCode\r\nwhere t2.DeviceUnitId=1 and t1.reportId='{lR_planID}' order by actCode"; + string sql = $"select t1.actCode, t1.mixBatch as 批次,t1.mixStep as 步号,t1.actCode as 动作,\r\n " + + $" t1.mixTime as 时间,t1.mixTemp as 温度,t1.mixSpeed as 速度, t1.recordTime as 记录时间 from" + + $" Report_DryMixer_Detail t1\r\n\r\nwhere t1.reportId='{lR_planID}' order by actCode"; dbHelper.CommandText = sql.ToString(); dbHelper.CommandType = System.Data.CommandType.Text; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs index 2084e3b..14dd555 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs @@ -156,7 +156,6 @@ namespace Mesnac.Action.ChemicalWeighing.Report - DB2107Helper dB2107Helper = new DB2107Helper(); NormalStatusEntity normal = dB2107Helper.NormalStatus; if (normal.RdyRpt_D1) @@ -350,10 +349,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report recordTime = DateTime.Now }); } - else - { - break; - } + } foreach (var item in dryer.Mix) @@ -363,6 +359,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report lsMix.Add(new Report_DryMixer_Detail() { reportId = dry.reportId, + actCode = item.ActCode, eqNo = item.EqNo, mixBatch = item.MixBatch, mixStep = item.MixStep, @@ -370,13 +367,13 @@ namespace Mesnac.Action.ChemicalWeighing.Report mixTemp = item.MixTemp, mixTime = item.MixTime, recordTime = DateTime.Now - }); + }) ; } } if (lsDos.Any()) { - dry.Batch=lsDos.Select(x=>x.batch).First(); + dry.Batch=lsDos.Where(x=>x.batch>0).Select(x=>x.batch).First(); FreeSqlUnit.Instance.Insert(dry).ExecuteAffrows(); FreeSqlUnit.Instance.Insert(lsDos).ExecuteAffrows(); FreeSqlUnit.Instance.Insert(lsMix).ExecuteAffrows(); diff --git a/DataBlockHelper/Entity/DB2106Entity/DryReportEntity.cs b/DataBlockHelper/Entity/DB2106Entity/DryReportEntity.cs index 6f61a39..6f69127 100644 --- a/DataBlockHelper/Entity/DB2106Entity/DryReportEntity.cs +++ b/DataBlockHelper/Entity/DB2106Entity/DryReportEntity.cs @@ -30,9 +30,11 @@ namespace DataBlockHelper.Entity.DB2106Entity private byte[] Bytes; int start; + int mixStart; public Dryer_(int start, byte[] bytes) { this.start = start; + mixStart = start + 286; this.Bytes = bytes; } @@ -58,7 +60,7 @@ namespace DataBlockHelper.Entity.DB2106Entity { List ListE = new List(); - var content = Bytes.Skip(start).Take(180).ToArray(); + var content = Bytes.Skip(mixStart).Take(180).ToArray(); for (int i = 0; i < 10; i++) {