Beispiel #1
0
        public void Start(GetTime gt)
        {
            OpenExcel();
            today            = gt.getDateToday();
            yestoday         = gt.getDateYestoday();
            workface         = gt.getWorkFace();
            sqlquary_channel = string.Format(@"SELECT DISTINCT MPId, Depth, TunnelName FROM DataInfo 
                                                  JOIN MeasurePoint ON MPId=Id 
                                                  WHERE AcquisitionTime BETWEEN '{0} 16:00:00'AND '{1} 16:00:00' ", yestoday, today);
            sqlquary_valus   = string.Format(@"SELECT CreatTime, Channel, MPId, Location, DataInfo.Value, InitialValue, TunnelName, Depth
                                                FROM MsgForewarn 
                                                INNER JOIN DataInfo ON Channel = MPId AND CreatTime = AcquisitionTime
                                                LEFT JOIN MeasurePoint ON Id=Channel   
                                                WHERE CreatTime BETWEEN '{0} 16:00:00' AND  '{1} 16:00:00' AND Location LIKE '{2}%'", yestoday, today, workface);
            string pi7   = sqlquary_channel + " AND Depth=7 AND TunnelName LIKE '皮%'";
            string pi12  = sqlquary_channel + " AND Depth=12 AND TunnelName LIKE '皮%'";
            string gui7  = sqlquary_channel + " AND Depth=7 AND TunnelName LIKE '轨%'";
            string gui12 = sqlquary_channel + " AND Depth=12 AND TunnelName LIKE '轨%'";

            string[] sql_quary = new string[] { pi7, pi12, gui7, gui12 };
            for (int i = 0; i < sql_quary.Length; i++)
            {
                //查询后返回 唯一的channel 组成的datatable
                DataTable dt = GetDataTable(sql_quary[i]);
                //计算
                Calculate(dt);
                //double[] number = Calculate(ways[i],deeps[i],dt);
            }//end ToExcel(...)
            Analysis();
            AddPictures();
            Subsidence();
            SaveReportFile();
        }
Beispiel #2
0
 public void Start(GetTime gt)
 {
     today    = gt.getDateToday();
     workface = gt.getWorkFace();
     OpenExecl();
     ToExcel();
     workBook_excel.Save(excelFilePath, SaveFormat.Xlsx);
 }
Beispiel #3
0
        public void Start(GetTime gt, double[,] ava)
        {
            this.ava      = ava;
            this.today    = gt.getDateToday();
            this.yestoday = gt.getDateYestoday();
            this.workface = gt.getWorkFace();

            openexcel();
            ToExcel();
            sc.GetChart();
            wb.Save(path, SaveFormat.Xlsx);
        }
Beispiel #4
0
 public void Start(GetTime gt, double ava)
 {
     today    = gt.getDateToday();
     yestoday = gt.getDateYestoday();
     this.ava = ava;
     OpenExcel();
     Calculate();
     ToExcel();
     AddPicures();
     workBook_excel.Save(excelFilePath, SaveFormat.Xlsx);
     sqlConn.Close();
 }
Beispiel #5
0
        public void Start(GetTime gt)
        {
            //打开excel
            OpenExcel();
            today = gt.getDateToday();
            string sqlquery_order  = string.Format(sqlquery + " WHERE 日期 = '{0}' AND 胶运 = 1 ORDER BY 单孔最大值 DESC", today);
            string sqlquery_assist = string.Format(sqlquery + " WHERE 日期 = '{0}' AND 胶运 = 0 ORDER BY 单孔最大值 DESC", today);

            dataTable_j = GetDataTable(sqlquery_order);
            dataTable_f = GetDataTable(sqlquery_assist);
            //计算胶运 辅运
            Calculate_jiaoyun(dataTable_j);
            Calculate_fuyun(dataTable_f);

            SaveReportFile();
        }
Beispiel #6
0
 public void Start(GetTime gt)
 {
     today = gt.getDateToday();
     OpenExcel();
     ToExcel();
 }
Beispiel #7
0
        public void Start2(GetTime gt)
        {
            //OpenExcel();
            string    sql        = string.Format(@"SELECT * FROM 工作面来压情况  WHERE 日期='{0}' AND 工作面='{1}' ", gt.getDateToday(), gt.getWorkFace());
            DataTable datatable  = GetDataTable(sql);
            DataRow   dr         = datatable.Rows[0];
            Cell      cellItem1  = workSheet_excel.Cells["M2"];
            Cell      cellItem2  = workSheet_excel.Cells["N2"];
            Cell      cellItem3  = workSheet_excel.Cells["O2"];
            Cell      cellItem4  = workSheet_excel.Cells["P2"];
            Cell      cellItem5  = workSheet_excel.Cells["Q2"];
            Cell      cellItem6  = workSheet_excel.Cells["S2"];
            Cell      cellItem7  = workSheet_excel.Cells["M4"];
            Cell      cellItem8  = workSheet_excel.Cells["O4"];
            Cell      cellItem9  = workSheet_excel.Cells["R4"];
            Cell      cellItem10 = workSheet_excel.Cells["M5"];
            Cell      cellItem11 = workSheet_excel.Cells["R5"];


            cellItem1.PutValue(dr["已来压次数"].ToString());
            if (dr["上次位置"].ToString() != "0")
            {
                cellItem2.PutValue(dr["上次位置"].ToString());
            }
            cellItem3.PutValue(dr["上次时间"].ToString());
            if (dr["步距"].ToString() != "0")
            {
                cellItem4.PutValue(dr["步距"].ToString());
            }
            cellItem5.PutValue(dr["本次来压情况"].ToString());
            if (dr["持续距离"].ToString() != "0")
            {
                cellItem6.PutValue(dr["持续距离"].ToString());
            }
            cellItem7.PutValue(dr["预计下次时间"].ToString());
            if (dr["预计下次位置"].ToString() != "0")
            {
                cellItem8.PutValue(dr["预计下次位置"].ToString());
            }
            if (dr["预计下次步距"].ToString() != "0")
            {
                cellItem9.PutValue(dr["预计下次步距"].ToString());
            }
            cellItem10.PutValue(dr["下一危险区域名称"].ToString());
            if (dr["距离危险区域"].ToString() != "0")
            {
                cellItem11.PutValue(dr["距离危险区域"].ToString());
            }
            workBook_excel.Save(excelFilePath, SaveFormat.Xlsx);
        }
Beispiel #8
0
        public void Start(GetTime gt)
        {
            string    sqlquary  = string.Format(@"SELECT * FROM 基本数据表 WHERE 日期='{0}' AND 工作面='{1}' ", gt.getDateToday(), gt.getWorkFace()); // 替换成 new GetTime().getDateToday()
            DataTable datatable = GetDataTable(sqlquary);

            ToExcel(datatable);
            workBook_excel.Save(excelFilePath, SaveFormat.Xlsx);
        }
Beispiel #9
0
 public void MergeAllSheet(GetTime gt)
 {
     Spire.Xls.Workbook wb = new Spire.Xls.Workbook();
     wb.LoadFromFile(excelFilePath);
     Spire.Xls.Workbook  destWorkbook = new Spire.Xls.Workbook();
     Spire.Xls.Worksheet destSheet    = destWorkbook.Worksheets[0];
     for (int i = 1; i <= wb.Worksheets.Count + 6; i++)
     {
         if (wb.Worksheets["Sheet" + i.ToString()] != null)
         {
             wb.Worksheets["Sheet" + i.ToString()].AllocatedRange.Copy(destSheet.Range[destSheet.LastRow + 3, 1]);
         }
     }
     destWorkbook.SaveToFile(@"..\..\modelFile\" + string.Format("Excel_{0}.xls", gt.getDateToday()));
 }
Beispiel #10
0
        public void MergeAllSheet(GetTime gt)
        {
            Spire.Xls.Workbook wb = new Spire.Xls.Workbook();
            wb.LoadFromFile(excelFilePath);
            Spire.Xls.Workbook  destWorkbook = new Spire.Xls.Workbook();
            Spire.Xls.Worksheet destSheet    = destWorkbook.Worksheets[0];
            wb.Worksheets["Sheet1"].AllocatedRange.Copy(destSheet.Range[1, 1]);
            destSheet.Range[1, 1].Text = string.Format("营盘壕煤矿{0}工作面矿压综合分析日报表", gt.getWorkFace());
            int lastrow = destSheet.Range.RowCount;

            if (wb.Worksheets["Sheet2"] != null)
            {
                wb.Worksheets["Sheet2"].AllocatedRange.Copy(destSheet.Range[destSheet.Range.RowCount + 1, 1]);
                if (wb.Worksheets["Sheet3"] != null)
                {
                    wb.Worksheets["Sheet3"].AllocatedRange.Copy(destSheet.Range[lastrow + 1, 11]);
                }
                for (int i = 4; i <= wb.Worksheets.Count + 6; i++)
                {
                    if (wb.Worksheets["Sheet" + i.ToString()] != null)
                    {
                        wb.Worksheets["Sheet" + i.ToString()].AllocatedRange.Copy(destSheet.Range[destSheet.Range.RowCount + 1, 1]);
                    }
                }
            }
            destWorkbook.SaveToFile(@"..\..\modelFile\" + string.Format("Excel_{0}.xls", gt.getDateToday()));
        }