瀏覽代碼

成型高压看板调整

ztl 2 年之前
父節點
當前提交
ac769d93fd
共有 2 個文件被更改,包括 107 次插入62 次删除
  1. 49 0
      wwwroot/main/Procedure/test6/demo.ashx
  2. 58 62
      wwwroot/main/Procedure/test6/demo.html

+ 49 - 0
wwwroot/main/Procedure/test6/demo.ashx

@@ -16,6 +16,7 @@ public class demo : IHttpHandler {
         context.Response.ContentType = "text/plain";
         using (IDataAccess conn = DataAccess.Create())
         {
+                //成型缺陷扇形图
                 if (context.Request["m"].ToString() == "defect")
             {
                 string sqlStr = @"SELECT T.DEFECTNAME,T.数量 FROM(									
@@ -37,6 +38,54 @@ public class demo : IHttpHandler {
                 string jsonStr = new JsonResult(dt).ToJson();
                 context.Response.Write(jsonStr);
             }
+                //成型折线图
+                if (context.Request["m"].ToString() == "zx")
+            {
+                string sqlStr = @"SELECT * FROM (
+                                    --半检数量
+                                    SELECT DISTINCT
+                                        COUNT( TPS.BARCODE ) 半检数量,
+                                        to_char(TPS.CREATETIME, 'yyyymmdd')   as CREATETIME
+                                      FROM
+                                        TP_PM_SEMICHECK TPS
+                                        INNER JOIN TP_PM_GROUTINGDAILYDETAIL PGD ON PGD.BARCODE = TPS.BARCODE
+                                        LEFT JOIN TP_PC_GROUTINGLINE TPGL ON TPGL.GROUTINGLINEID = PGD.GROUTINGLINEID
+                                      WHERE
+                                         TPGL.HIGHPRESSUREFLAG = 1
+	                                      AND PGD.TESTFLAG = 0
+		                                    AND SUBSTR(TPGL.GROUTINGLINENAME, 1, 4) = 'C05A'
+                                        AND TPS.CREATETIME >= trunc(sysdate-6)
+                                      GROUP BY
+                                        to_char(TPS.CREATETIME, 'yyyymmdd') 
+		                                    ORDER BY to_char(TPS.CREATETIME, 'yyyymmdd') desc) T
+		                                    LEFT JOIN (
+		                                    SELECT DISTINCT
+		                                    --本烧数量
+                                        COUNT( TPPD.BARCODE ) 本烧数量,
+                                        to_char(TPPD.CREATETIME, 'yyyymmdd')   as CREATETIME
+                                      FROM
+                                        TP_PM_PRODUCTIONDATA TPPD
+                                        INNER JOIN TP_PM_GROUTINGDAILYDETAIL PGD ON PGD.BARCODE = TPPD.BARCODE
+                                        LEFT JOIN TP_PC_GROUTINGLINE TPGL ON TPGL.GROUTINGLINEID = PGD.GROUTINGLINEID
+                                      WHERE
+                                         TPGL.HIGHPRESSUREFLAG = 1
+	                                      AND TPPD.PROCEDUREID IN (104)
+		                                    AND TPPD.ISREFIRE = 0
+	                                      AND PGD.TESTFLAG = 0
+		                                    AND TPPD.VALUEFLAG = 1
+		                                    AND TPPD.checkflag = '1'
+		                                    AND SUBSTR(TPGL.GROUTINGLINENAME, 1, 4) = 'C05A'
+                                        AND TPPD.CREATETIME >= trunc(sysdate-6)
+                                      GROUP BY
+                                        to_char(TPPD.CREATETIME, 'yyyymmdd') 
+		                                    ORDER BY to_char(TPPD.CREATETIME, 'yyyymmdd') desc) T1 ON T.CREATETIME = T1.CREATETIME";
+                //直接获取不分页数据
+                DataTable dt = conn.ExecuteDatatable(sqlStr);
+                string jsonStr = new JsonResult(dt).ToJson();
+                context.Response.Write(jsonStr);
+            }
+
+                //产线信息
 
                 if (context.Request["m"].ToString() == "MonthTable")
             {

+ 58 - 62
wwwroot/main/Procedure/test6/demo.html

@@ -176,21 +176,51 @@
             doGetData = setInterval(function () { timeUpdate(); }, 5000);
             loadMainTable();
             DdfectData();
+            setInterval(function () { DdfectData(); }, 5000);
+            ZxData();
+            setInterval(function () { ZxData(); }, 5000);
+            
         });
 
         function DdfectData() {
             $.get("demo.ashx?m=defect", function (data) {
                 var json = JSON.parse(data);
                 if (json["success"] == true) {
-                    var A = parseFloat(json["rows"][0]["数量"]);
-                    var B = parseFloat(json["rows"][1]["数量"]);
-                    var C = parseFloat(json["rows"][2]["数量"]);
-                    window.DefectA.data.datasets[0].data = [A, B, C];
+                    var defect1 = parseFloat(json["rows"][0]["数量"]);
+                    var defect2 = parseFloat(json["rows"][1]["数量"]);
+                    var defect3 = parseFloat(json["rows"][2]["数量"]);
+                    window.DefectA.data.datasets[0].data = [defect1, defect2, defect3];
                     window.DefectA.update();
                 }
             });
         }
 
+        function ZxData() {
+            $.get("demo.ashx?m=zx", function (data) {
+                var json = JSON.parse(data);
+                if (json["success"] == true) {
+                    var BJ1 = parseFloat(json["rows"][0]["半检数量"]);
+                    var BJ2 = parseFloat(json["rows"][1]["半检数量"]);
+                    var BJ3 = parseFloat(json["rows"][2]["半检数量"]);
+                    var BJ4 = parseFloat(json["rows"][3]["半检数量"]);
+                    var BJ5 = parseFloat(json["rows"][4]["半检数量"]);
+                    var BJ6 = parseFloat(json["rows"][5]["半检数量"]);
+                    var BJ7 = parseFloat(json["rows"][6]["半检数量"]);
+                    var BS1 = parseFloat(json["rows"][0]["本烧数量"]);
+                    var BS2 = parseFloat(json["rows"][1]["本烧数量"]);
+                    var BS3 = parseFloat(json["rows"][2]["本烧数量"]);
+                    var BS4 = parseFloat(json["rows"][3]["本烧数量"]);
+                    var BS5 = parseFloat(json["rows"][4]["本烧数量"]);
+                    var BS6 = parseFloat(json["rows"][5]["本烧数量"]);
+                    var BS7 = parseFloat(json["rows"][6]["本烧数量"]);
+
+                    window.DayZL.data.datasets[0].data = [BJ1, BJ2, BJ3, BJ4, BJ5, BJ6, BJ7];
+                    window.DayZL.data.datasets[1].data = [BS1, BS2, BS3, BS4, BS5, BS6, BS7];
+                    window.DayZL.update();
+                }
+            });
+        }
+
         function timeUpdate() {
             loadData();
 
@@ -199,45 +229,27 @@
         function loadData() {
 
             //成型各项趋势图
-            window.DayZL.data.datasets[0].data = [
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80,
-                randomScalingFactor(10) + 80
-            ];
-            window.DayZL.data.datasets[1].data = [
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70,
-                randomScalingFactor(10) + 70
-            ];
-            window.DayZL.data.datasets[2].data = [
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60,
-                randomScalingFactor(10) + 60
-            ];
-            window.DayZL.data.datasets[3].data = [
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50,
-                randomScalingFactor(10) + 50
-            ];
-            window.DayZL.update();
+            //window.DayZL.data.datasets[0].data = [
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80,
+            //    randomScalingFactor(1) + 80
+            //];
+            //window.DayZL.data.datasets[1].data = [
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70,
+            //    randomScalingFactor(1) + 70
+            //];
+            //window.DayZL.update();
 
-            //半检缺陷top5
+            //成型缺陷top5
             window.DefectA.data.datasets[0].data = [
                 randomScalingFactor(8),
                 randomScalingFactor(8),
@@ -293,15 +305,7 @@
                         pointRadius: 15,
                         data: [0, 0, 0, 0, 0, 0, 0],
                         fill: false,
-                    }, {
-                        label: "干补",
-                        fill: false,
-                        backgroundColor: color(window.chartColors.orange).alpha(0.35).rgbString(),
-                        borderColor: window.chartColors.orange,
-                        borderWidth: 2,
-                        pointRadius: 15,
-                        data: [0, 0, 0, 0, 0, 0, 0]
-                    }, {
+                    },  {
                         label: "一烧",
                         fill: false,
                         backgroundColor: color(window.chartColors.blue).alpha(0.35).rgbString(),
@@ -309,14 +313,6 @@
                         borderWidth: 2,
                         pointRadius: 15,
                         data: [0, 0, 0, 0, 0, 0, 0]
-                    }, {
-                        label: "综合",
-                        fill: false,
-                        backgroundColor: color(window.chartColors.green).alpha(0.35).rgbString(),
-                        borderColor: window.chartColors.green,
-                        borderWidth: 2,
-                        pointRadius: 15,
-                        data: [0, 0, 0, 0, 0, 0, 0]
                     }]
                 },
                 type: 'line',
@@ -353,8 +349,8 @@
                             },
                             ticks: {
                                 min: 50,
-                                stepSize: 10,
-                                max: 100
+                                stepSize: 200,
+                                max: 1000
                             }
                         }]
                     }
@@ -364,7 +360,7 @@
             window.DayZL = new Chart(ctxDayZL, configDayZL);
             //===================================================
 
-            //半检缺陷TOP5===========================================
+            //成型缺陷TOP5===========================================
             window.configDefectA = {
                 data: {
                     labels: ['缺陷1', '缺陷2', '缺陷3'],