优化报表

dep
我叫锄头 11 months ago
parent 1e0a307371
commit 7b2a0785ae

@ -80,7 +80,32 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
runtime.IsReturn = false;
return;
}
_dgvDryMixer.BaseControl.BindDataSource = table;
var newTalbe = GetDefalut();
foreach (DataRow row in table.Rows)
{
var dr = newTalbe.NewRow();
dr["dryNo"] = row["dryNo"];
dr["Batch"] = row["Batch"];
dr["reportId"] = row["reportId"];
dr["recordTime"] = row["recordTime"].ToString();
newTalbe.Rows.Add(dr);
}
_dgvDryMixer.BaseControl.BindDataSource = newTalbe;
}
public DataTable GetDefalut()
{
DataTable dt = new DataTable();
dt.Columns.Add("dryNo", typeof(string));
dt.Columns.Add("Batch", typeof(string));
dt.Columns.Add("recordTime", typeof(string));
dt.Columns.Add("reportId", typeof(string));
return dt;
}
}
}

@ -102,20 +102,91 @@ namespace Mesnac.Action.ChemicalWeighing.Report.DryMixer
dbHelper.AddParameter("@reportId", lR_planID);
DataTable table = dbHelper.ToDataTable();
foreach (DataRow row in table.Rows)
{
row["实际重量"]= Convert.ToSingle(row["实际重量"]).ToString("#0.00");
row["实际公差"] = Convert.ToSingle(row["实际公差"]).ToString("#0.00");
}
clientGrid.DataSource = table;
dbHelper.ClearParameter();
string sql = $"select t1.mixBatch as 批次,t1.mixStep as 步号,t2.ActionName as 动作,t1.mixTime as 时间,t1.mixTemp as 温度,t1.mixSpeed as 速度 from Report_DryMixer_Detail t1\r\nleft join ActionCode t2 on t2.Code=t1.actCode\r\nwhere t2.DeviceUnitId=1 and t1.reportId='{lR_planID}' order by actCode";
string sql = $"select t1.actCode, t1.mixBatch as 批次,t1.mixStep as 步号," +
$"t2.ActionName as 动作,t1.mixTime as 时间,t1.mixTemp as 温度," +
$"t1.mixSpeed as 速度 from Report_DryMixer_Detail t1\r\nleft join ActionCode t2 on t2.Code=t1.actCode\r\nwhere t2.DeviceUnitId=1 and t1.reportId='{lR_planID}' order by actCode";
dbHelper.CommandText = sql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable tableB = dbHelper.ToDataTable();
DataTable newTable = GetDefault();
foreach (DataRow row in tableB.Rows)
{
var dr= newTable.NewRow();
dr["批次"] = row["批次"];
dr["步号"] = row["步号"];
dr["动作"] = DryStepConvert(Convert.ToInt32(row["actCode"]));
dr["时间"] = ConverToTime(Convert.ToInt32(row["时间"]));
dr["速度"] = row["速度"];
dr["记录时间"] = row["记录时间"];
dr["速度"] = Convert.ToSingle(row["速度"]).ToString("#0.00");
newTable.Rows.Add(dr);
}
clientGrid2.DataSource = newTable;
}
}
string ConverToTime(int duration)
{
TimeSpan ts = new TimeSpan(0, 0, Convert.ToInt32(duration));
string str = "";
if (ts.Hours > 0)
{
str = ts.Hours.ToString() + "小时 " + ts.Minutes.ToString() + "分钟 " + ts.Seconds + "秒";
}
if (ts.Hours == 0 && ts.Minutes > 0)
{
str = ts.Minutes.ToString() + "分钟 " + ts.Seconds + "秒";
}
if (ts.Hours == 0 && ts.Minutes == 0)
{
str = ts.Seconds + "秒";
}
return str;
}
clientGrid2.DataSource = tableB;
private DataTable GetDefault()
{
var tableNewB = new DataTable();
tableNewB.Columns.Add("批次", typeof(string));
tableNewB.Columns.Add("步号", typeof(string));
tableNewB.Columns.Add("动作", typeof(string));
tableNewB.Columns.Add("时间", typeof(string));
//tableNewB.Columns.Add("温度", typeof(string));
tableNewB.Columns.Add("速度", typeof(string));
tableNewB.Columns.Add("记录时间", typeof(string));
return tableNewB;
}
private string DryStepConvert(int code)
{
switch (code)
{
case 1: return "加粉料";
case 4: return "搅拌";
case 6: return "等待排料";
default: return "无";
}
}
}
}

@ -82,7 +82,19 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
runtime.IsReturn = false;
return;
}
_dgvGelDoser.BaseControl.BindDataSource = table;
var newTalbe = GetDefalut();
foreach (DataRow row in table.Rows)
{
var dr = newTalbe.NewRow();
dr["gelNo"] = row["gelNo"];
dr["Batch"] = row["Batch"];
dr["reportId"] = row["reportId"];
dr["recordTime"] = row["recordTime"].ToString();
newTalbe.Rows.Add(dr);
}
_dgvGelDoser.BaseControl.BindDataSource = newTalbe;
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid2 =
(GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv2")).FirstOrDefault() as Mesnac.Controls.Default.MultiColHeaderDgv);
@ -91,5 +103,17 @@ namespace Mesnac.Action.ChemicalWeighing.Report.GelDoser
var clientGrid1= GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv1")).FirstOrDefault() as Mesnac.Controls.Default.MultiColHeaderDgv;
clientGrid1.DataSource = null;
}
public DataTable GetDefalut()
{
DataTable dt = new DataTable();
dt.Columns.Add("gelNo", typeof(string));
dt.Columns.Add("Batch", typeof(string));
dt.Columns.Add("recordTime", typeof(string));
dt.Columns.Add("reportId", typeof(string));
return dt;
}
}
}

@ -80,7 +80,34 @@ namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer
runtime.IsReturn = false;
return;
}
_dgvWetMixer.BaseControl.BindDataSource = table;
var newTalbe = GetDefalut();
foreach (DataRow row in table.Rows)
{
var dr = newTalbe.NewRow();
dr["WetNo"] = row["WetNo"];
dr["Batch"] = row["Batch"];
dr["reportId"] = row["reportId"];
dr["recordTime"] = row["recordTime"].ToString();
newTalbe.Rows.Add(dr);
}
_dgvWetMixer.BaseControl.BindDataSource = newTalbe;
}
public DataTable GetDefalut()
{
DataTable dt = new DataTable();
dt.Columns.Add("WetNo", typeof(string));
dt.Columns.Add("Batch", typeof(string));
dt.Columns.Add("recordTime", typeof(string));
dt.Columns.Add("reportId", typeof(string));
return dt;
}
}
}

@ -26,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/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ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,7 +83,9 @@
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="BindDataSource">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuRGVmYXVsdC5Db21ib2JveEl0ZW1zLCBNZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAJ01lc25hYy5Db250cm9scy5EZWZhdWx0LkNvbWJvYm94SXRlbXNbXQIAAAAICAkDAAAAAAAAAAAAAAAHAwAAAAABAAAAAAAAAAQlTWVzbmFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL</Binary>
</Property>
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
@ -123,7 +125,7 @@
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCVisible">False</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">True</Property>
<Property name="Format" />

@ -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/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lv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B1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAAAwAAAAIBAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAANDQUEAAAAKE1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnMCAAAACl9maWxlZERhdGEMX2Rpc3BsYXlOYW1lAQECAAAABgcAAAAFV2V0Tm8GCAAAAAbmnLrlj7ABBQAAAAQAAAAGCQAAAAVCYXRjaAYKAAAABuaJueasoQEGAAAABAAAAAYLAAAACnJlY29yZFRpbWUGDAAAAAzmiqXooajml7bpl7QL</Binary>
</Property>
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
@ -77,7 +77,9 @@
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="BindDataSource">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAE5NZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuRGVmYXVsdC5Db21ib2JveEl0ZW1zLCBNZXNuYWMuQ29udHJvbHMuRGVmYXVsdCwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAJ01lc25hYy5Db250cm9scy5EZWZhdWx0LkNvbWJvYm94SXRlbXNbXQIAAAAICAkDAAAAAAAAAAAAAAAHAwAAAAABAAAAAAAAAAQlTWVzbmFjLkNvbnRyb2xzLkRlZmF1bHQuQ29tYm9ib3hJdGVtcwIAAAAL</Binary>
</Property>
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>

Loading…
Cancel
Save