diff --git a/AddMaterial/App_Code/Function.cs b/AddMaterial/App_Code/Function.cs index 24953c4..bba0ab1 100644 --- a/AddMaterial/App_Code/Function.cs +++ b/AddMaterial/App_Code/Function.cs @@ -22,7 +22,7 @@ public class Function try { string sql = @" - select a.CylinderNo, d.StationNo, b.BarCode, b.Time1 + select a.CylinderNo, d.StationNo, b.BarCode, b.Time1,b.Flag from tb_Cylinder a left join tb_CylinderAndRaw b on a.CylinderID = b.CylinderID and b.Time2 is null @@ -60,6 +60,7 @@ public class Function model.Station = dt1.Rows[i]["StationNo"].ToString(); model.BatchNo = batchNo; model.Time1 = dt1.Rows[i]["Time1"].ToString(); + model.Flag = dt1.Rows[i]["Flag"].ToString(); if (dt2 != null && dt2.Rows.Count > 0) { model.MaterialName = dt2.Rows[0]["ProductName"].ToString(); @@ -71,6 +72,7 @@ public class Function { model.ProductName = dt_product.Rows[0]["Plan"].ToString(); } + model.PartNo = partNo.Trim(); list.Add(model); } @@ -86,6 +88,33 @@ public class Function } } + public static string GetLastMaterialCode(string drumBarCode) + { + try + { + string sql = @"select top 2 * from tb_CylinderAndRaw where DrumBarCode='" + drumBarCode + "' order by time1 desc"; + + DataTable res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); + if (res.Rows.Count == 2) + { + string stockNo = ""; + string batchNo = ""; + string partNo = ""; + GetCode(res.Rows[1]["BarCode"].ToString(), out stockNo, out batchNo, out partNo); + return partNo; + } + else + { + return DateTime.Now.ToString(); + } + } + catch + { + return DateTime.Now.ToString(); ; + } + + } + /// /// 根据注塑机查询计划要生产的产品信息 /// @@ -524,40 +553,40 @@ public class Function SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%槛%') c2,08 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%槛%') c2,09 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 08:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%槛%') c2,09 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%槛%') c2,10 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 09:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%槛%') c2,10 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%槛%') c2,11 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 10:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%槛%' ) c2,11 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%槛%' ) c2,12 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 11:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%槛%' ) c2,12 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%槛%' ) c2,13 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 12:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%槛%' ) c2,13 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%槛%' ) c2,14 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 13:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%槛%') c2,14 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%槛%') c2,15 AS h FROM #a WHERE ([createTime]BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 14:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%槛%') c2,15 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%槛%') c2,16 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 15:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%槛%') c2,16 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%槛%') c2,17 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 16:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%槛%') c2,17 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%槛%') c2,18 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 17:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%槛%' ) c2,18 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%槛%' ) c2,19 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 18:59:59.999')) AND productInfo LIKE '%保%' UNION ALL SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%槛%') c2,19 AS h + (SELECT COUNT(*) FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%槛%') c2,20 AS h FROM #a WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:59:59.999')) AND productInfo LIKE '%保%' ORDER BY h asc "; @@ -579,40 +608,40 @@ public class Function SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%槛%') c2,20 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%槛%') c2,21 AS h FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%槛%') c2,21 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%槛%') c2,22 AS h FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%槛%') c2,22 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%槛%') c2,23 AS h FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%槛%' ) c2,23 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%槛%' ) c2,00 AS h FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%槛%') c2,00 AS h - FROM #b WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%保%' + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%槛%') c2,01 AS h + FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,01 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,02 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,02 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,03 AS h FROM #b WHERE ([createTime]BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,03 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,04 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,04 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,05 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%槛%') c2,05 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%槛%') c2,06 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,06 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,07 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,07 AS h + (SELECT COUNT(*) FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%槛%' ) c2,08 AS h FROM #b WHERE ([createTime] BETWEEN DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000')) AND DATEADD(DAY,1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999'))) AND productInfo LIKE '%保%' "; } @@ -631,40 +660,40 @@ public class Function SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%槛%') c2,20 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%槛%') c2,21 AS h FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 20:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%槛%') c2,21 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%槛%') c2,22 AS h FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 21:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%槛%') c2,22 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%槛%') c2,23 AS h FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 22:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%槛%') c2,23 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%槛%') c2,00 AS h FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:00:00.000')) AND DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59.999'))) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%槛%') c2,00 AS h - FROM #c WHERE ([createTime] BETWEEN DATEADD(DAY,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%保%' + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%槛%') c2,01 AS h + FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 00:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%槛%') c2,01 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%槛%') c2,02 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 01:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%槛%') c2,02 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%槛%') c2,03 AS h FROM #c WHERE ([createTime]BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 02:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%槛%' ) c2,03 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%槛%' ) c2,04 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 03:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%槛%') c2,04 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%槛%') c2,05 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 04:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%槛%') c2,05 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%槛%') c2,06 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 05:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%槛%') c2,06 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%槛%') c2,07 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 06:59:59.999')) AND productInfo LIKE '%保%' UNION all SELECT COUNT(*) AS c1 , - (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%槛%') c2,07 AS h + (SELECT COUNT(*) FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%槛%') c2,08 AS h FROM #c WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:00:00.000') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:59:59.999')) AND productInfo LIKE '%保%' "; } @@ -737,4 +766,46 @@ public class Function return false; } } + + /// + /// 计算时间差 + /// + /// 时间1 + /// 时间2 + /// 返回值:时间差(毫秒为单位) + public static long TimeDiff(DateTime t, DateTime t2) + { + long lReturn = -1; + System.TimeSpan NowValue = new TimeSpan(t.Ticks); + System.TimeSpan TimeValue = new TimeSpan(t2.Ticks); + System.TimeSpan DateDiff = TimeSpan.Zero; + try + { + //计算时间差 + //DateDiff = TimeValue.Subtract(NowValue).Duration(); + DateDiff = TimeValue.Subtract(NowValue); + int hours = DateDiff.Hours; + int minutes = DateDiff.Minutes; + int seconds = DateDiff.Seconds; + int milliseconds = DateDiff.Milliseconds; + + string TimeDiff = hours.ToString() + ":" + + minutes.ToString() + ":" + + seconds.ToString() + "." + + milliseconds.ToString(); + //是否比现在的时间小,如果小就设置成第二天再启动,否则当天启动 + if (hours <= 0 && minutes <= 0 && seconds <= 0 && milliseconds <= 0) + hours += 24; + + lReturn = hours * 3600 + + minutes * 60 + + seconds; + } + catch (Exception ex) + { + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + return 0; + } + return lReturn; + } } \ No newline at end of file diff --git a/AddMaterial/App_Code/Model.cs b/AddMaterial/App_Code/Model.cs index 6056418..22b88e2 100644 --- a/AddMaterial/App_Code/Model.cs +++ b/AddMaterial/App_Code/Model.cs @@ -32,6 +32,11 @@ public class Model /// 加料时间 /// public string Time1 { get; set; } + /// + /// 首次加料还是续料 + /// + public string Flag { get; set; } + public string PartNo { get; set; } } public class PlanModel diff --git a/AddMaterial/Default.html b/AddMaterial/Default.html index 1bf6402..ad31016 100644 --- a/AddMaterial/Default.html +++ b/AddMaterial/Default.html @@ -1,27 +1,27 @@  - + 注塑车间塑料粒子加料目视看板 diff --git a/FiveScreen/FrmCenter.Designer.cs b/FiveScreen/FrmCenter.Designer.cs index ef73aa7..7a7a2bd 100644 --- a/FiveScreen/FrmCenter.Designer.cs +++ b/FiveScreen/FrmCenter.Designer.cs @@ -37,23 +37,24 @@ // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; - this.webBrowser1.Location = new System.Drawing.Point(0, 86); + this.webBrowser1.Location = new System.Drawing.Point(0, 129); this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScrollBarsEnabled = false; - this.webBrowser1.Size = new System.Drawing.Size(1904, 978); + this.webBrowser1.Size = new System.Drawing.Size(2856, 1467); this.webBrowser1.TabIndex = 3; this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/PaintingResultScreen2.html"; - this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/PaintingResultScreen2.html", System.UriKind.Absolute); + this.webBrowser1.Url = new System.Uri("http://localhost:84/Manage/PaintingResultScreen2.html", System.UriKind.Absolute); // // panel1 // this.panel1.BackColor = System.Drawing.Color.Transparent; this.panel1.ForeColor = System.Drawing.Color.Transparent; - this.panel1.Location = new System.Drawing.Point(1231, 2); + this.panel1.Location = new System.Drawing.Point(1846, 3); + this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(665, 59); + this.panel1.Size = new System.Drawing.Size(998, 88); this.panel1.TabIndex = 4; this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); // @@ -65,27 +66,27 @@ this.tableLayoutPanel1.Controls.Add(this.webBrowser1, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 86F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 129F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1904, 1064); + this.tableLayoutPanel1.Size = new System.Drawing.Size(2856, 1596); this.tableLayoutPanel1.TabIndex = 5; this.tableLayoutPanel1.DoubleClick += new System.EventHandler(this.tableLayoutPanel1_DoubleClick); // // FrmCenter // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlText; this.BackgroundImage = global::FiveScreen.Properties.Resources.底图; - this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ClientSize = new System.Drawing.Size(3808, 2128); this.ControlBox = false; this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.panel1); this.ImeMode = System.Windows.Forms.ImeMode.Off; - this.MinimumSize = new System.Drawing.Size(16, 16); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MinimumSize = new System.Drawing.Size(22, 22); this.Name = "FrmCenter"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.TransparencyKey = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); diff --git a/FiveScreen/FrmInjection1.Designer.cs b/FiveScreen/FrmInjection1.Designer.cs index c9eb466..fb1d1c4 100644 --- a/FiveScreen/FrmInjection1.Designer.cs +++ b/FiveScreen/FrmInjection1.Designer.cs @@ -49,7 +49,7 @@ this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(2856, 1410); this.panel1.TabIndex = 0; @@ -67,7 +67,8 @@ this.webBrowser4.ScrollBarsEnabled = false; this.webBrowser4.Size = new System.Drawing.Size(1896, 447); this.webBrowser4.TabIndex = 5; - this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-4.html", System.UriKind.Absolute); + this.webBrowser4.Tag = "http://10.60.101.10:8005/Manage/HtmlFiveInjection1-4.html"; + this.webBrowser4.Url = new System.Uri("http://localhost:84/Manage/HtmlFiveInjection1-4.html", System.UriKind.Absolute); // // webBrowser3 // @@ -81,7 +82,8 @@ this.webBrowser3.ScrollBarsEnabled = false; this.webBrowser3.Size = new System.Drawing.Size(982, 447); this.webBrowser3.TabIndex = 4; - this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-3.html", System.UriKind.Absolute); + this.webBrowser3.Tag = "http://10.60.101.10:8005/Manage/HtmlFiveInjection1-3.html"; + this.webBrowser3.Url = new System.Uri("http://localhost:84/Manage/HtmlFiveInjection1-3.html", System.UriKind.Absolute); // // webBrowser2 // @@ -95,7 +97,8 @@ this.webBrowser2.ScrollBarsEnabled = false; this.webBrowser2.Size = new System.Drawing.Size(1896, 417); this.webBrowser2.TabIndex = 3; - this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-2.html", System.UriKind.Absolute); + this.webBrowser2.Tag = "http://10.60.101.10:8005/Manage/HtmlFiveInjection1-2.html"; + this.webBrowser2.Url = new System.Uri("http://localhost:84/Manage/HtmlFiveInjection1-2.html", System.UriKind.Absolute); // // webBrowser1 // @@ -109,7 +112,8 @@ this.webBrowser1.ScrollBarsEnabled = false; this.webBrowser1.Size = new System.Drawing.Size(982, 417); this.webBrowser1.TabIndex = 2; - this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFiveInjection1-1.html", System.UriKind.Absolute); + this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/HtmlFiveInjection1-1.html"; + this.webBrowser1.Url = new System.Uri("http://localhost:84/Manage/HtmlFiveInjection1-1.html", System.UriKind.Absolute); // // label2 // @@ -148,7 +152,7 @@ this.ClientSize = new System.Drawing.Size(2856, 1410); this.ControlBox = false; this.Controls.Add(this.panel1); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FrmInjection1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Tag = "喷涂合格率"; diff --git a/FiveScreen/FrmPainting1.Designer.cs b/FiveScreen/FrmPainting1.Designer.cs index d3da5e2..a4f3081 100644 --- a/FiveScreen/FrmPainting1.Designer.cs +++ b/FiveScreen/FrmPainting1.Designer.cs @@ -49,8 +49,9 @@ this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.Size = new System.Drawing.Size(2856, 1596); this.panel1.TabIndex = 0; this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); // @@ -59,56 +60,60 @@ this.webBrowser4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser4.Location = new System.Drawing.Point(640, 642); + this.webBrowser4.Location = new System.Drawing.Point(960, 963); this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser4.Name = "webBrowser4"; this.webBrowser4.ScrollBarsEnabled = false; - this.webBrowser4.Size = new System.Drawing.Size(1264, 422); + this.webBrowser4.Size = new System.Drawing.Size(1896, 633); this.webBrowser4.TabIndex = 5; - this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-4.html", System.UriKind.Absolute); + this.webBrowser4.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting1-4.html"; + this.webBrowser4.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting1-4.html", System.UriKind.Absolute); // // webBrowser3 // this.webBrowser3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Location = new System.Drawing.Point(2, 963); this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser3.Name = "webBrowser3"; this.webBrowser3.ScrollBarsEnabled = false; - this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.Size = new System.Drawing.Size(982, 633); this.webBrowser3.TabIndex = 4; - this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-3.html", System.UriKind.Absolute); + this.webBrowser3.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting1-3.html"; + this.webBrowser3.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting1-3.html", System.UriKind.Absolute); // // webBrowser2 // this.webBrowser2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Location = new System.Drawing.Point(962, 234); this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser2.Name = "webBrowser2"; this.webBrowser2.ScrollBarsEnabled = false; - this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.Size = new System.Drawing.Size(1896, 603); this.webBrowser2.TabIndex = 3; - this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-2.html", System.UriKind.Absolute); + this.webBrowser2.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting1-2.html"; + this.webBrowser2.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting1-2.html", System.UriKind.Absolute); // // webBrowser1 // this.webBrowser1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Location = new System.Drawing.Point(2, 234); this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScrollBarsEnabled = false; - this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.Size = new System.Drawing.Size(982, 603); this.webBrowser1.TabIndex = 2; - this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting1-1.html", System.UriKind.Absolute); + this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting1-1.html"; + this.webBrowser1.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting1-1.html", System.UriKind.Absolute); // // label2 // @@ -117,9 +122,10 @@ this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Location = new System.Drawing.Point(-8, 864); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.Size = new System.Drawing.Size(2848, 69); this.label2.TabIndex = 1; this.label2.Text = "喷涂总合格率"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -131,20 +137,22 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Location = new System.Drawing.Point(-8, 140); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.Size = new System.Drawing.Size(2848, 69); this.label1.TabIndex = 0; this.label1.Text = "喷涂一次合格率"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // FrmPainting1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ClientSize = new System.Drawing.Size(2856, 1596); this.ControlBox = false; this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FrmPainting1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Tag = "喷涂合格率"; diff --git a/FiveScreen/FrmPainting2.Designer.cs b/FiveScreen/FrmPainting2.Designer.cs index 572514b..7d99716 100644 --- a/FiveScreen/FrmPainting2.Designer.cs +++ b/FiveScreen/FrmPainting2.Designer.cs @@ -49,8 +49,9 @@ this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.Size = new System.Drawing.Size(2856, 1596); this.panel1.TabIndex = 0; this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); // @@ -59,60 +60,60 @@ this.webBrowser4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser4.Location = new System.Drawing.Point(640, 642); + this.webBrowser4.Location = new System.Drawing.Point(960, 963); this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser4.Name = "webBrowser4"; this.webBrowser4.ScrollBarsEnabled = false; - this.webBrowser4.Size = new System.Drawing.Size(1264, 422); + this.webBrowser4.Size = new System.Drawing.Size(1896, 633); this.webBrowser4.TabIndex = 5; this.webBrowser4.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-4.html"; - this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-4.html", System.UriKind.Absolute); + this.webBrowser4.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting2-4.html", System.UriKind.Absolute); // // webBrowser3 // this.webBrowser3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Location = new System.Drawing.Point(2, 963); this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser3.Name = "webBrowser3"; this.webBrowser3.ScrollBarsEnabled = false; - this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.Size = new System.Drawing.Size(982, 633); this.webBrowser3.TabIndex = 4; this.webBrowser3.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-3.html"; - this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-3.html", System.UriKind.Absolute); + this.webBrowser3.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting2-3.html", System.UriKind.Absolute); // // webBrowser2 // this.webBrowser2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Location = new System.Drawing.Point(962, 234); this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser2.Name = "webBrowser2"; this.webBrowser2.ScrollBarsEnabled = false; - this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.Size = new System.Drawing.Size(1896, 603); this.webBrowser2.TabIndex = 3; this.webBrowser2.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-2.html"; - this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-2.html", System.UriKind.Absolute); + this.webBrowser2.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting2-2.html", System.UriKind.Absolute); // // webBrowser1 // this.webBrowser1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Location = new System.Drawing.Point(2, 234); this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScrollBarsEnabled = false; - this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.Size = new System.Drawing.Size(982, 603); this.webBrowser1.TabIndex = 2; this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting2-1.html"; - this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting2-1.html", System.UriKind.Absolute); + this.webBrowser1.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting2-1.html", System.UriKind.Absolute); // // label2 // @@ -121,9 +122,10 @@ this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Location = new System.Drawing.Point(-8, 864); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.Size = new System.Drawing.Size(2848, 69); this.label2.TabIndex = 1; this.label2.Text = "运行滑撬数"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -135,20 +137,22 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Location = new System.Drawing.Point(-8, 140); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.Size = new System.Drawing.Size(2848, 69); this.label1.TabIndex = 0; this.label1.Text = "喷涂设备利用率"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // FrmPainting2 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ClientSize = new System.Drawing.Size(2856, 1596); this.ControlBox = false; this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "FrmPainting2"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Tag = "喷涂合格率"; diff --git a/FiveScreen/FrmPainting3.Designer.cs b/FiveScreen/FrmPainting3.Designer.cs index d5bf7bc..9adedbf 100644 --- a/FiveScreen/FrmPainting3.Designer.cs +++ b/FiveScreen/FrmPainting3.Designer.cs @@ -49,8 +49,9 @@ this.panel1.Controls.Add(this.label1); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1904, 1064); + this.panel1.Size = new System.Drawing.Size(2856, 1596); this.panel1.TabIndex = 0; this.panel1.DoubleClick += new System.EventHandler(this.panel1_DoubleClick); // @@ -59,56 +60,60 @@ this.webBrowser4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser4.Location = new System.Drawing.Point(641, 642); + this.webBrowser4.Location = new System.Drawing.Point(962, 963); this.webBrowser4.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser4.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser4.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser4.Name = "webBrowser4"; this.webBrowser4.ScrollBarsEnabled = false; - this.webBrowser4.Size = new System.Drawing.Size(1263, 422); + this.webBrowser4.Size = new System.Drawing.Size(1894, 633); this.webBrowser4.TabIndex = 5; - this.webBrowser4.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-4.html", System.UriKind.Absolute); + this.webBrowser4.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting3-4.html"; + this.webBrowser4.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting3-4.html", System.UriKind.Absolute); // // webBrowser3 // this.webBrowser3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser3.Location = new System.Drawing.Point(1, 642); + this.webBrowser3.Location = new System.Drawing.Point(2, 963); this.webBrowser3.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser3.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser3.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser3.Name = "webBrowser3"; this.webBrowser3.ScrollBarsEnabled = false; - this.webBrowser3.Size = new System.Drawing.Size(655, 422); + this.webBrowser3.Size = new System.Drawing.Size(982, 633); this.webBrowser3.TabIndex = 4; - this.webBrowser3.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-3.html", System.UriKind.Absolute); + this.webBrowser3.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting3-3.html"; + this.webBrowser3.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting3-3.html", System.UriKind.Absolute); // // webBrowser2 // this.webBrowser2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser2.Location = new System.Drawing.Point(641, 156); + this.webBrowser2.Location = new System.Drawing.Point(962, 234); this.webBrowser2.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser2.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser2.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser2.Name = "webBrowser2"; this.webBrowser2.ScrollBarsEnabled = false; - this.webBrowser2.Size = new System.Drawing.Size(1264, 402); + this.webBrowser2.Size = new System.Drawing.Size(1896, 603); this.webBrowser2.TabIndex = 3; - this.webBrowser2.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-2.html", System.UriKind.Absolute); + this.webBrowser2.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting3-2.html"; + this.webBrowser2.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting3-2.html", System.UriKind.Absolute); // // webBrowser1 // this.webBrowser1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.webBrowser1.Location = new System.Drawing.Point(1, 156); + this.webBrowser1.Location = new System.Drawing.Point(2, 234); this.webBrowser1.Margin = new System.Windows.Forms.Padding(0); - this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.MinimumSize = new System.Drawing.Size(30, 30); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScrollBarsEnabled = false; - this.webBrowser1.Size = new System.Drawing.Size(655, 402); + this.webBrowser1.Size = new System.Drawing.Size(982, 603); this.webBrowser1.TabIndex = 2; - this.webBrowser1.Url = new System.Uri("http://10.60.101.10:8005/Manage/HtmlFivePainting3-1.html", System.UriKind.Absolute); + this.webBrowser1.Tag = "http://10.60.101.10:8005/Manage/HtmlFivePainting3-1.html"; + this.webBrowser1.Url = new System.Uri("http://localhost:84/Manage/HtmlFivePainting3-1.html", System.UriKind.Absolute); // // label2 // @@ -117,9 +122,10 @@ this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(-5, 576); + this.label2.Location = new System.Drawing.Point(-8, 864); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(1899, 46); + this.label2.Size = new System.Drawing.Size(2848, 69); this.label2.TabIndex = 1; this.label2.Text = "发货数"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -131,20 +137,22 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("微软雅黑", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(-5, 93); + this.label1.Location = new System.Drawing.Point(-8, 140); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1899, 46); + this.label1.Size = new System.Drawing.Size(2848, 69); this.label1.TabIndex = 0; this.label1.Text = "喷涂入库套数"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // FrmPainting3 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1904, 1064); + this.ClientSize = new System.Drawing.Size(2856, 1596); this.ControlBox = false; this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FrmPainting3"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Tag = "喷涂合格率"; diff --git a/FiveScreen/Program.cs b/FiveScreen/Program.cs index 8bd4dc6..c6fe26b 100644 --- a/FiveScreen/Program.cs +++ b/FiveScreen/Program.cs @@ -16,7 +16,7 @@ namespace FiveScreen { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - //Application.Run(new FrmInjection2()); + //Application.Run(new FrmPainting3()); Application.Run(new FrmCenter()); //Application.Run(new FrmPainting3()); } diff --git a/InjectionPC/bin/Debug/Report/111 - 副本2.grf b/InjectionPC/bin/Debug/Report/111 - 副本2.grf deleted file mode 100644 index b33490a..0000000 Binary files a/InjectionPC/bin/Debug/Report/111 - 副本2.grf and /dev/null differ diff --git a/MESClassLibrary/BLL/Mistake247/BoxBLL.cs b/MESClassLibrary/BLL/Mistake247/BoxBLL.cs index d4e22ab..9091c69 100644 --- a/MESClassLibrary/BLL/Mistake247/BoxBLL.cs +++ b/MESClassLibrary/BLL/Mistake247/BoxBLL.cs @@ -13,6 +13,41 @@ namespace MESClassLibrary.BLL.Mistake247 { public class BoxBLL { + private BoxDAL _boxDAL = new BoxDAL(); + /// + /// 左前 + /// + /// + public DataTable GetX247LF() + { + return _boxDAL.GetX247LF(); + } + /// + /// 左后 + /// + /// + public DataTable GetX247LR() + { + return _boxDAL.GetX247LR(); + } + /// + /// 右前 + /// + /// + public DataTable GetX247RF() + { + return _boxDAL.GetX247RF(); + } + /// + /// 右后 + /// + /// + public DataTable GetX247RR() + { + return _boxDAL.GetX247RR(); + } + + public bool AddInfo(BoxModel md) { BoxDAL da = new BoxDAL(); diff --git a/MESClassLibrary/BLL/Mistake247/RecordBLL.cs b/MESClassLibrary/BLL/Mistake247/RecordBLL.cs index b799302..c6ecef5 100644 --- a/MESClassLibrary/BLL/Mistake247/RecordBLL.cs +++ b/MESClassLibrary/BLL/Mistake247/RecordBLL.cs @@ -13,6 +13,47 @@ namespace MESClassLibrary.BLL.Mistake247 { public class RecordBLL { + private RecordDAL _recordDAL = new RecordDAL(); + + public string SearchQLevelFromWms(string stockNo, string partCode) + { + return _recordDAL.SearchQLevel(stockNo, partCode); + } + /// + /// 左前 + /// + /// + public DataTable GetX247LF() + { + return _recordDAL.GetX247LF(); + } + /// + /// 左后 + /// + /// + public DataTable GetX247LR() + { + return _recordDAL.GetX247LR(); + } + /// + /// 右前 + /// + /// + public DataTable GetX247RF() + { + return _recordDAL.GetX247RF(); + } + /// + /// 右后 + /// + /// + public DataTable GetX247RR() + { + return _recordDAL.GetX247RR(); + } + + + public DataTable SearchByPartNo1(string PartNo) { RecordDAL da = new RecordDAL(); diff --git a/MESClassLibrary/DAL/Mistake247/BoxDAL.cs b/MESClassLibrary/DAL/Mistake247/BoxDAL.cs index 2b443f2..3eae9f5 100644 --- a/MESClassLibrary/DAL/Mistake247/BoxDAL.cs +++ b/MESClassLibrary/DAL/Mistake247/BoxDAL.cs @@ -15,6 +15,59 @@ namespace MESClassLibrary.DAL.Mistake247 { public static string TableName = "tb_Box_247"; + + + + + /// + /// 左前 + /// + /// + public DataTable GetX247LF() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Box_247] WHERE PartNo in('A2477204606','A2477204806','A2477205006') AND [PrintTime] IS NULL ORDER BY [CreateTime]"; + return GetDoorAssemble(sql); + } + /// + /// 左后 + /// + /// + public DataTable GetX247LR() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Box_247] WHERE PartNo in('A2477305303','A2477305503','A2477305703') AND [PrintTime] IS NULL ORDER BY [CreateTime]"; + return GetDoorAssemble(sql); + } + /// + /// 右前 + /// + /// + public DataTable GetX247RF() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Box_247] WHERE PartNo in('A2477204706','A2477204906','A2477205106') AND [PrintTime] IS NULL ORDER BY [CreateTime]"; + return GetDoorAssemble(sql); + } + /// + /// 右后 + /// + /// + public DataTable GetX247RR() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Box_247] WHERE PartNo in('A2477305603','A2477305403','A2477305803') AND [PrintTime] IS NULL ORDER BY [CreateTime]"; + return GetDoorAssemble(sql); + } + DataTable GetDoorAssemble(string sql) + { + try + { + SqlParameter[] param = new SqlParameter[0]; + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } public bool AddInfo(BoxModel md) { try diff --git a/MESClassLibrary/DAL/Mistake247/RecordDAL.cs b/MESClassLibrary/DAL/Mistake247/RecordDAL.cs index 9719131..0894a00 100644 --- a/MESClassLibrary/DAL/Mistake247/RecordDAL.cs +++ b/MESClassLibrary/DAL/Mistake247/RecordDAL.cs @@ -15,6 +15,95 @@ namespace MESClassLibrary.DAL.Mistake247 public static string TableName = "tb_Record_247"; public static string TableName1 = "tb_Record_243"; + + public string SearchQLevel(string stockNo,string partCode) + { + try + { + string sql = string.Empty; + SqlParameter[] param = new SqlParameter[1]; + if (!string.IsNullOrEmpty(stockNo)) + { + sql = $"select QLevel from TA_PART where DrawingNumber=@DrawingNumber"; + + param[0] = new SqlParameter("@DrawingNumber", SqlDbType.VarChar); + param[0].Value = stockNo; + } + else + { + sql = $"select QLevel from TA_PART where PartCode=@PartCode"; + param[0] = new SqlParameter("@PartCode", SqlDbType.VarChar); + param[0].Value = partCode; + } + + + DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetWmsConnSting(), CommandType.Text, sql, param).Tables[0]; + if (dt.Rows.Count > 0) + { + return dt.Rows[0]["QLevel"].ToString(); + } + return null; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + + } + } + + + /// + /// 左前 + /// + /// + public DataTable GetX247LF() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Assembly_247] WHERE substring(PartNo,1,11) in ('A2477203007','A2477203207','A2477205006' )AND PrintTime IS NULL ORDER BY CreateTime"; + return GetDoorAssemble(sql); + } + /// + /// 左后 + /// + /// + public DataTable GetX247LR() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Assembly_247] WHERE substring(PartNo,1,11 ) in('A2477305303','A2477305503','A2477305703') AND PrintTime IS NULL ORDER BY CreateTime"; + return GetDoorAssemble(sql); + } + /// + /// 右前 + /// + /// + public DataTable GetX247RF() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Assembly_247] WHERE SUBSTRING(PartNo,1,11) in ('A2477203107','A2477203307','A2477205106' )AND PrintTime IS NULL ORDER BY CreateTime"; + return GetDoorAssemble(sql); + } + /// + /// 右后 + /// + /// + public DataTable GetX247RR() + { + string sql = "SELECT top 1 * FROM [dbo].[tb_Assembly_247] WHERE SUBSTRING(PartNo,1,11) in('A2477305603','A2477305403','A2477305803') AND PrintTime IS NULL ORDER BY CreateTime"; + return GetDoorAssemble(sql); + } + DataTable GetDoorAssemble(string sql) + { + try + { + SqlParameter[] param = new SqlParameter[0]; + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + /// /// 查找半成品是否已经装配 /// diff --git a/MESClassLibrary/DAL/SqlHelper.cs b/MESClassLibrary/DAL/SqlHelper.cs index 6ebe112..83af2dc 100644 --- a/MESClassLibrary/DAL/SqlHelper.cs +++ b/MESClassLibrary/DAL/SqlHelper.cs @@ -182,7 +182,10 @@ namespace MESClassLibrary.DAL { return ConfigurationManager.ConnectionStrings["SqlConnString"].ConnectionString; } - + public static string GetWmsConnSting() + { + return ConfigurationManager.ConnectionStrings["WmsConnString"].ConnectionString; + } public static string GetConnSting1() { return ConfigurationManager.ConnectionStrings["SqlConnString1"].ConnectionString; diff --git a/MESClassLibrary/MESClassLibrary.csproj b/MESClassLibrary/MESClassLibrary.csproj index bd0027f..38b1e16 100644 --- a/MESClassLibrary/MESClassLibrary.csproj +++ b/MESClassLibrary/MESClassLibrary.csproj @@ -22,6 +22,7 @@ DEBUG;TRACE prompt 4 + AnyCPU pdbonly diff --git a/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs b/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs index c8ecad6..024527f 100644 --- a/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs +++ b/PunchAssemble/PunchAndWeld/FrmDoorSill_214_3.cs @@ -32,6 +32,7 @@ namespace PunchAndWeld this.Hide(); ShowParamDialog("",""); + this.WindowState = FormWindowState.Maximized; } diff --git a/PurchingMistakeNew/Form1.cs b/PurchingMistakeNew/Form1.cs index 4349370..7ce9547 100644 --- a/PurchingMistakeNew/Form1.cs +++ b/PurchingMistakeNew/Form1.cs @@ -22,6 +22,8 @@ namespace PurchingMistakeNew public partial class Form1 : Form { private static string orderNo=""; + private RecordBLL _recordBLL = new RecordBLL(); + private Func GetHeadTable = null; public Form1() { InitializeComponent(); @@ -419,7 +421,7 @@ namespace PurchingMistakeNew LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } } - + private void textBox2_KeyDown(object sender, KeyEventArgs e) { try @@ -571,22 +573,28 @@ namespace PurchingMistakeNew DateTime.Now.ToString("yyyy-MM-dd").Substring(5, 2) + DateTime.Now.ToString("yyyy-MM-dd").Substring(8, 2); + DataTable headTable = null; + string fileName = string.Empty; #region 根据半成品零件号判断总成类型、总成条码模板、打印机 if (partNo == "1230002601" || partNo == "1230003122") { md.PartType = "X247 左侧前门板"; type = 1; - report.LoadFromFile(@"D:\New\X247 左侧前门板.grf"); + fileName = ReportHelper.GetTemplateName("X247门板"); + report.LoadFromFile(fileName); // @"D:\New\X247 左侧前门板.grf" ; report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + GetHeadTable = _recordBLL.GetX247LF; } if (partNo == "1230002604" || partNo == "1230003130") { md.PartType = "X247 左侧后门板"; type = 1; - report.LoadFromFile(@"D:\New\X247 左侧后门板.grf"); + fileName = ReportHelper.GetTemplateName("X247门板"); + report.LoadFromFile(fileName); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + GetHeadTable = _recordBLL.GetX247LR; } if (partNo == "1230002602" || partNo == "1230003126") @@ -594,25 +602,30 @@ namespace PurchingMistakeNew md.PartType = "X247 右侧前门板"; type = 2; - report.LoadFromFile(@"D:\New\X247 右侧前门板.grf"); + fileName = ReportHelper.GetTemplateName("X247门板"); + report.LoadFromFile(fileName); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + GetHeadTable = _recordBLL.GetX247RF; } if (partNo == "1230002605" || partNo == "1230003134") { md.PartType = "X247 右侧后门板"; type = 2; - report.LoadFromFile(@"D:\New\X247 右侧后门板.grf"); + fileName = ReportHelper.GetTemplateName("X247门板"); + report.LoadFromFile(fileName); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + + GetHeadTable = _recordBLL.GetX247RR; } if (partNo == "1230002609") { md.PartType = "X247 前部左侧轮眉"; type = 3; - report.LoadFromFile(@"D:\New\X247 前部左侧轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部左侧轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -621,7 +634,7 @@ namespace PurchingMistakeNew { md.PartType = "X247 后部左侧后轮眉"; type = 3; - report.LoadFromFile(@"D:\New\X247 后部左侧后轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧后轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -630,7 +643,7 @@ namespace PurchingMistakeNew { md.PartType = "X247 前部右侧轮眉"; type = 4; - report.LoadFromFile(@"D:\New\X247 前部右侧轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部右侧轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } @@ -640,7 +653,7 @@ namespace PurchingMistakeNew md.PartType = "X247 右侧后部后轮眉"; type = 4; - report.LoadFromFile(@"D:\New\X247 右侧后部后轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 右侧后部后轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } @@ -650,7 +663,7 @@ namespace PurchingMistakeNew md.PartType = "X247 后部左侧前轮眉"; type = 5; - report.LoadFromFile(@"D:\New\X247 后部左侧轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧前轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -661,7 +674,7 @@ namespace PurchingMistakeNew type = 5; - report.LoadFromFile(@"D:\New\X247 后部右侧前轮眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧前轮眉")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -672,7 +685,7 @@ namespace PurchingMistakeNew type = 6; - report.LoadFromFile(@"D:\New\X247 后部左侧扰流板眉.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧扰流板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -683,7 +696,7 @@ namespace PurchingMistakeNew type = 7; - report.LoadFromFile(@"D:\New\X247 后部右侧扰流板.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧扰流板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } @@ -702,10 +715,29 @@ namespace PurchingMistakeNew #endregion #region 打印总成条码 + - report.Register(""); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); - report.Print(false); + if (string.IsNullOrEmpty(fileName)) + { + report.Register(""); + report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + report.Print(false); + + } + else + { + headTable = GetHeadTable(); + headTable.Columns.Add("QLevel"); + foreach(DataRow dr in headTable.Rows) + { + string qlevel = _recordBLL.SearchQLevelFromWms(partNo,""); + dr["QLevel"] = qlevel; + } + + ReportHelper report2 = new ReportHelper(fileName, headTable, null, (int)GRPaperOrientation.grpoPortrait, 1, report.Printer.PrinterName); + report2.Report.Printer.PrinterName = report.Printer.PrinterName; + report2.Report.Print(false); + } abll.UpdateInfo(md); #endregion @@ -814,28 +846,28 @@ namespace PurchingMistakeNew if (part == "A2477203007" || part == "A2477203207" || part == "A2477205006") { md.PartType = "X247 左侧前门板"; - report.LoadFromFile(@"D:\New\X247 左侧前门板.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧前门板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2477305303" || part == "A2477305503" || part == "A2477305703") { md.PartType = "X247 左侧后门板"; - report.LoadFromFile(@"D:\New\X247 左侧后门板.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧后门板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477203107" || part == "A2477203307" || part == "A2477205106") { md.PartType = "X247 右侧前门板"; - report.LoadFromFile(@"D:\New\X247 右侧前门板.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧前门板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2477305403" || part == "A2477305603" || part == "A2477305803") { md.PartType = "X247 右侧后门板"; - report.LoadFromFile(@"D:\New\X247 右侧后门板.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧后门板")); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } @@ -861,7 +893,7 @@ namespace PurchingMistakeNew } } - + private void button1_Click(object sender, EventArgs e) { panel1.Visible = true; @@ -947,5 +979,6 @@ namespace PurchingMistakeNew return false; } + } } diff --git a/PurchingMistakeNew/Form3.cs b/PurchingMistakeNew/Form3.cs index 44fe163..3fa6b52 100644 --- a/PurchingMistakeNew/Form3.cs +++ b/PurchingMistakeNew/Form3.cs @@ -20,6 +20,9 @@ namespace PurchingMistakeNew { public partial class Form3 : Form { + private Func GetHeadTable = null; + private BoxBLL _boxBll = new BoxBLL(); + private RecordBLL _recordBLL = new RecordBLL(); public Form3() { InitializeComponent(); @@ -411,7 +414,8 @@ namespace PurchingMistakeNew { box = ""; } - + DataTable headTable = null; + string fileName = string.Empty; batch = DateTime.Now.ToString("yyyy-MM-dd").Substring(2, 2) + DateTime.Now.ToString("yyyy-MM-dd").Substring(5, 2) + DateTime.Now.ToString("yyyy-MM-dd").Substring(8, 2); if (box != "") { @@ -472,86 +476,114 @@ namespace PurchingMistakeNew } bll.AddInfo(md); + + #region 打印装箱单 if (part == "A2477209103" || part == "A2477209203" || part == "A2477209305" || part == "A2477203007" || part == "A2477203207" || part == "A2477205006") { - report.LoadFromFile(@"D:\New\X247 左侧前门板装箱单.grf"); + //report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧前门板装箱单"));//@"D:\New\X247 左侧前门板装箱单.grf" + report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247LF; } if (part == "A2477309401" || part == "A2477309501" || part == "A2477300203" || part == "A2477305303" || part == "A2477305503" || part == "A2477305703") { - report.LoadFromFile(@"D:\New\X247 左侧后门板装箱单.grf"); + //report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧后门板装箱单"));//@"D:\New\X247 左侧后门板装箱单.grf" + fileName = ReportHelper.GetTemplateName("X247装箱单"); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + GetHeadTable = _boxBll.GetX247LR; } if (part == "A2477209303" || part == "A2477209403" || part == "A2477207505" || part == "A2477203107" || part == "A2477203307" || part == "A2477205106") { - report.LoadFromFile(@"D:\New\X247 右侧前门板装箱单.grf"); + //report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧前门板装箱单"));//@"D:\New\X247 右侧前门板装箱单.grf" + fileName = ReportHelper.GetTemplateName("X247装箱单"); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + GetHeadTable = _boxBll.GetX247RF; } if (part == "A2477309601" || part == "A2477309701" || part == "A2477300303" || part == "A2477305403" || part == "A2477305603" || part == "A2477305803") { - report.LoadFromFile(@"D:\New\X247 右侧后门板装箱单.grf"); + //report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧后门板装箱单"));//@"D:\New\X247 右侧后门板装箱单.grf" + fileName = ReportHelper.GetTemplateName("X247装箱单"); report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + GetHeadTable = _boxBll.GetX247RR; } if (part == "A2478850022") { - report.LoadFromFile(@"D:\New\X247 前部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部左侧轮眉装箱单"));//@"D:\New\X247 前部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850222") { - report.LoadFromFile(@"D:\New\X247 后部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧轮眉装箱单"));//@"D:\New\X247 后部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850122") { - report.LoadFromFile(@"D:\New\X247 前部右侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部右侧轮眉装箱单"));//@"D:\New\X247 前部右侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2478850322") { - report.LoadFromFile(@"D:\New\X247 后部右侧后轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧后轮眉装箱单"));//@"D:\New\X247 后部右侧后轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309400") { - report.LoadFromFile(@"D:\New\X247 后部左侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧前轮眉装箱单"));//@"D:\New\X247 后部左侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309600") { - report.LoadFromFile(@"D:\New\X247 后部右侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧前轮眉装箱单"));//@"D:\New\X247 后部右侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900788" || part == "A2477901300") { - report.LoadFromFile(@"D:\New\X247 后部左侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧扰流板装箱单"));//@"D:\New\X247 后部左侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900888" || part == "A2477901400") { - report.LoadFromFile(@"D:\New\X247 后部右侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧扰流板装箱单"));//@"D:\New\X247 后部右侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } #endregion - report.Register(""); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); - report.Print(false); + if (string.IsNullOrEmpty(fileName)) + { + report.Register(""); + report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + report.Print(false); + } + else + { + headTable = GetHeadTable(); + headTable.Columns.Add("QLevel"); + foreach (DataRow dr in headTable.Rows) + { + string qlevel = _recordBLL.SearchQLevelFromWms("",part); + dr["QLevel"] = qlevel; + } + + ReportHelper report2 = new ReportHelper(fileName, headTable, null, (int)GRPaperOrientation.grpoPortrait, 1, report.Printer.PrinterName); + report2.Report.Printer.PrinterName = report.Printer.PrinterName; + report2.Report.Print(false); + } bll.UpdateInfo(md); @@ -591,14 +623,18 @@ namespace PurchingMistakeNew if (part == "A2477209103" || part == "A2477209203" || part == "A2477209305" || part == "A2477203007" || part == "A2477203207" || part == "A2477205006") { - report.LoadFromFile(@"D:\New\X247 左侧前门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧前门板装箱单"));//@"D:\New\X247 左侧前门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247LF; } if (part == "A2477309401" || part == "A2477309501" || part == "A2477300203" || part == "A2477305303" || part == "A2477305503" || part == "A2477305703") { - report.LoadFromFile(@"D:\New\X247 左侧后门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧后门板装箱单"));//@"D:\New\X247 左侧后门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247LR; } //if (part == "A2477209303" || part == "A2477209403" || part == "A2477207505" || part == "A2477203107" || part == "A2477203307" || part == "A2477205106") @@ -609,69 +645,90 @@ namespace PurchingMistakeNew if (part == "A2477209303" || part == "A2477209403" || part == "A2477207505" || part == "A2477203107" || part == "A2477203307" || part == "A2477205106") { - report.LoadFromFile(@"D:\New\X247 右侧前门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧前门板装箱单"));//@"D:\New\X247 右侧前门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247RF; } if (part == "A2477309601" || part == "A2477309701" || part == "A2477300303" || part == "A2477305403" || part == "A2477305603" || part == "A2477305803") { - report.LoadFromFile(@"D:\New\X247 右侧后门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧后门板装箱单"));//@"D:\New\X247 右侧后门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247RR; } if (part == "A2478850022") { - report.LoadFromFile(@"D:\X247 前部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 前部左侧轮眉装箱单"));//@"D:\X247 前部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850222") { - report.LoadFromFile(@"D:\X247 后部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部左侧轮眉装箱单"));//@"D:\X247 后部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850122") { - report.LoadFromFile(@"D:\X247 前部右侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 前部右侧轮眉装箱单"));//@"D:\X247 前部右侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2478850322") { - report.LoadFromFile(@"D:\X247 后部右侧后轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部右侧后轮眉装箱单"));//@"D:\X247 后部右侧后轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309400") { - report.LoadFromFile(@"D:\X247 后部左侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部左侧前轮眉装箱单"));//@"D:\X247 后部左侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309600") { - report.LoadFromFile(@"D:\X247 后部右侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部右侧前轮眉装箱单"));//@"D:\X247 后部右侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900788" || part == "A2477901300") { - report.LoadFromFile(@"D:\X247 后部左侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部左侧扰流板装箱单"));//@"D:\X247 后部左侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900888" || part == "A2477901400") { - report.LoadFromFile(@"D:\X247 后部右侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部右侧扰流板装箱单"));//@"D:\X247 后部右侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } #endregion - report.Register(""); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); - report.Print(false); + if (string.IsNullOrEmpty(fileName)) + { + report.Register(""); + report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + report.Print(false); + } + else + { + headTable = GetHeadTable(); + headTable.Columns.Add("QLevel"); + foreach (DataRow dr in headTable.Rows) + { + string qlevel = _recordBLL.SearchQLevelFromWms("", part); + dr["QLevel"] = qlevel; + } + + ReportHelper report2 = new ReportHelper(fileName, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, report.Printer.PrinterName); + report2.Report.Printer.PrinterName = report.Printer.PrinterName; + report2.Report.Print(false); + } bll.UpdateInfo(md); @@ -690,7 +747,7 @@ namespace PurchingMistakeNew LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } } - + private void textBox1_KeyDown(object sender, KeyEventArgs e) { MistakeBLL mbll=new MistakeBLL(); @@ -928,86 +985,117 @@ namespace PurchingMistakeNew #endregion + DataTable headTable = null; + string fileName = string.Empty; + #region 打印装箱单 if (part == "A2477209103" || part == "A2477209203" || part == "A2477209305" || part == "A2477203007" || part == "A2477203207" || part == "A2477205006") { - report.LoadFromFile(@"D:\New\X247 左侧前门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧前门板装箱单"));//@"D:\New\X247 左侧前门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247LF; } if (part == "A2477309401" || part == "A2477309501" || part == "A2477300203" || part == "A2477305303" || part == "A2477305503" || part == "A2477305703") { - report.LoadFromFile(@"D:\New\X247 左侧后门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247左侧后门板装箱单"));//@"D:\New\X247 左侧后门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247LR; } if (part == "A2477209303" || part == "A2477209403" || part == "A2477207505" || part == "A2477203107" || part == "A2477203307" || part == "A2477205106") { - report.LoadFromFile(@"D:\New\X247 右侧前门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧前门板装箱单"));//@"D:\New\X247 右侧前门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247RF; } if (part == "A2477309601" || part == "A2477309701" || part == "A2477300303" || part == "A2477305403" || part == "A2477305603" || part == "A2477305803") { - report.LoadFromFile(@"D:\New\X247 右侧后门板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateName("X247右侧后门板装箱单"));//@"D:\New\X247 右侧后门板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); + + fileName = ReportHelper.GetTemplateName("X247装箱单"); + GetHeadTable = _boxBll.GetX247RR; } if (part == "A2478850022") { - report.LoadFromFile(@"D:\New\X247 前部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部左侧轮眉装箱单"));//@"D:\New\X247 前部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850222") { - report.LoadFromFile(@"D:\New\X247 后部左侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧轮眉装箱单"));//@"D:\New\X247 后部左侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer1"].ToString(); } if (part == "A2478850122") { - report.LoadFromFile(@"D:\New\X247 前部右侧轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 前部右侧轮眉装箱单"));//@"D:\New\X247 前部右侧轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2478850322") { - report.LoadFromFile(@"D:\X247 后部右侧后轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameD("X247 后部右侧后轮眉装箱单"));//@"D:\X247 后部右侧后轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309400") { - report.LoadFromFile(@"D:\New\X247 后部左侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧前轮眉装箱单"));//@"D:\New\X247 后部左侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477309600") { - report.LoadFromFile(@"D:\New\X247 后部右侧前轮眉装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧前轮眉装箱单"));//@"D:\New\X247 后部右侧前轮眉装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900788" || part == "A2477901300") { - report.LoadFromFile(@"D:\New\X247 后部左侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部左侧扰流板装箱单"));//@"D:\New\X247 后部左侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } if (part == "A2477900888" || part == "A2477901400") { - report.LoadFromFile(@"D:\New\X247 后部右侧扰流板装箱单.grf"); + report.LoadFromFile(ReportHelper.GetTemplateNameDNew("X247 后部右侧扰流板装箱单"));//@"D:\New\X247 后部右侧扰流板装箱单.grf" report.Printer.PrinterName = ConfigurationManager.AppSettings["Printer2"].ToString(); } #endregion - report.Register(""); - report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); - report.Print(false); + if (string.IsNullOrEmpty(fileName)) + { + report.Register(""); + report.ConnectionString = ConfigurationManager.ConnectionStrings["report"].ToString(); + report.Print(false); + } + else + { + headTable = GetHeadTable(); + headTable.Columns.Add("QLevel"); + foreach (DataRow dr in headTable.Rows) + { + string qlevel = _recordBLL.SearchQLevelFromWms("", part); + dr["QLevel"] = qlevel; + } + + ReportHelper report2 = new ReportHelper(fileName, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, report.Printer.PrinterName); + report2.Report.Printer.PrinterName = report.Printer.PrinterName; + report2.Report.Print(false); + } + bll.UpdateInfo(md); } diff --git a/PurchingMistakeNew/PurchingMistakeNew.csproj b/PurchingMistakeNew/PurchingMistakeNew.csproj index f3dbb86..ce36dd5 100644 --- a/PurchingMistakeNew/PurchingMistakeNew.csproj +++ b/PurchingMistakeNew/PurchingMistakeNew.csproj @@ -260,6 +260,36 @@ Settings.settings True + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + @@ -280,6 +310,7 @@ +