From 7b2a0785ae42e71c55960177c99ddfed912bfd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Thu, 4 Jan 2024 13:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Report/DryMixer/SelectAction.cs | 27 ++++++- .../Report/DryMixer/SelectRowAction.cs | 75 ++++++++++++++++++- .../Report/GelDoser/SelectAction.cs | 26 ++++++- .../Report/WetMixer/SelectAction.cs | 29 ++++++- .../MCProject/nodeForm/Report_DryMixer.xml | 8 +- .../MCProject/nodeForm/湿混机报表.xml | 6 +- 6 files changed, 161 insertions(+), 10 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectAction.cs index 619c584..cd6d079 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectAction.cs @@ -80,7 +80,32 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer runtime.IsReturn = false; return; } - _dgvDryMixer.BaseControl.BindDataSource = table; + + var newTalbe = GetDefalut(); + foreach (DataRow row in table.Rows) + { + var dr = newTalbe.NewRow(); + dr["dryNo"] = row["dryNo"]; + dr["Batch"] = row["Batch"]; + dr["reportId"] = row["reportId"]; + dr["recordTime"] = row["recordTime"].ToString(); + newTalbe.Rows.Add(dr); + } + + _dgvDryMixer.BaseControl.BindDataSource = newTalbe; + } + + + public DataTable GetDefalut() + { + DataTable dt = new DataTable(); + dt.Columns.Add("dryNo", typeof(string)); + dt.Columns.Add("Batch", typeof(string)); + dt.Columns.Add("recordTime", typeof(string)); + + dt.Columns.Add("reportId", typeof(string)); + return dt; + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs index 7922c62..e3a99db 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs @@ -102,20 +102,91 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer dbHelper.AddParameter("@reportId", lR_planID); DataTable table = dbHelper.ToDataTable(); + + foreach (DataRow row in table.Rows) + { + row["实际重量"]= Convert.ToSingle(row["实际重量"]).ToString("#0.00"); + row["实际公差"] = Convert.ToSingle(row["实际公差"]).ToString("#0.00"); + } + + + clientGrid.DataSource = table; dbHelper.ClearParameter(); - string sql = $"select 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 步号," + + $"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"; dbHelper.CommandText = sql.ToString(); dbHelper.CommandType = System.Data.CommandType.Text; DataTable tableB = dbHelper.ToDataTable(); + DataTable newTable = GetDefault(); + + foreach (DataRow row in tableB.Rows) + { + var dr= newTable.NewRow(); + dr["批次"] = row["批次"]; + dr["步号"] = row["步号"]; + dr["动作"] = DryStepConvert(Convert.ToInt32(row["actCode"])); + dr["时间"] = ConverToTime(Convert.ToInt32(row["时间"])); + dr["速度"] = row["速度"]; + dr["记录时间"] = row["记录时间"]; + dr["速度"] = Convert.ToSingle(row["速度"]).ToString("#0.00"); + newTable.Rows.Add(dr); + } + + clientGrid2.DataSource = newTable; + + } + } + + string ConverToTime(int duration) + { + TimeSpan ts = new TimeSpan(0, 0, Convert.ToInt32(duration)); + string str = ""; + if (ts.Hours > 0) + { + str = ts.Hours.ToString() + "小时 " + ts.Minutes.ToString() + "分钟 " + ts.Seconds + "秒"; + } + if (ts.Hours == 0 && ts.Minutes > 0) + { + str = ts.Minutes.ToString() + "分钟 " + ts.Seconds + "秒"; + } + if (ts.Hours == 0 && ts.Minutes == 0) + { + str = ts.Seconds + "秒"; + } + return str; + } + - clientGrid2.DataSource = tableB; + private DataTable GetDefault() + { + var tableNewB = new DataTable(); + tableNewB.Columns.Add("批次", typeof(string)); + tableNewB.Columns.Add("步号", typeof(string)); + tableNewB.Columns.Add("动作", typeof(string)); + tableNewB.Columns.Add("时间", typeof(string)); + //tableNewB.Columns.Add("温度", typeof(string)); + tableNewB.Columns.Add("速度", typeof(string)); + tableNewB.Columns.Add("记录时间", typeof(string)); + + return tableNewB; + } + private string DryStepConvert(int code) + { + switch (code) + { + case 1: return "加粉料"; + case 4: return "搅拌"; + case 6: return "等待排料"; + default: return "无"; } } + } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/GelDoser/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/GelDoser/SelectAction.cs index ee7a54c..41db3b1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/GelDoser/SelectAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/GelDoser/SelectAction.cs @@ -82,7 +82,19 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser runtime.IsReturn = false; return; } - _dgvGelDoser.BaseControl.BindDataSource = table; + + var newTalbe = GetDefalut(); + foreach (DataRow row in table.Rows) + { + var dr = newTalbe.NewRow(); + dr["gelNo"] = row["gelNo"]; + dr["Batch"] = row["Batch"]; + dr["reportId"] = row["reportId"]; + dr["recordTime"] = row["recordTime"].ToString(); + newTalbe.Rows.Add(dr); + } + + _dgvGelDoser.BaseControl.BindDataSource = newTalbe; Mesnac.Controls.Default.MultiColHeaderDgv clientGrid2 = (GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv2")).FirstOrDefault() as Mesnac.Controls.Default.MultiColHeaderDgv); @@ -91,5 +103,17 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser var clientGrid1= GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv1")).FirstOrDefault() as Mesnac.Controls.Default.MultiColHeaderDgv; clientGrid1.DataSource = null; } + + + public DataTable GetDefalut() + { + DataTable dt = new DataTable(); + dt.Columns.Add("gelNo", typeof(string)); + dt.Columns.Add("Batch", typeof(string)); + dt.Columns.Add("recordTime", typeof(string)); + dt.Columns.Add("reportId", typeof(string)); + return dt; + + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs index 6cc05aa..7fc7c16 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs @@ -80,7 +80,34 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer runtime.IsReturn = false; return; } - _dgvWetMixer.BaseControl.BindDataSource = table; + + var newTalbe = GetDefalut(); + foreach (DataRow row in table.Rows) + { + var dr = newTalbe.NewRow(); + dr["WetNo"] = row["WetNo"]; + dr["Batch"] = row["Batch"]; + dr["reportId"] = row["reportId"]; + dr["recordTime"] = row["recordTime"].ToString(); + newTalbe.Rows.Add(dr); + } + + _dgvWetMixer.BaseControl.BindDataSource = newTalbe; + + + + } + + public DataTable GetDefalut() + { + DataTable dt = new DataTable(); + dt.Columns.Add("WetNo", typeof(string)); + dt.Columns.Add("Batch", typeof(string)); + dt.Columns.Add("recordTime", typeof(string)); + + dt.Columns.Add("reportId", typeof(string)); + return dt; + } } } diff --git a/Main/MCEdit/Data/MCProject/nodeForm/Report_DryMixer.xml b/Main/MCEdit/Data/MCProject/nodeForm/Report_DryMixer.xml index acbda79..3dd9605 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/Report_DryMixer.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/Report_DryMixer.xml @@ -26,7 +26,7 @@ False - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAAAwAAAPoAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAANDQUEAAAAKE1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnMCAAAACl9maWxlZERhdGEMX2Rpc3BsYXlOYW1lAQECAAAABgc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BU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL @@ -83,7 +83,9 @@ False - + + AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuRGVmYXVsdC5Db21ib2JveEl0ZW1zLCBNZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAJ01lc25hYy5Db250cm9scy5EZWZhdWx0LkNvbWJvYm94SXRlbXNbXQIAAAAICAkDAAAAAAAAAAAAAAAHAwAAAAABAAAAAAAAAAQlTWVzbmFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL + None True True @@ -123,7 +125,7 @@ None - True + False True True diff --git a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml index a64b210..fc7ed05 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml @@ -20,7 +20,7 @@ False - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAAAwAAAPoAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAANDQUEAAAAKE1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnMCAAAACl9maWxlZERhdGEMX2Rpc3BsYXlOYW1lAQECAAAABgcAAAAKcmVjb3JkVGltZQYIAAAADOaKpeihqOaXtumXtAEFAAAABAAAAAYJAAAABVdldE5vBgoAAAAG5py65Y+wAQYAAAAEAAAABgsAAAAFQmF0Y2gGDAAAAAbovabmrKEL + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVy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