0913 整理代码

master
nodyang 1 year ago
parent e9f1825eaf
commit 55a9a78539

@ -615,16 +615,6 @@
<Compile Include="Report\GelDoser\InitFormAction.cs" />
<Compile Include="Report\GelDoser\SelectAction.cs" />
<Compile Include="Report\GelDoser\SelectRowAction.cs" />
<Compile Include="Report\MaterialStatisticsReport\ExportAction.cs" />
<Compile Include="Report\MaterialStatisticsReport\InitFormAction.cs" />
<Compile Include="Report\MaterialStatisticsReport\SelectWeightAction.cs" />
<Compile Include="Report\ProductionAnalysisReport\ExportAction.cs" />
<Compile Include="Report\ProductionAnalysisReport\InitFormAction.cs" />
<Compile Include="Report\ProductionAnalysisReport\SelectAnalysisAction.cs" />
<Compile Include="Report\ProductionReport\ExportAction.cs" />
<Compile Include="Report\ProductionReport\InitFormAction.cs" />
<Compile Include="Report\ProductionReport\SelectRowAction.cs" />
<Compile Include="Report\ProductionReport\SelectPlanAction.cs" />
<Compile Include="Report\ReportHelper.cs" />
<Compile Include="Report\WetMixer\ExportAction.cs" />
<Compile Include="Report\WetMixer\InitFormAction.cs" />
@ -920,7 +910,6 @@
<ItemGroup>
<Folder Include="LjPlanning\Manager\" />
<Folder Include="Product\PptShift\" />
<Folder Include="Report\BarcodeReport\" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.Excel">

@ -2,7 +2,7 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Entity.Report;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
@ -54,7 +54,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}

@ -1,5 +1,5 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
@ -28,24 +28,22 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
DbMCControl _dgvDryMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_DryMixer").FirstOrDefault();
if (_dgvDryMixer == null || !(_dgvDryMixer.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少干混机报表DataGridView控件...");
ICSharpCode.Core.LoggingService<SelectRowAction>.Warn("{生产报表} 缺少干混机报表DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataGridView _DryMixerGridView = _dgvDryMixer.BaseControl as DataGridView;
this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv")).FirstOrDefault();
this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv1")).FirstOrDefault();
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
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;
@ -60,6 +58,20 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
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关联获取明细数据并赋值给明细控件
@ -77,17 +89,30 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
dbHelper.ClearParameter();
//获取明细数据
StringBuilder sqlStr = new StringBuilder(@"select t2.Name as 设备编号,t1.mix as Mix,t1. mixBatch as 批次,t1.mixStep as 步号,t1.actCode as 动作,
t1.mixTime as ,t1.mixTemp as ,t1.mixSpeed as ,t1.recordTime as
from Report_DryMixer_Detail t1
left join Device t2 on t1.eqNo = t2.Id
where t1.reportId = @reportId");
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();
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";
dbHelper.CommandText = sql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable tableB = dbHelper.ToDataTable();
clientGrid2.DataSource = tableB;
}
}
}

@ -2,7 +2,7 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Entity.Report;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
@ -54,7 +54,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}

@ -31,10 +31,8 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
}
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"select t1.objId,t1.reportId,t2.Name as eqNo,t1.batch,t1.matCode,
t1.setValue,t1.setToler, t1.actValue,t1.actToLer,t1.dos,t1.recordTime
from Report_GelDoser t1
left join Device t2 on t1.eqNo = t2.Id
StringBuilder sbSql = new StringBuilder(@" select objId, gelNo, recordTime, reportId, recipeCode, recipeName, planCode, planName, Batch from Report_Gel
where 1=1");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
@ -43,7 +41,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
if (startdate != null && starttime != null)
{
//Append
sbSql.AppendLine(@"AND t1.recordTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' ");
sbSql.AppendLine(@"AND recordTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
@ -55,14 +53,14 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (enddate != null && endtime != null)
{
sbSql.AppendLine(@"AND t1.recordTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' ");
sbSql.AppendLine(@"AND recordTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectAction>.Debug("{糊化机报表-查询} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
sbSql.Append(" ORDER BY t1.recordTime desc");
sbSql.Append(" ORDER BY recordTime desc");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;

@ -1,5 +1,5 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
@ -28,24 +28,22 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
DbMCControl _dgvGelDoser = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_GelDoser").FirstOrDefault();
if (_dgvGelDoser == null || !(_dgvGelDoser.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少糊化机报表DataGridView控件...");
ICSharpCode.Core.LoggingService<SelectRowAction>.Warn("{生产报表} 缺少糊化机报表DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataGridView _GelDoserGridView = _dgvGelDoser.BaseControl as DataGridView;
this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv")).FirstOrDefault();
this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv1")).FirstOrDefault();
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
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;
@ -60,6 +58,22 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
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关联获取明细数据并赋值给明细控件
@ -77,17 +91,44 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
dbHelper.ClearParameter();
//获取明细数据
StringBuilder sqlStr = new StringBuilder(@"select t2.Name as 设备编号,t1.mix as Mix,t1. mixBatch as 批次,t1.mixStep as 步号,t1.actCode as 动作,
t1.mixTime as ,t1.mixTemp as ,t1.mixSpeed as ,t1.recordTime as
StringBuilder sqlStr = new StringBuilder(@"select t1.batch as 批次号,t2.MName as 物料,
t1.actValue as ,t1.actToler as
from Report_GelDoser_Detail t1
left join Device t2 on t1.eqNo = t2.Id
where t1.reportId = @reportId");
left join lj_stock_material t2 on t1.matCode = t2.Code
where t2.MTypeId=1 and t1.kinds=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 sql = $"select t1.batch as 批次号,t2.MName as 物料,\r\nt1.actValue as 实际重量,t1.actToler as 实际公差\r\n from Report_GelDoser_Detail t1\r\n left join lj_stock_material t2 on t1.matCode = t2.Code\r\n where t2.MTypeId=4 and t1.kinds <> 1 and t1.reportId='{lR_planID}'";
dbHelper.CommandText = sql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table1 = dbHelper.ToDataTable();
foreach (DataRow row in table1.Rows )
{
table.Rows.Add( row.ItemArray );
}
clientGrid.DataSource = table;
sql = $"select t1. mixBatch as 批次,t1.mixStep as 步号,t2.ActionName as 动作,\r\n\t\t t1.mixTime as 时间,t1.mixTemp as 温度,t1.mixSpeed as 速度,t1.recordTime as 记录时间\r\n from Report_GelMixing_Detail t1\r\n left join ActionCode t2 on t1.actCode =t2.Code\r\n\r\n where t2.DeviceUnitId=2 and t1.reportId ='{lR_planID}'\r\n\r\n order by t1.actCode";
dbHelper.CommandText = sql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table2 = dbHelper.ToDataTable();
clientGrid2.DataSource = table2;
}
}
}

@ -1,82 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
/// <summary>
/// 导出物料统计报表业务
/// </summary>
class ExportAction : ChemicalWeighingAction, IAction
{
private DbMCControl _clientDGV = null;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("物料统计-导出...");
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("物料统计报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataTable dt = _clientDGV.BaseControl.BindDataSource as DataTable;
dt.Columns["Recipe_Name"].ColumnName = "配方名";
dt.Columns["Material_Code"].ColumnName = "物料代码";
dt.Columns["Material_name"].ColumnName = "物料名";
dt.Columns["realWeight"].ColumnName = "重量(kg)";
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
System.IO.Stream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite);
Mesnac.Basic.DataToFileHandler.Instance.ToExcel(dt, ref fs);
fs.Close();
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_MaterialStatisticsReport_ExportAction_msg1")); //导出物料统计数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_MaterialStatisticsReport_ExportAction_msg2")); //导出物料统计数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
}
}

@ -1,128 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.MaterialManage;
using Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe;
using Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe.entity;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
public class InitFormAction : ChemicalWeighingAction, IAction
{
private DbMCControl _dgvLRPlan = null;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _clientDGV = null;
private IBaseControl _recipeName = null; //配方名
private string[] DataTypeArray = { "--", "早", "中", "晚" };
private string[] materialDataTypeArray;
private string[] recipeDataTypeArray;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
#region 下拉框班次加载
ComboBox comboBox1 = base.GetControlById("MCCombobox1") as ComboBox;
List<string> DataType = new List<String>(DataTypeArray);
comboBox1.DataSource = DataType;
#endregion
#region 下拉框物料名称加载
List<Base_MaterialInfo> base_MaterialInfos = MaterialHelper.getMaterialList();
materialDataTypeArray = new string[base_MaterialInfos.Count + 1];
materialDataTypeArray[0] = "--";
for (int i = 0; i < base_MaterialInfos.Count; i++)
{
materialDataTypeArray[i + 1] = base_MaterialInfos[i].materialName;
}
ComboBox comboBox2 = base.GetControlById("MCCombobox3") as ComboBox;
comboBox2.DataSource = materialDataTypeArray;
#endregion
#region 下拉框配方名称加载
ComboBox comboBox3 = base.GetControlById("MCCombobox2") as ComboBox;
List<Base_RecipeInfo> base_RecipeInfos = RecipeHelper.GetBaseRecipeInfo();
recipeDataTypeArray = new string[base_RecipeInfos.Count + 1];
recipeDataTypeArray[0] = "--";
for (int i = 0; i < base_RecipeInfos.Count; i++)
{
recipeDataTypeArray[i + 1] = base_RecipeInfos[i].recipeName;
}
comboBox3.DataSource = recipeDataTypeArray;
#endregion
//2.按名称累加物料统计
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"SELECT Base_PlanInfo.recipe_Name AS Recipe_Name,Base_MaterialInfo.material_Id AS Material_Code,Base_MaterialInfo.material_Name AS Material_Name, SUM(LR_Weigh.Real_Weight) as realWeight,Pmt_Shiftime.Shift_name FROM
LR_weigh,Base_PlanInfo,Base_RecipeInfo,Base_MaterialInfo,Pmt_Shiftime
WHERE Base_PlanInfo.plan_Id = LR_weigh.Plan_id AND Base_MaterialInfo.material_Id = LR_weigh.Material_Code AND Base_RecipeInfo.recipe_Id = LR_weigh.Recipe_code AND Pmt_Shiftime.Shift_id = Base_PlanInfo.plan_Team ");
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
sbSql.Append(" GROUP BY Base_PlanInfo.recipe_Name,Base_MaterialInfo.material_Id,Base_MaterialInfo.material_Name,Pmt_Shiftime.Shift_name");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-查询} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
_clientDGV.BaseControl.BindDataSource = null;
_clientDGV.BaseControl.BindDataSource = table;
}
}
}

@ -1,123 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Test;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
/// <summary>
/// 物料统计报表
/// </summary>
class SelectWeightAction : ChemicalWeighingAction, IAction
{
public static event EventHandler MaterialSynchronousComplete;
private RuntimeParameter _runtime;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _clientDGV = null;
private IBaseControl _recipeName = null; //配方名
private IBaseControl _shiftName = null; //班次
private IBaseControl _materialName = null; //物料名称
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("物料统计报表-查询..");
//1.按配方、按时间、按班次物料统计
//ComboBox comboBox = base.GetControlById("MCCombobox1") as ComboBox;
//if (SelectWeightAction.MaterialSynchronousComplete != null)
//{
// SelectWeightAction.MaterialSynchronousComplete(null, EventArgs.Empty);
//}
//2.按名称累加物料统计
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"SELECT Base_PlanInfo.recipe_Name AS Recipe_Name,Base_MaterialInfo.material_Id AS Material_Code,Base_MaterialInfo.material_Name AS Material_Name, SUM(LR_Weigh.Real_Weight) as realWeight,Pmt_Shiftime.Shift_name FROM
LR_weigh,Base_PlanInfo,Base_RecipeInfo,Base_MaterialInfo,Pmt_Shiftime
WHERE Base_PlanInfo.plan_Id = LR_weigh.Plan_id AND Base_MaterialInfo.material_Id = LR_weigh.Material_Code AND Base_RecipeInfo.recipe_Id = LR_weigh.Recipe_code AND Pmt_Shiftime.Shift_id = Base_PlanInfo.plan_Team ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
//配方名称、物料名称及班次
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
this._shiftName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Pmt_Shiftime].[Shift_name]").FirstOrDefault().BaseControl;
this._materialName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_MaterialInfo].[material_Name]").FirstOrDefault().BaseControl;
if (!String.IsNullOrEmpty(this._recipeName.MCValue.ToString()))
{
if (_recipeName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Base_PlanInfo.Recipe_Name = '" + _recipeName.MCValue.ToString() + "' ");
}
}
if (!String.IsNullOrEmpty(this._shiftName.MCValue.ToString()))
{
if (_shiftName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Shift_Name = '" + _shiftName.MCValue.ToString() + "' ");
}
}
if (!String.IsNullOrEmpty(this._materialName.MCValue.ToString()))
{
if (_materialName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Material_Name = '" + _materialName.MCValue.ToString() + "' ");
}
}
sbSql.Append(" GROUP BY Base_PlanInfo.recipe_Name,Base_MaterialInfo.material_Id,Base_MaterialInfo.material_Name,Pmt_Shiftime.Shift_name");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-查询} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
_clientDGV.BaseControl.BindDataSource = null;
_clientDGV.BaseControl.BindDataSource = table;
}
}
}

@ -1,248 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 生产分析报表导出业务
/// </summary>
class ExportAction : ChemicalWeighingAction, Base.IAction
{
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _recipeNameControl = null; //配方名Combobox控件
private Control _clientDGV = null; //生产分析DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("生产分析报表-导出...");
#region 时间配方名控件
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate == null && _starttime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
string start = Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString();
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate == null && _endtime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
string end = Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString();
this._recipeNameControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "[Pmt_recipe].[Recipe_Name]").FirstOrDefault();
if (_recipeNameControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少配方名控件...");
runtime.IsReturn = false;
return;
}
ComboBox recipeNameCB = this._recipeNameControl.BaseControl as ComboBox;
#endregion
List<string> PlanIds = ReportHelper.GetPlanIDList(start, end, recipeNameCB.Text);
string lR_planID = PlanIds[0];
string lR_reName = recipeNameCB.Text;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("生产分析报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientDGV = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientDGV == null)
{
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产分析报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientDGV as Mesnac.Controls.Default.MultiColHeaderDgv);
System.Data.DataTable dt = clientGrid.DataSource as System.Data.DataTable;
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
DataTabletoExcel(dt, fileName, lR_Recipes, lR_reName);
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionAnalysisReport_ExportAction_msg1")); //导出生产分析报表数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionAnalysisReport_ExportAction_msg2")); //导出生产分析数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
public void DataTabletoExcel(System.Data.DataTable tmpDataTable, string strFileName, List<Entity.LR_recipe> lR_Recipes, string reName)
{
///先得到datatable的行数
int rowNum = tmpDataTable.Rows.Count;
///列数
int columnNum = tmpDataTable.Columns.Count;
///声明一个应用程序类实例
Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass();
//创建一个新工作簿
Workbook xlBook = xlApp.Workbooks.Add();
///在工作簿中得到sheet。
_Worksheet oSheet = (_Worksheet)xlBook.Worksheets[1];
#region 绘制列
//绘制配方名和开始时间
oSheet.Cells[1, 1] = "配方名";
oSheet.Cells[1, 2] = reName;
//自定义方法,绘制合并表头
RangeBuild(oSheet, oSheet.Cells[2, 1], oSheet.Cells[2, 2], "物料");
oSheet.Cells[3, 1] = "车次";
oSheet.Cells[3, 2] = "检量时间";
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
int ordinate = 3;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight += (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error += (decimal)lR_Recipes[i].Set_Error;
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], lR_Recipes[i].Material_Name);
oSheet.Cells[3, ordinate] = lR_Recipes[i].Set_Weight.ToString("0.000");
oSheet.Cells[3, ordinate + 1] = lR_Recipes[i].Set_Error.ToString("0.000");
oSheet.Cells[3, ordinate + 2] = "T(s)";
ordinate += 3;
}
//加和重量表头
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], "加和重量");
oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
oSheet.Cells[3, ordinate + 2] = "T(s)";
ordinate += 3;
//检量重量表头
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 3], "检量重量");
oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
oSheet.Cells[3, ordinate + 2] = "T(s)";
oSheet.Cells[3, ordinate + 3] = "皮重";
ordinate += 4;
}
#endregion
//将DataTable中的数据导入Excel中
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
///excel中的列是从1开始的
xlApp.Cells[i + 4, j + 1] = tmpDataTable.Rows[i][j].ToString();
}
}
///保存,路径一块穿进去。否则回到一个很奇妙的地方貌似是system32里 temp下....
oSheet.SaveAs(strFileName);
}
/// <summary>
/// 合并单元格业务方法
/// </summary>
/// <param name="oSheet">工作簿中的sheet</param>
/// <param name="startcell">起始cell</param>
/// <param name="endcell">结束cell</param>
/// <param name="value">合并后单元格文本</param>
private static void RangeBuild(_Worksheet oSheet, object startcell, object endcell, string value)
{
Range excelRange = oSheet.Range[startcell, endcell];/*需要合并的单元格*/
///合并方法
excelRange.Merge(excelRange.MergeCells);/*合并*/
///合并单元格之后,设置其中的文本
excelRange.Value = value;
//横向居中
excelRange.HorizontalAlignment = XlVAlign.xlVAlignCenter;
//字体大小
//range.Font.Size = 18;
//字体
//range.Font.Name = "黑体";
//行高
//range.RowHeight = 24;
//自动调整列宽
excelRange.EntireColumn.AutoFit();
//填充颜色
//range.Interior.ColorIndex = 20;
//设置单元格边框的粗细
excelRange.Cells.Borders.LineStyle = 1;
}
}
}

@ -1,28 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 初始化生产分析报表
/// </summary>
class InitFormAction : ChemicalWeighingAction, IAction
{
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
}
}
}

@ -1,344 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 生产质量分析
/// </summary>
class SelectAnalysisAction : ChemicalWeighingAction, IAction
{
#region 字段定义
private RuntimeParameter _runtime;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _recipeNameControl = null; //配方名Combobox控件
private Control _clientGridControl = null; //多维表控件
private DataTable dataTable = null;
#endregion
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
#region 获取开始/结束时间控件和质量分析控件
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if(_startdate == null && _starttime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
string start = Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString();
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate == null && _endtime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
string end = Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString();
this._recipeNameControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "[Pmt_recipe].[Recipe_Name]").FirstOrDefault();
if (_recipeNameControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少配方名控件...");
runtime.IsReturn = false;
return;
}
ComboBox recipeNameCB = this._recipeNameControl.BaseControl as ComboBox;
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientGridControl = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少质量分析MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv);
dataTable = new DataTable("AnalysisDT");
#endregion
#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);
#endregion
if (!string.IsNullOrEmpty(recipeNameCB.Text))
{
List<string> PlanIds = ReportHelper.GetPlanIDList(start,end,recipeNameCB.Text);
if (PlanIds.Count == 0)
{
MessageBox.Show("未查询到该时间段的配方计划信息");
return;
}
string lR_planID = PlanIds[0];
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
TreeView treeView = new TreeView();
List<Entity.LR_lot> lR_Lots = ReportHelper.GetAllLR_lotList(PlanIds);
List<Entity.LR_weigh> lR_Weighs = ReportHelper.GetAllLR_weighList(PlanIds, lR_Recipes.Count);
#region 表头建立
BuildTableHead(treeView, lR_Recipes);
clientGrid.myColHeaderTreeView = treeView;
#endregion
#region 数据填充
DataTableWrite(lR_Lots, lR_Weighs);
#endregion
#region 增加最大最小平均合计值行
DataTableAdd(lR_Recipes.Count);
#endregion
clientGrid.DataSource = dataTable;
}
}
#region 建立表头结构
private void BuildTableHead(TreeView treeView, List<Entity.LR_recipe> lR_Recipes)
{
int treeIndex = 0;
TreeNode rootTreeNode = new TreeNode("物料");
treeView.Nodes.Add(rootTreeNode);
TreeNode childTreeNodeSerial_Num = new TreeNode("序号");
TreeNode childTreeNodeWeight_Time = new TreeNode("检量时间");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSerial_Num);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWeight_Time);
dataTable.Columns.Add("Serial_Num", typeof(System.String));
dataTable.Columns.Add("Weight_Time", typeof(System.String));
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight = sumSet_Weight + (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error = sumSet_Error + (decimal)lR_Recipes[i].Set_Error;
TreeNode rootTreeNodeMaterialName = new TreeNode(lR_Recipes[i].Material_Name);
treeView.Nodes.Add(rootTreeNodeMaterialName);
treeIndex++;
TreeNode childTreeNodeSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodeWaste_Time = new TreeNode("时间(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWaste_Time);
dataTable.Columns.Add("Set_Weight" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Set_Error" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Waste_Time" + treeIndex.ToString(), typeof(decimal));
}
//加和重量表头
TreeNode rootTreeNodeSum = new TreeNode("加和重量");
treeView.Nodes.Add(rootTreeNodeSum);
treeIndex++;
TreeNode childTreeNodeSumSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeSumSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodesumWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodesumWaste_Time);
dataTable.Columns.Add("SumSet_Weight", typeof(decimal));
dataTable.Columns.Add("SumSet_Error", typeof(decimal));
dataTable.Columns.Add("SumWaste_Time", typeof(decimal));
//检量重量表头
TreeNode rootTreeNodeCheck = new TreeNode("检量重量");
treeView.Nodes.Add(rootTreeNodeCheck);
treeIndex++;
TreeNode childTreeNodeCheckSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeCheckSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodeCheckWaste_Time = new TreeNode("T(s)");
TreeNode childTreeNodeCheckNet_Weight = new TreeNode("皮重");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckWaste_Time);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckNet_Weight);
dataTable.Columns.Add("CheckSet_Weight", typeof(decimal));
dataTable.Columns.Add("CheckSet_Error", typeof(decimal));
dataTable.Columns.Add("CheckWaste_Time", typeof(decimal));
dataTable.Columns.Add("CheckNet_Weight", typeof(System.String));
}
}
#endregion
#region 数据表填充
private void DataTableWrite(List<Entity.LR_lot> lR_Lots, List<Entity.LR_weigh> lR_Weighs)
{
if (lR_Lots != null && lR_Lots.Count > 0)
{
for (int i = 0; i < lR_Lots.Count; i++)
{
int sumRealWaste_Time = 0; //加和时间
DataRow drow = dataTable.NewRow();
//车次和检量时间数据填入
drow["Serial_Num"] = lR_Lots[i].Serial_Num;
drow["Weight_Time"] = lR_Lots[i].Prd_date;
//每车物料数据填入
List<Entity.LR_weigh> curWeights = lR_Weighs.FindAll(x => x.Serial_Num == lR_Lots[i].Serial_Num);
if (curWeights != null && curWeights.Count > 0)
{
for (int j = 0; j < curWeights.Count; j++)
{
drow["Set_Weight" + (j + 1).ToString()] = curWeights[j].Real_Weight;
drow["Set_Error" + (j + 1).ToString()] = curWeights[j].Real_Error;
drow["Waste_Time" + (j + 1).ToString()] = curWeights[j].Waste_Time;
sumRealWaste_Time = sumRealWaste_Time + (int)curWeights[j].Waste_Time;
}
}
//加和重量数据填入
drow["SumSet_Weight"] = lR_Lots[i].Real_weight;
drow["SumSet_Error"] = lR_Lots[i].Real_weight;
drow["SumWaste_Time"] = sumRealWaste_Time;
//检量重量数据填入
drow["CheckSet_Weight"] = lR_Lots[i].Real_weight;
drow["CheckSet_Error"] = lR_Lots[i].Real_weight;
drow["CheckWaste_Time"] = lR_Lots[i].Waste_Time;
drow["CheckNet_Weight"] = lR_Lots[i].Net_Weight;
dataTable.Rows.Add(drow);
}
}
}
#endregion
#region DataTable新增最大最小平均合计值行
private void DataTableAdd(int mNum)
{
//最大值行
DataRow drowMax = dataTable.NewRow();
drowMax["Weight_Time"] = "最大值";
for (int i=0; i<mNum;i++)
{
drowMax["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("max(Set_Weight"+ (i + 1).ToString() + ")", "");
drowMax["Set_Error" + (i + 1).ToString()] = dataTable.Compute("max(Set_Error" + (i + 1).ToString() + ")", "");
drowMax["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("max(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMax["SumSet_Weight"] = dataTable.Compute("max(SumSet_Weight)", "");
drowMax["SumSet_Error"] = dataTable.Compute("max(SumSet_Error)", "");
drowMax["SumWaste_Time"] = dataTable.Compute("max(SumWaste_Time)", "");
drowMax["CheckSet_Weight"] = dataTable.Compute("max(CheckSet_Weight)", "");
drowMax["CheckSet_Error"] = dataTable.Compute("max(CheckSet_Error)", "");
drowMax["CheckWaste_Time"] = dataTable.Compute("max(CheckWaste_Time)", "");
//最小值行
DataRow drowMin = dataTable.NewRow();
drowMin["Weight_Time"] = "最小值";
for (int i = 0; i < mNum; i++)
{
drowMin["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("min(Set_Weight" + (i + 1).ToString() + ")", "");
drowMin["Set_Error" + (i + 1).ToString()] = dataTable.Compute("min(Set_Error" + (i + 1).ToString() + ")", "");
drowMin["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("min(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMin["SumSet_Weight"] = dataTable.Compute("min(SumSet_Weight)", "");
drowMin["SumSet_Error"] = dataTable.Compute("min(SumSet_Error)", "");
drowMin["SumWaste_Time"] = dataTable.Compute("min(SumWaste_Time)", "");
drowMin["CheckSet_Weight"] = dataTable.Compute("min(CheckSet_Weight)", "");
drowMin["CheckSet_Error"] = dataTable.Compute("min(CheckSet_Error)", "");
drowMin["CheckWaste_Time"] = dataTable.Compute("min(CheckWaste_Time)", "");
//平均值行
DataRow drowAvg = dataTable.NewRow();
drowAvg["Weight_Time"] = "平均值";
for (int i = 0; i < mNum; i++)
{
drowAvg["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Weight" + (i + 1).ToString() + ")", "");
drowAvg["Set_Error" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Error" + (i + 1).ToString() + ")", "");
drowAvg["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("avg(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowAvg["SumSet_Weight"] = dataTable.Compute("avg(SumSet_Weight)", "");
drowAvg["SumSet_Error"] = dataTable.Compute("avg(SumSet_Error)", "");
drowAvg["SumWaste_Time"] = dataTable.Compute("avg(SumWaste_Time)", "");
drowAvg["CheckSet_Weight"] = dataTable.Compute("avg(CheckSet_Weight)", "");
drowAvg["CheckSet_Error"] = dataTable.Compute("avg(CheckSet_Error)", "");
drowAvg["CheckWaste_Time"] = dataTable.Compute("avg(CheckWaste_Time)", "");
//合计
DataRow drowSum = dataTable.NewRow();
drowSum["Weight_Time"] = "合计";
for (int i = 0; i < mNum; i++)
{
drowSum["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Weight" + (i + 1).ToString() + ")", "");
drowSum["Set_Error" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Error" + (i + 1).ToString() + ")", "");
drowSum["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("sum(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowSum["SumSet_Weight"] = dataTable.Compute("sum(SumSet_Weight)", "");
drowSum["SumSet_Error"] = dataTable.Compute("sum(SumSet_Error)", "");
drowSum["SumWaste_Time"] = dataTable.Compute("sum(SumWaste_Time)", "");
drowSum["CheckSet_Weight"] = dataTable.Compute("sum(CheckSet_Weight)", "");
drowSum["CheckSet_Error"] = dataTable.Compute("sum(CheckSet_Error)", "");
drowSum["CheckWaste_Time"] = dataTable.Compute("sum(CheckWaste_Time)", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
#endregion
}
}

@ -1,253 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表导出Action
/// </summary>
class ExportAction : ChemicalWeighingAction, Base.IAction
{
private Control _clientDGV = null; //称量明细DGV
private DbMCControl _dgvLRPlan = null; //生产计划DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("生产报表-导出...");
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
DataGridView lR_planGridView = this._dgvLRPlan.BaseControl as DataGridView;
string lR_planID = lR_planGridView.SelectedRows[0].Cells["plan_Id"].Value as string;
string lR_reName = lR_planGridView.SelectedRows[0].Cells["recipe_Name"].Value as string;
string lR_starTime = lR_planGridView.SelectedRows[0].Cells["plan_beginTime"].Value as string;
string plan_count = Convert.ToInt32(lR_planGridView.SelectedRows[0].Cells["plan_Amount"].Value).ToString();
string real_count = Convert.ToInt32(lR_planGridView.SelectedRows[0].Cells["real_Amount"].Value).ToString();
string plan_State = lR_planGridView.SelectedRows[0].Cells["plan_State"].Value as string;
string plan_endTime = lR_planGridView.SelectedRows[0].Cells["plan_endTime"].Value as string;
string Shift_Name = lR_planGridView.SelectedRows[0].Cells["Shift_Name"].Value as string;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("生产报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientDGV = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientDGV == null)
{
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientDGV as Mesnac.Controls.Default.MultiColHeaderDgv);
System.Data.DataTable dt = clientGrid.DataSource as System.Data.DataTable;
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
DataTabletoExcel(dt, fileName, lR_Recipes, lR_planID, lR_reName, plan_count, real_count, plan_State, lR_starTime, plan_endTime, Shift_Name);
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionReport_ExportAction_msg1")); //导出生产报表数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionReport_ExportAction_msg2")); //导出生产报表数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
public void DataTabletoExcel(System.Data.DataTable tmpDataTable, string strFileName, List<Entity.LR_recipe> lR_Recipes, string lR_planID , string reName,string plan_count, string real_count, string plan_State, string startTime,string plan_endTime,string Shift_Name)
{
///先得到datatable的行数
int rowNum = tmpDataTable.Rows.Count;
///列数
int columnNum = tmpDataTable.Columns.Count;
///声明一个应用程序类实例
Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass();
//创建一个新工作簿
Workbook xlBook = xlApp.Workbooks.Add();
///在工作簿中得到sheet。
_Worksheet oSheet = (_Worksheet)xlBook.Worksheets[1];
#region 绘制列
//绘制配方名和开始时间
oSheet.Cells[1, 1] = "计划号";
oSheet.Cells[1, 2] = "配方名";
oSheet.Cells[1, 3] = "计划数量";
oSheet.Cells[1, 4] = "完成数量";
oSheet.Cells[1, 5] = "完成数量";
oSheet.Cells[1, 5] = "计划状态";
oSheet.Cells[1, 6] = "开始时间";
oSheet.Cells[1, 7] = "完成时间";
oSheet.Cells[1, 8] = "计划班组";
oSheet.Cells[2, 1] = lR_planID;
oSheet.Cells[2, 2] = reName;
oSheet.Cells[2, 3] = plan_count;
oSheet.Cells[2, 4] = real_count;
oSheet.Cells[2, 5] = plan_State;
oSheet.Cells[2, 6] = startTime;
oSheet.Cells[2, 7] = plan_endTime;
oSheet.Cells[2, 8] = Shift_Name;
//自定义方法,绘制合并表头
//RangeBuild(oSheet, oSheet.Cells[2, 1], oSheet.Cells[2, 2], "物料");
oSheet.Cells[3, 1] = "车数";
oSheet.Cells[3, 2] = "格数";
oSheet.Cells[3, 3] = "完成时间";
oSheet.Cells[3, 4] = "罐A应配";
oSheet.Cells[3, 5] = "罐A实配";
oSheet.Cells[3, 6] = "罐B应配";
oSheet.Cells[3, 7] = "罐B实配";
oSheet.Cells[3, 8] = "树脂应配";
oSheet.Cells[3, 9] = "树脂实配";
//oSheet.Cells[3, 10] = "VCC及GFA卸料速度";
//oSheet.Cells[3, 11] = "混料运行速度";
//oSheet.Cells[3, 12] = "混合机卸料速度";
//oSheet.Cells[3, 13] = "混合机运行时间";
//oSheet.Cells[3, 14] = "系数";
oSheet.Cells[3, 10] = "混料运行速度";
oSheet.Cells[3, 11] = "混合机卸料速度";
oSheet.Cells[3, 12] = "混合机运行时间";
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
int ordinate = 3;
//if (lR_Recipes != null && lR_Recipes.Count > 0)
//{
// //物料表头
// for (int i = 0; i < lR_Recipes.Count; i++)
// {
// sumSet_Weight += (decimal)lR_Recipes[i].Set_Weight;
// sumSet_Error += (decimal)lR_Recipes[i].Set_Error;
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate+2], lR_Recipes[i].Material_Name);
// oSheet.Cells[3, ordinate] = lR_Recipes[i].Set_Weight.ToString("0.000");
// oSheet.Cells[3, ordinate+1] = lR_Recipes[i].Set_Error.ToString("0.000");
// oSheet.Cells[3, ordinate+2] = "T(s)";
// ordinate += 3;
// }
// //加和重量表头
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], "加和重量");
// oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
// oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
// oSheet.Cells[3, ordinate + 2] = "T(s)";
// ordinate += 3;
// //检量重量表头
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 3], "检量重量");
// oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
// oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
// oSheet.Cells[3, ordinate + 2] = "T(s)";
// oSheet.Cells[3, ordinate + 3] = "皮重";
// ordinate += 4;
//}
#endregion
//将DataTable中的数据导入Excel中
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
///excel中的列是从1开始的
xlApp.Cells[i + 4, j + 1] = tmpDataTable.Rows[i][j].ToString();
}
}
///保存,路径一块穿进去。否则回到一个很奇妙的地方貌似是system32里 temp下....
oSheet.SaveAs(strFileName);
}
/// <summary>
/// 合并单元格业务方法
/// </summary>
/// <param name="oSheet">工作簿中的sheet</param>
/// <param name="startcell">起始cell</param>
/// <param name="endcell">结束cell</param>
/// <param name="value">合并后单元格文本</param>
private static void RangeBuild(_Worksheet oSheet, object startcell, object endcell, string value)
{
Range excelRange = oSheet.Range[startcell, endcell];/*需要合并的单元格*/
///合并方法
excelRange.Merge(excelRange.MergeCells);/*合并*/
///合并单元格之后,设置其中的文本
excelRange.Value = value;
//横向居中
excelRange.HorizontalAlignment = XlVAlign.xlVAlignCenter;
//字体大小
//range.Font.Size = 18;
//字体
//range.Font.Name = "黑体";
//行高
//range.RowHeight = 24;
//自动调整列宽
excelRange.EntireColumn.AutoFit();
//填充颜色
//range.Interior.ColorIndex = 20;
//设置单元格边框的粗细
excelRange.Cells.Borders.LineStyle = 1;
}
}
}

@ -1,28 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表初始化窗体
/// </summary>
class InitFormAction : ChemicalWeighingAction, IAction
{
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
}
}
}

@ -1,112 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表中查询生产计划Action
/// </summary>
class SelectPlanAction : ChemicalWeighingAction, IAction
{
private RuntimeParameter _runtime;
private IBaseControl _equipCode = null; //机台号
private IBaseControl _version = null; //版本
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private IBaseControl _recipeName = null; //配方名
private IBaseControl _shiftName = null; //班次
private DbMCControl _dgvLRPlan = null; //生产计划DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("生产报表-生产计划-查询..");
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
//StringBuilder sbSql = new StringBuilder(@"Select A.Plan_Id,A.Equip_Code,A.Plan_ID,A.Recipe_Code,A.Recipe_Name,A.Version,A.Mixer_Line,A.Plan_num,A.Real_Num,A.Start_Date,A.End_Date,A.Weight_Man,B.Shift_Name
// From LR_Plan A Left Join Pmt_ShifTime B On(A.Shift_ID = B.Shift_ID) WHERE 1=1 ");
StringBuilder sbSql = new StringBuilder(@"select A.plan_Id,A.recipe_Name,A.plan_Amount,A.real_Amount,case plan_State when '0' then '待执行' when '1' then '执行中' when '2' then '已完成' when '3' then '已终止' else '异常' end as 'plan_State',A.plan_beginTime,A.plan_endTime,B.Shift_name as Shift_Name from Base_PlanInfo A Left Join Pmt_ShifTime B On(A.plan_Team = B.Shift_ID) WHERE 1=1 ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And A.plan_beginTime >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("{生产报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And A.plan_beginTime <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("{生产报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
//配方名和班次条件
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
this._shiftName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Pmt_Shiftime].[Shift_name]").FirstOrDefault().BaseControl;
if (!String.IsNullOrEmpty(this._recipeName.MCValue.ToString()))
{
sbSql.AppendLine(@"And A.Recipe_Name = '" + _recipeName.MCValue.ToString() + "' ");
}
if (!String.IsNullOrEmpty(this._shiftName.MCValue.ToString()))
{
sbSql.AppendLine(@"And Shift_Name = '" + _shiftName.MCValue.ToString() + "' ");
}
//机台号和版本条件
//this._equipCode = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "EquipCode").FirstOrDefault().BaseControl;
//this._version = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "version").FirstOrDefault().BaseControl;
//if (!String.IsNullOrEmpty(this._equipCode.MCValue.ToString()))
//{
// sbSql.AppendLine(@"And A.Equip_Code = '" + _equipCode.MCValue.ToString() + "' ");
//}
//if (!String.IsNullOrEmpty(this._version.MCValue.ToString()))
//{
// sbSql.AppendLine(@"And A.Version = '" + _version.MCValue.ToString() + "' ");
//}
sbSql.Append(" ORDER BY A.plan_beginTime desc");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
//刷新生产计划DataGridView数据
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
if (_dgvLRPlan == null || !(_dgvLRPlan.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表-查询} 缺少生产计划DataGridView控件...");
runtime.IsReturn = false;
return;
}
_dgvLRPlan.BaseControl.BindDataSource = null;
_dgvLRPlan.BaseControl.BindDataSource = table;
}
}
}

@ -1,537 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data;
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
using System.Reflection;
using Mesnac.Controls.Base;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表业务
/// </summary>
public class SelectRowAction : ChemicalWeighingAction,IAction
{
#region 字段定义
public static bool IsFirstRun = true; //是否首次运行
private RuntimeParameter _runtime;
private Control _clientGridControl = null; //多维表控件
private DbMCControl _dgvLRPlan = null; //生产计划DGV
private DataTable dataTable = null;
#endregion
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
#region 获取界面生产计划控件和称量明细控件
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
if (_dgvLRPlan == null || !(_dgvLRPlan.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少生产计划DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataGridView lR_planGridView = this._dgvLRPlan.BaseControl as DataGridView;
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientGridControl = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv);
dataTable = new DataTable("ProductionDT");
#endregion
#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;
#endregion
if (lR_planGridView.SelectedRows.Count == 1)
{
string lR_planID = lR_planGridView.SelectedRows[0].Cells["Plan_Id"].Value as string;
if (!string.IsNullOrEmpty(lR_planID))
{
#region 数据源获取及定义
List<Entity.LR_lot> lR_Lots = ReportHelper.GetLR_lotList(lR_planID);
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
List<Entity.LR_weigh> lR_Weighs = ReportHelper.GetLR_weighList(lR_planID);
List<Entity.RecordSaveDataInfo> RecordSaveDataInfo = ReportHelper.GetReportSaveDataList(lR_planID);
TreeView treeView = new TreeView();
#endregion
#region 表头建立
GHBuildTableHead(treeView, RecordSaveDataInfo);
//BuildTableHead(treeView, lR_Recipes);
//clientGrid.myColHeaderTreeView = treeView;
#endregion
#region 数据填充
GHDataTableWrite(RecordSaveDataInfo);
//DataTableWrite(lR_Lots, lR_Recipes, lR_Weighs);
#endregion
#region 增加最大最小平均合计值行
GHDataTableAdd(RecordSaveDataInfo.Count);
//DataTableAdd(lR_Recipes.Count);
#endregion
clientGrid.DataSource = dataTable;
for (int i = 0; i < clientGrid.Columns.Count; i++)
{
clientGrid.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
}
}
}
#region 方法定义
#region 建立表头结构
private void GHBuildTableHead(TreeView treeView, List<Entity.RecordSaveDataInfo> RecordSaveDataInfo)
{
try
{
//decimal sumSet_Weight = 0.0M;
//decimal sumSet_Error = 0.0M;
//if (RecordSaveDataInfo != null && RecordSaveDataInfo.Count > 0)
//{
// for (int i = 0; i < RecordSaveDataInfo.Count; i++)
// {
// sumSet_Weight = sumSet_Weight + (decimal)RecordSaveDataInfo[i].SaveVCCAct;
// }
//}
//TreeNode childTreeNodeSaveFinishedNum = new TreeNode("车数");
//treeView.Nodes.Add(childTreeNodeSaveFinishedNum);
//TreeNode childTreeNodeSaveRecordTime = new TreeNode("记录时间");
//treeView.Nodes.Add(childTreeNodeSaveRecordTime);
//TreeNode childTreeNodeSaveCol = new TreeNode("格数");
//treeView.Nodes.Add(childTreeNodeSaveCol);
//TreeNode childTreeNodeSaveVCCSet = new TreeNode(" VCC应配");
//treeView.Nodes.Add(childTreeNodeSaveVCCSet);
//TreeNode childTreeNodeSaveVCCAct = new TreeNode(" VCC实配");
//treeView.Nodes.Add(childTreeNodeSaveVCCAct);
//TreeNode childTreeNodeSaveGFASet = new TreeNode("GFA应配");
//treeView.Nodes.Add(childTreeNodeSaveGFASet);
//TreeNode childTreeNodeSaveGFAAct = new TreeNode("GFA实配");
//treeView.Nodes.Add(childTreeNodeSaveGFAAct);
//TreeNode childTreeNodeSave3thSet = new TreeNode("树脂应配");
//treeView.Nodes.Add(childTreeNodeSave3thSet);
//TreeNode childTreeNodeSave3thAct = new TreeNode("树脂实配");
//treeView.Nodes.Add(childTreeNodeSave3thAct);
//TreeNode childTreeNodeSaveLevel = new TreeNode("系数");
//treeView.Nodes.Add(childTreeNodeSaveLevel);
//TreeNode childTreeNodeSaveFillTime = new TreeNode("VCC+GFA卸料速度");
//treeView.Nodes.Add(childTreeNodeSaveFillTime);
//TreeNode childTreeNodeSaveSpeed1 = new TreeNode("混料运行速度");
//treeView.Nodes.Add(childTreeNodeSaveSpeed1);
//TreeNode childTreeNodeSaveSpeed2 = new TreeNode("混合机卸料速度");
//treeView.Nodes.Add(childTreeNodeSaveSpeed2);
//TreeNode childTreeNodeSaveTime = new TreeNode("混料运行时间");
//treeView.Nodes.Add(childTreeNodeSaveTime);
dataTable.Columns.Add("车数", typeof(System.String));
dataTable.Columns.Add("格数", typeof(System.String));
dataTable.Columns.Add("记录时间", typeof(System.String));
dataTable.Columns.Add("罐A应配", typeof(decimal));
dataTable.Columns.Add("罐A实配", typeof(decimal));
dataTable.Columns.Add("罐B应配", typeof(decimal));
dataTable.Columns.Add("罐B实配", typeof(decimal));
dataTable.Columns.Add("树脂应配", typeof(decimal));
dataTable.Columns.Add("树脂实配", typeof(decimal));
dataTable.Columns.Add("罐A二次应配", typeof(decimal));
dataTable.Columns.Add("罐A二次实配", typeof(decimal));
dataTable.Columns.Add("罐B二次应配", typeof(decimal));
dataTable.Columns.Add("罐B二次实配", typeof(decimal));
//dataTable.Columns.Add("VCC及GFA卸料速度", typeof(decimal));
dataTable.Columns.Add("混料运行速度", typeof(decimal));
dataTable.Columns.Add("混合机卸料速度", typeof(decimal));
dataTable.Columns.Add("混料运行时间", typeof(decimal));
//dataTable.Columns.Add("系数", typeof(decimal));
//dataTable.Columns.Add("SaveFinishedNum", typeof(System.String));
//dataTable.Columns.Add("Record_Time", typeof(System.String));
//dataTable.Columns.Add("SaveCol", typeof(System.String));
//dataTable.Columns.Add("SaveVCCSet", typeof(decimal));
//dataTable.Columns.Add("SaveVCCAct", typeof(decimal));
//dataTable.Columns.Add("SaveGFASet", typeof(decimal));
//dataTable.Columns.Add("SaveGFAAct", typeof(decimal));
//dataTable.Columns.Add("Save3thSet", typeof(decimal));
//dataTable.Columns.Add("Save3thAct", typeof(decimal));
//dataTable.Columns.Add("SaveFillTime", typeof(decimal));
//dataTable.Columns.Add("SaveSpeed1", typeof(decimal));
//dataTable.Columns.Add("SaveSpeed2", typeof(decimal));
//dataTable.Columns.Add("SaveTime", typeof(decimal));
//dataTable.Columns.Add("SaveLevel", typeof(decimal));
}
catch (Exception ex)
{
}
}
private void BuildTableHead(TreeView treeView, List<Entity.LR_recipe> lR_Recipes)
{
int treeIndex = 0;
TreeNode rootTreeNode = new TreeNode("物料");
treeView.Nodes.Add(rootTreeNode);
TreeNode childTreeNodeSerial_Num = new TreeNode("车次");
TreeNode childTreeNodeWeight_Time = new TreeNode("检量时间");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSerial_Num);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWeight_Time);
dataTable.Columns.Add("Serial_Num", typeof(System.String));
dataTable.Columns.Add("Weight_Time", typeof(System.String));
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight = sumSet_Weight + (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error = sumSet_Error + (decimal)lR_Recipes[i].Set_Error;
TreeNode rootTreeNodeMaterialName = new TreeNode(lR_Recipes[i].Material_Name);
treeView.Nodes.Add(rootTreeNodeMaterialName);
treeIndex++;
TreeNode childTreeNodeSet_Weight = new TreeNode(lR_Recipes[i].Set_Weight.ToString("0.000"));
TreeNode childTreeNodeSet_Error = new TreeNode(lR_Recipes[i].Set_Error.ToString("0.000"));
TreeNode childTreeNodeWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWaste_Time);
dataTable.Columns.Add("Set_Weight" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Set_Error" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Waste_Time" + treeIndex.ToString(), typeof(decimal));
}
//加和重量表头
TreeNode rootTreeNodeSum = new TreeNode("加和重量");
treeView.Nodes.Add(rootTreeNodeSum);
treeIndex++;
TreeNode childTreeNodeSumSet_Weight = new TreeNode(sumSet_Weight.ToString());
TreeNode childTreeNodeSumSet_Error = new TreeNode(sumSet_Error.ToString());
TreeNode childTreeNodesumWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodesumWaste_Time);
dataTable.Columns.Add("SumSet_Weight", typeof(decimal));
dataTable.Columns.Add("SumSet_Error", typeof(decimal));
dataTable.Columns.Add("SumWaste_Time", typeof(decimal));
//检量重量表头
TreeNode rootTreeNodeCheck = new TreeNode("检量重量");
treeView.Nodes.Add(rootTreeNodeCheck);
treeIndex++;
TreeNode childTreeNodeCheckSet_Weight = new TreeNode(sumSet_Weight.ToString());
TreeNode childTreeNodeCheckSet_Error = new TreeNode(sumSet_Error.ToString());
TreeNode childTreeNodeCheckWaste_Time = new TreeNode("T(s)");
TreeNode childTreeNodeCheckNet_Weight = new TreeNode("皮重");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckWaste_Time);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckNet_Weight);
dataTable.Columns.Add("CheckSet_Weight", typeof(decimal));
dataTable.Columns.Add("CheckSet_Error", typeof(decimal));
dataTable.Columns.Add("CheckWaste_Time", typeof(decimal));
dataTable.Columns.Add("CheckNet_Weight", typeof(System.String));
}
}
#endregion
#region 数据表填充
private void GHDataTableWrite(List<Entity.RecordSaveDataInfo> RecordSaveDataInfo)
{
try
{
if (RecordSaveDataInfo != null && RecordSaveDataInfo.Count > 0)
{
for (int i = 0; i < RecordSaveDataInfo.Count; i++)
{
DataRow drow = dataTable.NewRow();
drow["车数"] = RecordSaveDataInfo[i].SaveFinishedNum;
drow["格数"] = RecordSaveDataInfo[i].SaveCol;
drow["记录时间"] = RecordSaveDataInfo[i].RecordTime;
drow["罐A应配"] = RecordSaveDataInfo[i].SaveVCCSet;
drow["罐A实配"] = RecordSaveDataInfo[i].SaveVCCAct;
drow["罐B应配"] = RecordSaveDataInfo[i].SaveGFASet;
drow["罐B实配"] = RecordSaveDataInfo[i].SaveGFAAct;
drow["树脂应配"] = RecordSaveDataInfo[i].Save3thSet;
drow["树脂实配"] = RecordSaveDataInfo[i].Save3thAct;
drow["罐A二次应配"] = RecordSaveDataInfo[i].SaveVCC2thSet;
drow["罐A二次实配"] = RecordSaveDataInfo[i].SaveVCC2thAct;
drow["罐B二次应配"] = RecordSaveDataInfo[i].SaveGFA2thSet;
drow["罐B二次实配"] = RecordSaveDataInfo[i].SaveGFA2thAct;
//drow["VCC及GFA卸料速度"] = RecordSaveDataInfo[i].SaveFillTime;
drow["混料运行速度"] = RecordSaveDataInfo[i].SaveSpeed1;
drow["混合机卸料速度"] = RecordSaveDataInfo[i].SaveSpeed2;
drow["混料运行时间"] = RecordSaveDataInfo[i].SaveTime;
//drow["系数"] = RecordSaveDataInfo[i].SaveLevel;
dataTable.Rows.Add(drow);
}
}
}
catch (Exception ex)
{
throw;
}
}
private void DataTableWrite(List<Entity.LR_lot> lR_Lots, List<Entity.LR_recipe> lR_Recipes, List<Entity.LR_weigh> lR_Weighs)
{
if(lR_Lots != null && lR_Lots.Count > 0)
{
for(int i = 0; i < lR_Lots.Count; i++)
{
int sumRealWaste_Time = 0; //加和时间
DataRow drow = dataTable.NewRow();
//车次和检量时间数据填入
drow["Serial_Num"] = lR_Lots[i].Serial_Num;
drow["Weight_Time"] = lR_Lots[i].Prd_date;
//每车物料数据填入
List<Entity.LR_weigh> curWeights = lR_Weighs.FindAll(x => x.Serial_Num == lR_Lots[i].Serial_Num);
if(curWeights != null && curWeights.Count > 0)
{
for(int j = 0;j< curWeights.Count; j++)
{
drow["Set_Weight" + (j + 1).ToString()] = curWeights[j].Real_Weight;
drow["Set_Error" + (j + 1).ToString()] = curWeights[j].Real_Error;
drow["Waste_Time" + (j + 1).ToString()] = curWeights[j].Waste_Time;
sumRealWaste_Time = sumRealWaste_Time + (int)curWeights[j].Waste_Time;
}
}
//加和重量数据填入
drow["SumSet_Weight"] = lR_Lots[i].Real_weight;
drow["SumSet_Error"] = lR_Lots[i].Real_Error;
drow["SumWaste_Time"] = sumRealWaste_Time;
//检量重量数据填入
drow["CheckSet_Weight"] = lR_Lots[i].Real_weight;
drow["CheckSet_Error"] = lR_Lots[i].Real_Error;
drow["CheckWaste_Time"] = lR_Lots[i].Waste_Time;
drow["CheckNet_Weight"] = lR_Lots[i].Net_Weight;
dataTable.Rows.Add(drow);
}
}
}
#endregion
#region DataTable新增最大最小平均合计值行
private void GHDataTableAdd(int mNun)
{
try
{
DataRow drowMax = dataTable.NewRow();
drowMax["记录时间"] = "最大值";
drowMax["罐A应配"] = dataTable.Compute("max(罐A应配)", "");
drowMax["罐A实配"] = dataTable.Compute("max(罐A实配)", "");
drowMax["罐B应配"] = dataTable.Compute("max(罐B应配)", "");
drowMax["罐B实配"] = dataTable.Compute("max(罐B实配)", "");
drowMax["树脂应配"] = dataTable.Compute("max(树脂应配)", "");
drowMax["树脂实配"] = dataTable.Compute("max(树脂实配)", "");
drowMax["罐A二次应配"] = dataTable.Compute("max(罐A二次应配)", "");
drowMax["罐A二次实配"] = dataTable.Compute("max(罐A二次实配)", "");
drowMax["罐B二次应配"] = dataTable.Compute("max(罐B二次应配)", "");
drowMax["罐B二次实配"] = dataTable.Compute("max(罐B二次实配)", "");
//drowMax["VCC及GFA卸料速度"] = dataTable.Compute("max(VCC及GFA卸料速度)", "");
drowMax["混料运行速度"] = dataTable.Compute("max(混料运行速度)", "");
drowMax["混合机卸料速度"] = dataTable.Compute("max(混合机卸料速度)", "");
drowMax["混料运行时间"] = dataTable.Compute("max(混料运行时间)", "");
//drowMax["系数"] = dataTable.Compute("max(系数)", "");
DataRow drowMin = dataTable.NewRow();
drowMin["记录时间"] = "最小值";
drowMin["罐A应配"] = dataTable.Compute("min(罐A应配)", "");
drowMin["罐A实配"] = dataTable.Compute("min(罐A实配)", "");
drowMin["罐B应配"] = dataTable.Compute("min(罐B应配)", "");
drowMin["罐B实配"] = dataTable.Compute("min(罐B实配)", "");
drowMin["树脂应配"] = dataTable.Compute("min(树脂应配)", "");
drowMin["树脂实配"] = dataTable.Compute("min(树脂实配)", "");
drowMin["罐A二次应配"] = dataTable.Compute("min(罐A二次应配)", "");
drowMin["罐A二次实配"] = dataTable.Compute("min(罐A二次实配)", "");
drowMin["罐B二次应配"] = dataTable.Compute("min(罐B二次应配)", "");
drowMin["罐B二次实配"] = dataTable.Compute("min(罐B二次实配)", "");
//drowMin["VCC及GFA卸料速度"] = dataTable.Compute("min(VCC及GFA卸料速度)", "");
drowMin["混料运行速度"] = dataTable.Compute("min(混料运行速度)", "");
drowMin["混合机卸料速度"] = dataTable.Compute("min(混合机卸料速度)", "");
drowMin["混料运行时间"] = dataTable.Compute("min(混料运行时间)", "");
//drowMin["系数"] = dataTable.Compute("min(系数)", "");
DataRow drowAvg = dataTable.NewRow();
drowAvg["记录时间"] = "平均值";
drowAvg["罐A应配"] = dataTable.Compute("avg(罐A应配)", "");
drowAvg["罐A实配"] = dataTable.Compute("avg(罐A实配)", "");
drowAvg["罐B应配"] = dataTable.Compute("avg(罐B应配)", "");
drowAvg["罐B实配"] = dataTable.Compute("avg(罐B实配)", "");
drowAvg["树脂应配"] = dataTable.Compute("avg(树脂应配)", "");
drowAvg["树脂实配"] = dataTable.Compute("avg(树脂实配)", "");
drowAvg["罐A二次应配"] = dataTable.Compute("avg(罐A二次应配)", "");
drowAvg["罐A二次实配"] = dataTable.Compute("avg(罐A二次实配)", "");
drowAvg["罐B二次应配"] = dataTable.Compute("avg(罐B二次应配)", "");
drowAvg["罐B二次实配"] = dataTable.Compute("avg(罐B二次实配)", "");
//drowAvg["VCC及GFA卸料速度"] = dataTable.Compute("avg(VCC及GFA卸料速度)", "");
drowAvg["混料运行速度"] = dataTable.Compute("avg(混料运行速度)", "");
drowAvg["混合机卸料速度"] = dataTable.Compute("avg(混合机卸料速度)", "");
drowAvg["混料运行时间"] = dataTable.Compute("avg(混料运行时间)", "");
//drowAvg["系数"] = dataTable.Compute("avg(系数)", "");
DataRow drowSum = dataTable.NewRow();
drowSum["记录时间"] = "合计";
drowSum["罐A应配"] = dataTable.Compute("sum([罐A应配])", "");
drowSum["罐A实配"] = dataTable.Compute("sum([罐A实配])", "");
drowSum["罐B应配"] = dataTable.Compute("sum([罐B应配])", "");
drowSum["罐B实配"] = dataTable.Compute("sum([罐B实配])", "");
drowSum["树脂应配"] = dataTable.Compute("sum([树脂应配])", "");
drowSum["树脂实配"] = dataTable.Compute("sum([树脂实配])", "");
drowSum["罐A二次应配"] = dataTable.Compute("sum([罐A二次应配])", "");
drowSum["罐A二次实配"] = dataTable.Compute("sum([罐A二次实配])", "");
drowSum["罐B二次应配"] = dataTable.Compute("sum([罐B二次应配])", "");
drowSum["罐B二次实配"] = dataTable.Compute("sum([罐B二次实配])", "");
//drowSum["VCC及GFA卸料速度"] = dataTable.Compute("sum([VCC及GFA卸料速度])", "");
drowSum["混料运行速度"] = dataTable.Compute("sum([混料运行速度])", "");
drowSum["混合机卸料速度"] = dataTable.Compute("sum(混合机卸料速度)", "");
drowSum["混料运行时间"] = dataTable.Compute("sum([混料运行时间])", "");
//drowSum["系数"] = dataTable.Compute("sum([系数])", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
catch (Exception ex)
{
throw;
}
}
private void DataTableAdd(int mNum)
{
//最大值行
DataRow drowMax = dataTable.NewRow();
drowMax["Weight_Time"] = "最大值";
for (int i = 0; i < mNum; i++)
{
drowMax["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("max(Set_Weight" + (i + 1).ToString() + ")", "");
drowMax["Set_Error" + (i + 1).ToString()] = dataTable.Compute("max(Set_Error" + (i + 1).ToString() + ")", "");
drowMax["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("max(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMax["SumSet_Weight"] = dataTable.Compute("max(SumSet_Weight)", "");
drowMax["SumSet_Error"] = dataTable.Compute("max(SumSet_Error)", "");
drowMax["SumWaste_Time"] = dataTable.Compute("max(SumWaste_Time)", "");
drowMax["CheckSet_Weight"] = dataTable.Compute("max(CheckSet_Weight)", "");
drowMax["CheckSet_Error"] = dataTable.Compute("max(CheckSet_Error)", "");
drowMax["CheckWaste_Time"] = dataTable.Compute("max(CheckWaste_Time)", "");
//最小值行
DataRow drowMin = dataTable.NewRow();
drowMin["Weight_Time"] = "最小值";
for (int i = 0; i < mNum; i++)
{
drowMin["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("min(Set_Weight" + (i + 1).ToString() + ")", "");
drowMin["Set_Error" + (i + 1).ToString()] = dataTable.Compute("min(Set_Error" + (i + 1).ToString() + ")", "");
drowMin["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("min(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMin["SumSet_Weight"] = dataTable.Compute("min(SumSet_Weight)", "");
drowMin["SumSet_Error"] = dataTable.Compute("min(SumSet_Error)", "");
drowMin["SumWaste_Time"] = dataTable.Compute("min(SumWaste_Time)", "");
drowMin["CheckSet_Weight"] = dataTable.Compute("min(CheckSet_Weight)", "");
drowMin["CheckSet_Error"] = dataTable.Compute("min(CheckSet_Error)", "");
drowMin["CheckWaste_Time"] = dataTable.Compute("min(CheckWaste_Time)", "");
//平均值行
DataRow drowAvg = dataTable.NewRow();
drowAvg["Weight_Time"] = "平均值";
for (int i = 0; i < mNum; i++)
{
drowAvg["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Weight" + (i + 1).ToString() + ")", "");
drowAvg["Set_Error" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Error" + (i + 1).ToString() + ")", "");
drowAvg["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("avg(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowAvg["SumSet_Weight"] = dataTable.Compute("avg(SumSet_Weight)", "");
drowAvg["SumSet_Error"] = dataTable.Compute("avg(SumSet_Error)", "");
drowAvg["SumWaste_Time"] = dataTable.Compute("avg(SumWaste_Time)", "");
drowAvg["CheckSet_Weight"] = dataTable.Compute("avg(CheckSet_Weight)", "");
drowAvg["CheckSet_Error"] = dataTable.Compute("avg(CheckSet_Error)", "");
drowAvg["CheckWaste_Time"] = dataTable.Compute("avg(CheckWaste_Time)", "");
//合计
DataRow drowSum = dataTable.NewRow();
drowSum["Weight_Time"] = "合计";
for (int i = 0; i < mNum; i++)
{
drowSum["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Weight" + (i + 1).ToString() + ")", "");
drowSum["Set_Error" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Error" + (i + 1).ToString() + ")", "");
drowSum["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("sum(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowSum["SumSet_Weight"] = dataTable.Compute("sum(SumSet_Weight)", "");
drowSum["SumSet_Error"] = dataTable.Compute("sum(SumSet_Error)", "");
drowSum["SumWaste_Time"] = dataTable.Compute("sum(SumWaste_Time)", "");
drowSum["CheckSet_Weight"] = dataTable.Compute("sum(CheckSet_Weight)", "");
drowSum["CheckSet_Error"] = dataTable.Compute("sum(CheckSet_Error)", "");
drowSum["CheckWaste_Time"] = dataTable.Compute("sum(CheckWaste_Time)", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
#endregion
#endregion
}
}

@ -2,7 +2,7 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Entity.Report;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
@ -47,7 +47,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}

@ -31,9 +31,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
}
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"select t1.objId,t1.reportId,t2.Name as eqNo,t1.recordTime
from Report_WetMixer t1
left join Device t2 on t1.eqNo = t2.Id
StringBuilder sbSql = new StringBuilder(@"select objId, WetNo, recordTime, reportId, recipeCode, recipeName, planCode, planName, reportTime, Batch from Report_WetMixer
where 1=1 ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
@ -42,7 +40,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
if (startdate != null && starttime != null)
{
//Append
sbSql.AppendLine(@"AND t1.recordTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' ");
sbSql.AppendLine(@"AND recordTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
@ -54,14 +52,14 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (enddate != null && endtime != null)
{
sbSql.AppendLine(@"AND t1.recordTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' ");
sbSql.AppendLine(@"AND recordTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectAction>.Debug("{湿混机报表-查询} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
sbSql.Append(" ORDER BY t1.recordTime desc");
sbSql.Append(" ORDER BY recordTime desc");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;

@ -1,5 +1,5 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Report.ProductionReport;
using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
@ -28,7 +28,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
DbMCControl _dgvWetMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_WetMixer").FirstOrDefault();
if (_dgvWetMixer == null || !(_dgvWetMixer.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少湿混机报表DataGridView控件...");
ICSharpCode.Core.LoggingService<SelectRowAction>.Warn("{生产报表} 缺少湿混机报表DataGridView控件...");
runtime.IsReturn = false;
return;
}
@ -39,7 +39,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
ICSharpCode.Core.LoggingService<SelectRowAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
@ -77,11 +77,14 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
dbHelper.ClearParameter();
//获取明细数据
StringBuilder sqlStr = new StringBuilder(@"select t2.Name as 设备编号,t1.mix as Mix,t1. mixBatch as 批次,t1.mixStep as 步号,t1.actCode as 动作,
StringBuilder sqlStr = new StringBuilder(@" select t1. mixBatch as 批次,t1.mixStep as 步号,t2.ActionName as 动作,
t1.mixTime as ,t1.mixTemp as ,t1.mixSpeed as ,t1.recordTime as
from Report_WetMixer_Detail t1
left join Device t2 on t1.eqNo = t2.Id
where t1.reportId = @reportId");
left join ActionCode t2 on t1.actCode =t2.Code
where t2.DeviceUnitId=3 and t1.reportId = @reportId
order by t1.actCode ");
dbHelper.CommandText = sqlStr.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
dbHelper.AddParameter("@reportId", lR_planID);

@ -1,6 +1,5 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Alarm.LRAlarmLog;
using Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;

@ -1,10 +1,17 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Report_DryMixer" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox3" children="Controls">
<Object type="Mesnac.Controls.Default.MultiColHeaderDgv, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MultiColHeaderDgv2" children="Controls">
<Property name="Dock">Fill</Property>
<Property name="Location">668, 22</Property>
<Property name="Name">MultiColHeaderDgv2</Property>
<Property name="Size">781, 331</Property>
</Object>
<Object type="Mesnac.Controls.Default.MultiColHeaderDgv, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MultiColHeaderDgv1" children="Controls">
<Property name="Dock">Left</Property>
<Property name="Location">3, 22</Property>
<Property name="Name">MultiColHeaderDgv1</Property>
<Property name="Size">1446, 331</Property>
<Property name="Size">665, 331</Property>
</Object>
<Property name="TabStop">False</Property>
<Property name="Text">报表明细</Property>

@ -20,7 +20,7 @@
<Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCDataGridView1" children="Controls">
<Property name="DisplayAllColumn">False</Property>
<Property name="DgvColumn">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAACgAAAO0AAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAACQkAAAAJCgAAAAkLAAAACQwAAAAJDQAAAA0GBQQAAAAoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAKX2ZpbGVkRGF0YQxfZGlzcGxheU5hbWUBAQIAAAAGDgAAAARlcU5vBg8AAAAG6K6+5aSHAQUAAAAEAAAABhAAAAADZG9zBhEAAAADRG9zAQYAAAAEAAAABhIAAAAFYmF0Y2gGEwAAAAnmibnmrKHlj7cBBwAAAAQAAAAGFAAAAAdtYXRDb2RlBhUAAAAM54mp5paZ5Luj56CBAQgAAAAEAAAABhYAAAAIc2V0VmFsdWUGFwAAAAzorr7lrprph43ph48BCQAAAAQAAAAGGAAAAAhzZXRUb2xlcgYZAAAADOiuvuWumuWFrOW3rgEKAAAABAAAAAYaAAAACGFjdFZhbHVlBhsAAAAM5a6e6ZmF6YeN6YePAQsAAAAEAAAABhwAAAAIYWN0VG9MZXIGHQAAAAzlrp7pmYXlhazlt64BDAAAAAQAAAAGHgAAAApyZWNvcmRUaW1lBh8AAAAM6K6w5b2V5pe26Ze0AQ0AAAAEAAAABiAAAAAIcmVwb3J0SWQGIQAAAAzmiqXooajnvJblj7cL</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAABAAAAPIAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAA0MBQQAAAAoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAKX2ZpbGVkRGF0YQxfZGlzcGxheU5hbWUBAQIAAAAGCAAAAApyZWNpcGVOYW1lBgkAAAAM6YWN5pa55ZCN56ewAQUAAAAEAAAABgoAAAAIcGxhbk5hbWUGCwAAAAzorqHliJLlkI3np7ABBgAAAAQAAAAGDAAAAApyZWNvcmRUaW1lBg0AAAAM5oql6KGo5pe26Ze0AQcAAAAEAAAABg4AAAAFV2V0Tm8GDwAAAAbmnLrlj7AL</Binary>
</Property>
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

@ -1,11 +1,17 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="糊化机报表" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox3" children="Controls">
<Object type="Mesnac.Controls.Default.MultiColHeaderDgv, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MultiColHeaderDgv1" children="Controls">
<Object type="Mesnac.Controls.Default.MultiColHeaderDgv, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MultiColHeaderDgv2" children="Controls">
<Property name="Dock">Fill</Property>
<Property name="Location">480, 22</Property>
<Property name="Name">MultiColHeaderDgv2</Property>
<Property name="Size">704, 352</Property>
</Object>
<Object type="Mesnac.Controls.Default.MultiColHeaderDgv, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MultiColHeaderDgv1" children="Controls">
<Property name="Dock">Left</Property>
<Property name="Location">3, 22</Property>
<Property name="Name">MultiColHeaderDgv1</Property>
<Property name="Size">1181, 352</Property>
<Property name="Size">477, 352</Property>
</Object>
<Property name="TabStop">False</Property>
<Property name="Text">报表明细</Property>
@ -20,7 +26,7 @@
<Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCDataGridView1" children="Controls">
<Property name="DisplayAllColumn">False</Property>
<Property name="DgvColumn">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAACgAAAO0AAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAACQkAAAAJCgAAAAkLAAAACQwAAAAJDQAAAA0GBQQAAAAoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAKX2ZpbGVkRGF0YQxfZGlzcGxheU5hbWUBAQIAAAAGDgAAAARlcU5vBg8AAAAG6K6+5aSHAQUAAAAEAAAABhAAAAADZG9zBhEAAAADRG9zAQYAAAAEAAAABhIAAAAFYmF0Y2gGEwAAAAnmibnmrKHlj7cBBwAAAAQAAAAGFAAAAAdtYXRDb2RlBhUAAAAM54mp5paZ5Luj56CBAQgAAAAEAAAABhYAAAAIc2V0VmFsdWUGFwAAAAzorr7lrprph43ph48BCQAAAAQAAAAGGAAAAAhzZXRUb2xlcgYZAAAADOiuvuWumuWFrOW3rgEKAAAABAAAAAYaAAAACGFjdFZhbHVlBhsAAAAM5a6e6ZmF6YeN6YePAQsAAAAEAAAABhwAAAAIYWN0VG9MZXIGHQAAAAzlrp7pmYXlhazlt64BDAAAAAQAAAAGHgAAAApyZWNvcmRUaW1lBh8AAAAM6K6w5b2V5pe26Ze0AQ0AAAAEAAAABiAAAAAIcmVwb3J0SWQGIQAAAAzmiqXooajnvJblj7cL</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAABAAAAAABAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAA0MBQQAAAAoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAKX2ZpbGVkRGF0YQxfZGlzcGxheU5hbWUBAQIAAAAGCAAAAApyZWNpcGVOYW1lBgkAAAAM6YWN5pa55ZCN56ewAQUAAAAEAAAABgoAAAAIcGxhbk5hbWUGCwAAAAzorqHliJLlkI3np7ABBgAAAAQAAAAGDAAAAApyZWNvcmRUaW1lBg0AAAAM5oql6KGo5pe26Ze0AQcAAAAEAAAABg4AAAAFV2V0Tm8GDwAAAAbmnLrlj7AL</Binary>
</Property>
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

Loading…
Cancel
Save