diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs index 1f12ac5..3eebc56 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs @@ -291,6 +291,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report } + private static void InsertD(int no) { DB2106Helper dB2106 = new DB2106Helper(); @@ -545,8 +546,9 @@ namespace Mesnac.Action.ChemicalWeighing.Report report.planCode = 0; report.planName = ""; report.recordTime = DateTime.Now; + report.reportTime = DateTime.Now; report.WetNo = no; - report.Batch = 0; + report.Batch = report.Batch; List lde = new List(); foreach (var item in ls) @@ -576,6 +578,8 @@ namespace Mesnac.Action.ChemicalWeighing.Report if(lde.Count > 0) { + report.Batch=lde.Select(x=>x.mixBatch).First(); + FreeSqlUnit.Instance.Insert(report).ExecuteAffrows(); FreeSqlUnit.Instance.Insert(lde).ExecuteAffrows(); } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs index 0a819de..01d1ce1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs @@ -3,6 +3,7 @@ using Mesnac.Controls.Base; using Mesnac.Controls.Default; using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -34,6 +35,31 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer List mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件 IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl; startdate.MCValue = DateTime.Now.AddDays(-3); + + + var MCCombobox1=GetAllControls().FirstOrDefault(x=>x.Name== "MCCombobox1") as MCCombobox; + + DataTable dataTable = new DataTable(); + + dataTable.Columns.Add("CmbValue", typeof(string)); + dataTable.Columns.Add("CmbDisplay", typeof(string)); + + + + for (int i = 1; i <9; i++) + { + var dr = dataTable.NewRow(); + dr[0] = i; + dr[1] = i; + dataTable.Rows.Add(dr); + } + + + MCCombobox1.DataSource = dataTable; + + //MCCombobox1 + + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs index 5a73fc8..6cc05aa 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs @@ -1,6 +1,8 @@ using Mesnac.Action.Base; using Mesnac.Codd.Session; using Mesnac.Controls.Base; +using Mesnac.Controls.Default; + using System; using System.Collections.Generic; using System.Data; @@ -59,6 +61,11 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer ICSharpCode.Core.LoggingService.Debug("{湿混机报表-查询} 缺少key值为enddate或者enddate的时间查询条件..."); return; } + + var MCCombobox1 = GetAllControls().FirstOrDefault(x => x.Name == "MCCombobox1") as MCCombobox; + + sbSql.Append(" and WetNo=" + MCCombobox1.MCValue); + sbSql.Append(" ORDER BY recordTime desc"); dbHelper.CommandText = sbSql.ToString(); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index b7d7bc0..cfffbe3 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -9,7 +9,10 @@ using DataBlockHelper.DBHelpers; using DevExpress.Utils.Extensions; +using ICSharpCode.Core; + using Mesnac.Action.Base; +using Mesnac.Action.ChemicalWeighing.Report; using Mesnac.Action.ChemicalWeighing.SetValueInfo; using Mesnac.Controls.ChemicalWeighing; using Mesnac.Controls.Default; @@ -30,7 +33,8 @@ namespace Mesnac.Action.ChemicalWeighing.Test public void theout(object source, EventArgs e) { - + LoggingService.InfoFormatted("定时器运行"); + ReportReadDb.ReadReport(); } public void Run(RuntimeParameter runtime) @@ -45,7 +49,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test mCButton.Click += MCButton_Click; - System.Timers.Timer t = new System.Timers.Timer(1000);//实例化Timer类,设置间隔时间为10000毫秒; + System.Timers.Timer t = new System.Timers.Timer(1000*5);//实例化Timer类,设置间隔时间为10000毫秒; t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件; t.AutoReset = true;//设置是执行一次(false)还是一直执行(true); t.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件; @@ -54,12 +58,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test private void MCButton_Click(object sender, EventArgs e) { - DB2114Helper dB = new DB2114Helper(); - var a = dB.Dry; - var b = dB.Gel; - var c = dB.CW; - var d = dB.HW; - var e1 = dB.PD; + } } } diff --git a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml index ce8da0d..a64b210 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml @@ -64,29 +64,27 @@ True - AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1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mFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL True - Name - Id + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL - [DataSource1].[Device].[Id] - MCDataSource1 + + False - select * from Device where Name LIKE '干混%' + - - AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABVTeXN0ZW0uRGF0YS5EYXRhVGFibGUDAAAAGURhdGFUYWJsZS5SZW1vdGluZ1ZlcnNpb24JWG1sU2NoZW1hC1htbERpZmZHcmFtAwEBDlN5c3RlbS5WZXJzaW9uAgAAAAkDAAAABgQAAAD1Azw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi0xNiI/Pg0KPHhzOnNjaGVtYSB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1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