ztl 2 лет назад
Родитель
Сommit
1f9c4fa827
2 измененных файлов с 24 добавлено и 21 удалено
  1. 15 15
      wwwroot/main/Procedure/test17/index.html
  2. 9 6
      wwwroot/main/Procedure/test17/rpt.ashx

+ 15 - 15
wwwroot/main/Procedure/test17/index.html

@@ -39,8 +39,8 @@
 				</div>
 
 				<!--包装任务-->
-				<div style="height:100px">
-					<div style="width: 200%; height: 530px; display: flex; flex-direction: row; margin-top: 0px">
+				<div style="height: 100px; border:1px blue;">
+					<div style="width: 200%; height: 530px; display: flex; flex-direction: row; margin-top: 0px;">
 						<div style="width: 100%; height: 530px; padding-right: 20px; margin-left: 20px">
 							<table id="table1" cellspacing="0" cellpadding="0" border="0" style="width:100%;">
 								<tr><td colspan="12" style="color: white; font-size: 20px; border-style: none;">包装任务</td></tr>
@@ -75,7 +75,7 @@
 									<td style="font-size: 16px; color: white; width: 20%">下单时间</td>
 								</tr>
 							</table>
-							<table id="mx" cellspacing="0" cellpadding="0" border="0" style=" margin-top: 25px; width: 100%; font-size: 35px; margin-left: -1840px;height:100px">
+							<table id="mx" cellspacing="0" cellpadding="0" border="0" margin-top: 25px; width: 100%; font-size: 35px; margin-left: -1840px;height:100px">
 							</table>
 						</div>
 					</div>
@@ -124,7 +124,7 @@
 				</div>
 
 				<!--品管抽查-->
-				<div style="width: 33%; height: 340px; margin-top: -240px; margin-left: 1250px ">
+				<div style="width: 25%; height: 340px; margin-top: -240px; margin-left: 1350px ">
 					<div style="color:white;font-size:20px;font-weight:600; text-align:center">品管抽查</div>
 					<canvas id="canvasDefectA" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 200px; width: 100%"></canvas>
 				</div>
@@ -154,8 +154,8 @@
 			packDay();
 			doGetTime = setInterval(function () { packDay(); }, 5000);
 			//饼状图
-			bingData();
-			doGetTime = setInterval(function () { bingData(); }, 30000);
+			//bingData();
+			//doGetTime = setInterval(function () { bingData(); }, 30000);
 		});
 
         //品管
@@ -421,17 +421,17 @@
         }
 
 		//饼状
-		function bingData() {
-			var num1 = 0; num2 = 0; num3 = 0; num4 = 0; num5 = 0; num6 = 0;
-			//饼
-			$.get("rpt.ashx?m=bingData", function (data) {
-				var json = JSON.parse(data);
+		//function bingData() {
+		//	var num1 = 0; num2 = 0; num3 = 0; num4 = 0; num5 = 0; num6 = 0;
+		//	//饼
+		//	$.get("rpt.ashx?m=bingData", function (data) {
+		//		var json = JSON.parse(data);
 
 
-				window.Device.data.datasets[0].data = [num1, num2, num3, num4, num5, num6];
-				window.Device.update();
-			});
-		}
+		//		window.Device.data.datasets[0].data = [num1, num2, num3, num4, num5, num6];
+		//		window.Device.update();
+		//	});
+		//}
 		//包装任务翻页查询
 		function getPage() {
 			$.get('rpt.ashx?m=packingDataNumber', function (data) {

+ 9 - 6
wwwroot/main/Procedure/test17/rpt.ashx

@@ -61,7 +61,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
             //成型产量 月
             if (context.Request["m"].ToString() == "packingData")
             {
-                string sqlStr = @"
+                string sqlStr1 = @"
 				SELECT
 					ROWNUM AS 序号,
 					M.PACKINGLINE AS 线号,
@@ -104,29 +104,32 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                 int rows = HttpContext.Current.Request["rows"] is object ? Convert.ToInt32(HttpContext.Current.Request["rows"]) : 4;
                 //获取分页数据
                 int total = 0;
-                DataTable dt = conn.SelectPages(page, rows, out total, sqlStr);
+                DataTable dt = conn.SelectPages(page, rows, out total, sqlStr1);
                 context.Response.Write(new JsonResult(dt) { total = total }.ToJson());
             }
             else if (context.Request["m"].ToString() == "canvasDayCL3")
             {
                 DataTable dt = conn.ExecuteDatatable(@"
 				SELECT
+					TO_CHAR(CREATETIME,'HH24') AS SJ,
 					SUM( SBZ001 ) SBZ001,
 					SUM( SBZ002 ) SBZ002 
 				FROM
 					(
 					SELECT
-	
+						CREATETIME,
 						CASE WHEN USERCODE = 'SBZ001' THEN 1 ELSE 0 END SBZ001,
 						CASE WHEN USERCODE = 'SBZ002' THEN 1 ELSE 0 END SBZ002 
 					FROM
 						TP_PM_PRODUCTIONDATA 
 					WHERE
 						USERCODE IN ( 'SBZ001', 'SBZ002' ) 
-					AND PROCEDUREID = 107
- 					AND TRUNC( CREATETIME ) = trunc(sysdate)
-				-- 	AND  CREATETIME >= DATE'2023-12-21'
+					AND CREATETIME >= trunc(sysdate)+7/24
+					AND TO_CHAR(CREATETIME,'yyyymmddhh24miss') <= to_char(sysdate+1,'yyyyMMdd')||'055959'
+					ORDER BY CREATETIME
 					)
+				GROUP BY TO_CHAR(CREATETIME,'HH24')
+				ORDER BY TO_CHAR(CREATETIME,'HH24')
 				"
     );
                 string jsonStr = new JsonResult(dt).ToJson();