From 9c89674060df4d1a1b1ca20838375714db33c286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Fri, 21 Jun 2024 22:41:17 +0800 Subject: [PATCH] dep --- .../LjPlanning/LjPlanningPlcHelp.cs | 63 +++-- .../Mesnac.Action.ChemicalWeighing.csproj | 2 +- .../Report/DryMixer/SelectRowAction.cs | Bin 11298 -> 80 bytes .../Report/Sb.cs | 240 ++++++++++++++++++ .../榄菊报表.干混机报表.xml | 2 +- 5 files changed, 287 insertions(+), 20 deletions(-) create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/Sb.cs diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs index ac913aa..a9e52ba 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/LjPlanningPlcHelp.cs @@ -158,7 +158,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -166,7 +166,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -183,7 +183,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -195,7 +195,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -210,7 +210,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -221,7 +221,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -236,7 +236,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -245,7 +245,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -263,7 +263,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -274,7 +274,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -289,7 +289,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -301,7 +301,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -316,7 +316,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -327,7 +327,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -343,7 +343,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -351,7 +351,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -639,7 +639,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipePlcViews.Count(); i++) { var view = recipePlcViews[i]; - Dowd(begin, view); + Dowd2(begin, view); begin += 10; } @@ -647,7 +647,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning for (int i = 0; i < recipeSteps.Count(); i++) { var view = recipeSteps[i]; - DowSteps(begin, view); + DowSteps2(begin, view); begin += 12; } @@ -671,6 +671,33 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning } + private static void Dowd2(int start, RecipePlcView view) + { + int bin = start; + PlcConnect.Instance.Write($"DB2104.{bin}.0", view.Bin); + int set = start + 2; + PlcConnect.Instance.Write($"DB2104.{set}.0", view.Set); + int tolerance = start + 6; + PlcConnect.Instance.Write($"DB2104.{tolerance}.0", view.Tolerance); + + } + + private static void DowSteps2(int start, Step step) + { + int mixCode = start; + var info = PlcConnect.Instance.Write($"DB2104.{mixCode}.0", step.MixCode); + int mixTime = start + 2; + PlcConnect.Instance.Write($"DB2104.{mixTime}.0", step.MixTime); + + int mixTemp = start + 4; + PlcConnect.Instance.Write($"DB2104.{mixTemp}.0", step.MixTemp); + int mixSpeed = start + 8; + + PlcConnect.Instance.Write($"DB2104.{mixSpeed}.0", step.MixSpeed); + } + + + private static void Dowd(int start, RecipePlcView view) { int bin = start; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 36cc135..7ca50c1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -635,7 +635,6 @@ - @@ -644,6 +643,7 @@ + diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/DryMixer/SelectRowAction.cs index 4448fb84b7eb92c4f4fe03c48878775aa436ee34..0da77481209dc48bb847dbfb9c0166bb2696dc7b 100644 GIT binary patch literal 80 zcmeZGEzV0!)^kiQ$;{8wbIwT3%}h?r2~W*T&&bS6*9%H5$S*3<3r>Qn;Ns$Xxpv>x ajVm_3)!lJ&_nY0nz)TQv`1|=CTwDM)r6wx? literal 11298 zcmV+-EZx%=+Fzg+GtHWeYg~^cnl1x&X1Zp63#`Gw$FZTGGF@RQD>@>{hm=Te+*PHD zgXMS4hsj|#-7eDokYu$S(7Dl7U*K}@pdsezQz<=+xCWcdZo)Fh&18ug00XnDD|Ex5 zIoJCiB5w>Da%?u!E3q!>3^&Wy5y*qUwhz)9?ilUwi&i~?yaoXHngY413fG=KAkB5r z1(XinFx-{eyD)^;II{z;8zBBJq4dz`fl>@Wq~{=`IZhfS=4$V#j!D%dq8GM$Vl8ER zl$`dlbEap&MGyBY4DYiw1X|cfIl-g=uJ%U1S+WvmvOo_!9<%v(JdH>h!~7k$x}CE! z%PCxGmnzlP-a&(k;R2wf57>W0;{&74(aVJVa)4D9+X4TpL&CI_)rP)zv! zhy~cM2s=k-^=xsxd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)VA+!F&SV7uSs^y7a_LguFPXwFfN|{)S{y#L76~e&B}p#t~Z_EJNi( zmM&}L3Yn5D`vtp|>4xJggU>YwL<=lI>X|!}c6;>M6f2h0>DxN=Xw|jWGyP+KYL}}z zJ~7bf!c8xVqp_HIaduH%nyCAANA!fj^v>TN00(1FC`jZtyuik;sxJ3Q8iwgb@i})+ zfqWfw`{F+OSRmtT>90lKkCzj~|NblDnDW9%iMIJr<92pPhSfuf@!D1nWYLj4Q)mUi zau6KW(#4QJfWSduHmk;w14nMr+S6~Qe8aPkdftc3w!@55pYff)dwJlLIP8%Ei x.Name == "MCCombobox1") as MCCombobox; + ICSharpCode.Core.LoggingService.Debug("干混机报表-明细查询..."); + + //获取报表数据 + DbMCControl _dgvDryMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_DryMixer").FirstOrDefault(); + if (_dgvDryMixer == null || !(_dgvDryMixer.BaseControl is DataGridView)) + { + ICSharpCode.Core.LoggingService.Warn("{生产报表} 缺少干混机报表DataGridView控件..."); + runtime.IsReturn = false; + return; + } + + DataGridView _DryMixerGridView = _dgvDryMixer.BaseControl as DataGridView; + + this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv1")).FirstOrDefault(); + + + + Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv); + + + Mesnac.Controls.Default.MultiColHeaderDgv clientGrid2 = (GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv2")).FirstOrDefault() as Mesnac.Controls.Default.MultiColHeaderDgv); + + #region 明细控件格式化 + + clientGrid.myColHeaderTreeView = null; + clientGrid.DataSource = null; + clientGrid.iNodeLevels = 0; + clientGrid.ColLists.Clear(); + clientGrid.ColumnHeadersHeight = 23; + clientGrid.ScrollBars = ScrollBars.Both; + clientGrid.AllowUserToAddRows = false; + clientGrid.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + clientGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + clientGrid.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 12); + clientGrid.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 10); + clientGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + + + clientGrid2.myColHeaderTreeView = null; + clientGrid2.DataSource = null; + clientGrid2.iNodeLevels = 0; + clientGrid2.ColLists.Clear(); + clientGrid2.ColumnHeadersHeight = 23; + clientGrid2.ScrollBars = ScrollBars.Both; + clientGrid2.AllowUserToAddRows = false; + clientGrid2.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + clientGrid2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + clientGrid2.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 12); + clientGrid2.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 10); + clientGrid2.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + #endregion + + //获取选中行的ReportId,关联获取明细数据并赋值给明细控件 + if (_DryMixerGridView.SelectedRows.Count == 1) + { + string lR_planID = _DryMixerGridView.SelectedRows[0].Cells["reportId"].Value as string; + + //获取数据链接 + var dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + + dbHelper.ClearParameter(); + + //获取明细数据 + StringBuilder sqlStr = new StringBuilder(@"select t1.batch as 批次号,t2.MName as 物料, + t1.actValue as 实际重量,t1.actToler as 实际公差 + from Report_DryDos_Detail t1 + left join lj_stock_material t2 on t1.matCode = t2.Code + where t2.MTypeId=1 and t1.reportId = @reportId"); + dbHelper.CommandText = sqlStr.ToString(); + dbHelper.CommandType = System.Data.CommandType.Text; + dbHelper.AddParameter("@reportId", lR_planID); + DataTable table = dbHelper.ToDataTable(); + + string bathNo = "0"; + + foreach (DataRow row in table.Rows) + { + string a = row["批次号"].ToString().Trim(); + if (a != "0") + { + bathNo = a; break; + } + } + + + float zt = 0; + + foreach (DataRow row in table.Rows) + { + string a = row["批次号"].ToString().Trim(); + if (a == "0") + { + row["批次号"] = bathNo; + } + + var aaa= Convert.ToSingle(row["实际重量"]); + + zt+= aaa; + + row["实际重量"] = Convert.ToSingle(row["实际重量"]).ToString("#0.00"); + row["实际公差"] = Convert.ToSingle(row["实际公差"]).ToString("#0.00"); + } + + + var dts=table.NewRow(); + dts[1] = "总计"; + dts["实际重量"] = zt.ToString("#0.00"); + + table.Rows.Add(dts); + + clientGrid.DataSource = null; + + clientGrid.DataSource = table; + + dbHelper.ClearParameter(); + + 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; + + DataTable tableB = dbHelper.ToDataTable(); + DataTable newTable = GetDefault(); + + var dateNow = DateTime.Now; + Dictionary dic = new Dictionary(); + Dictionary Newdic = new Dictionary(); + + + 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"); + + dateNow = Convert.ToDateTime(row["记录时间"].ToString()); + dic.Add(Convert.ToInt32(dr["步号"]), Convert.ToInt32(row["时间"])); + newTable.Rows.Add(dr); + } + + for (int i = 1; i < 11; i++) + { + var miao = dic.Where(x => x.Key >= i).Select(x => x.Value).Sum(); + Newdic.Add(i, dateNow.AddSeconds(-miao)); + } + + foreach (System.Data.DataRow row in newTable.Rows) + { + var bu = Convert.ToInt32(row["步号"]); + if (Newdic.ContainsKey(bu)) + { + var dt = Newdic[bu]; + row["记录时间"] = dt.ToString("yyyy-MM-dd HH:mm:ss"); + } + + } + + 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; + } + + + 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/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.干混机报表.xml b/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.干混机报表.xml index 77cc748..f22b3d8 100644 --- a/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.干混机报表.xml +++ b/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.干混机报表.xml @@ -44,7 +44,7 @@ - +