|
|
@ -165,12 +165,14 @@ t1.actValue as 实际重量,t1.actToler as 实际公差
|
|
|
|
$" left join ActionCode t2 on t1.actCode =t2.Code\r\n\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 " +
|
|
|
|
$" where t2.DeviceUnitId=2 and t1.reportId ='{lR_planID}'\r\n\r\n " +
|
|
|
|
$"" +
|
|
|
|
$"" +
|
|
|
|
$" order by t1.actCode";
|
|
|
|
$" order by t1.mixStep";
|
|
|
|
|
|
|
|
|
|
|
|
dbHelper.CommandText = sql.ToString();
|
|
|
|
dbHelper.CommandText = sql.ToString();
|
|
|
|
dbHelper.CommandType = System.Data.CommandType.Text;
|
|
|
|
dbHelper.CommandType = System.Data.CommandType.Text;
|
|
|
|
DataTable table2 = dbHelper.ToDataTable();
|
|
|
|
DataTable table2 = dbHelper.ToDataTable();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<int, int> dic = new Dictionary<int, int>();
|
|
|
|
|
|
|
|
Dictionary<int, DateTime> Newdic = new Dictionary<int, DateTime>();
|
|
|
|
|
|
|
|
|
|
|
|
var tableNewB=new DataTable();
|
|
|
|
var tableNewB=new DataTable();
|
|
|
|
tableNewB.Columns.Add("批次", typeof(string));
|
|
|
|
tableNewB.Columns.Add("批次", typeof(string));
|
|
|
@ -180,6 +182,7 @@ t1.actValue as 实际重量,t1.actToler as 实际公差
|
|
|
|
//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));
|
|
|
|
|
|
|
|
var dateNow = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (System.Data.DataRow row in table2.Rows)
|
|
|
|
foreach (System.Data.DataRow row in table2.Rows)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -194,10 +197,38 @@ t1.actValue as 实际重量,t1.actToler as 实际公差
|
|
|
|
dr["时间"] = ConverToTime(Convert.ToInt32(row["时间"]));
|
|
|
|
dr["时间"] = ConverToTime(Convert.ToInt32(row["时间"]));
|
|
|
|
//dr["温度"] = row["温度"];
|
|
|
|
//dr["温度"] = row["温度"];
|
|
|
|
dr["速度"] = row["速度"];
|
|
|
|
dr["速度"] = row["速度"];
|
|
|
|
dr["记录时间"] = row["记录时间"];
|
|
|
|
dateNow = Convert.ToDateTime(row["记录时间"].ToString());
|
|
|
|
tableNewB.Rows.Add(dr);
|
|
|
|
tableNewB.Rows.Add(dr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dic.Add(Convert.ToInt32(dr["步号"]), Convert.ToInt32(row["时间"]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i < 8; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var miao = dic.Where(x => x.Key >= i).Select(x => x.Value).Sum();
|
|
|
|
|
|
|
|
Newdic.Add(i, dateNow.AddSeconds(-miao));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (System.Data.DataRow row in tableNewB.Rows)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var bu = Convert.ToInt32(row["步号"]);
|
|
|
|
|
|
|
|
if(Newdic.ContainsKey(bu))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var dt = Newdic[bu];
|
|
|
|
|
|
|
|
row["记录时间"] = dt.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clientGrid2.DataSource = null;
|
|
|
|
clientGrid2.DataSource = null;
|
|
|
|
clientGrid2.DataSource = tableNewB;
|
|
|
|
clientGrid2.DataSource = tableNewB;
|
|
|
|
|
|
|
|
|
|
|
|