ÎļþÃû´Ó Application/IStation.Application.DataFile/Report/PdfCreate/Eta_Month_ReportPdf.cs ÐÞ¸Ä |
| | |
| | | /// çææ¥è¡¨ |
| | | /// </summary> |
| | | /// <param name="station">æ³µç«ä¿¡æ¯</param> |
| | | /// <param name="sum">æ±æ»</param> |
| | | /// <param name="datatime">æ¶é´</param> |
| | | /// <param name="pipeList">æºæ³µç®¡è·¯å表</param> |
| | | /// <param name="list">æºæ³µä¿¡æ¯å表</param> |
| | | /// <param name="monthlist">æ³µç«æå表</param> |
| | | /// <param name="path">è·¯å¾</param> |
| | | /// <returns></returns> |
| | | public bool Create4Stream(Station station, List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list,string path) |
| | | public bool Create4Stream(Station station, Model.EtaSumMultiMonthRecord sum, List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list, string datatime, string path) |
| | | { |
| | | InitialFont(); |
| | | //åå§åæ é¢ä¸çLOGOå¾ç |
| | |
| | | _document.SetMargins(-40, -40, 40, 40); |
| | | _writer = PdfWriter.GetInstance(_document, new FileStream(path, FileMode.Create)); |
| | | _writer.PageEvent = new CreatHeaderAndFoot(); |
| | | CreatestationInfoPage(station, pipeList, list);//产åä¿¡æ¯ |
| | | CreatestationInfoPage(station, pipeList, sum, list, datatime);//产åä¿¡æ¯ |
| | | _document.Close(); |
| | | return true; |
| | | } |
| | |
| | | /// <param name="sum"></param> |
| | | /// <param name="pipeList"></param> |
| | | /// <param name="list"></param> |
| | | public void CreatestationInfoPage(Station station, List<Model.PipeLine> pipeList, List<Model.EtaSumSingleMonthRecord> list) |
| | | public void CreatestationInfoPage(Station station, List<Model.PipeLine> pipeList, Model.EtaSumMultiMonthRecord sum, List<Model.EtaSumSingleMonthRecord> list, string dateTime) |
| | | { |
| | | _document.Open(); |
| | | _document.NewPage(); |
| | |
| | | Dt = Math.Round((double)dt, 2).ToString(); |
| | | if (dt > 1000) |
| | | Dt = Math.Round((double)dt, 1).ToString(); |
| | | CreatestationTable(station, runcout, Qt, Dt); |
| | | CreatestationTable(station,sum, runcout,dateTime); |
| | | CreatestationInfoTable(pipeList, list, station.ID); |
| | | PdfPTable table1 = new PdfPTable(3); |
| | | float[] widths = { 80, 140, 300 }; |
| | |
| | | { |
| | | PdfPTable table = new PdfPTable(1); |
| | | PdfPCell cell = new PdfPCell(); |
| | | cell = CreateCell2("æ³µç«è½ææ¥æ¥è¡¨", _fontSize13_bold, 1, 1, 50, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2("æ³µç«è½æææ¥è¡¨", _fontSize13_bold, 1, 1, 50, 0, Element.ALIGN_CENTER); |
| | | cell.HorizontalAlignment = Element.ALIGN_CENTER;//æ°´å¹³å±
ä¸ |
| | | cell.VerticalAlignment = Element.ALIGN_MIDDLE;//åç´å±
ä¸ |
| | | table.AddCell(cell); |
| | |
| | | /// 设å¤ä¿¡æ¯ |
| | | /// </summary> |
| | | // |
| | | public void CreatestationTable(Station station, int cout, string qt, string dt) |
| | | public void CreatestationTable(Station station, EtaSumMultiMonthRecord sum, int cout, string datatime) |
| | | { |
| | | PdfPTable table = new PdfPTable(4); |
| | | PdfPCell cell = new PdfPCell(); |
| | |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ»çµè½" + " (A)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2(dt, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2(sum.Dt.ToString(), _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ»æµé" + " (m³)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2("便°´é" + " (t)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2(qt, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2(sum.Qt.ToString(), _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ¥åæ¥æ", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2(datatime, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("使ç¨ç¶æ", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | |
| | | var EnginePump = ProductList.Find(x => x.BelongID == stationID && x.Name == EnginePumpLine.Name); |
| | | var Pump = seviceEnginePump.GetChildPumpByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | var Motor = seviceEnginePump.GetChildMotorByEnginePumpID(EnginePump.CorpID, EnginePump.ID); |
| | | |
| | | cell = CreateCell2(EnginePump?.Name, _fontSize11, 1, 4, 40, 0, Element.ALIGN_CENTER); |
| | | string EnginePumpName = ""; |
| | | if (EnginePump != null) |
| | | EnginePumpName = EnginePump.Name; |
| | | cell = CreateCell2(EnginePumpName, _fontSize11, 1, 5, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("ç¶æ", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | |
| | | if (usetatus == 0) |
| | | cell.BackgroundColor = BaseColor.Gray; |
| | | table.AddCell(cell); |
| | | |
| | | cell = CreateCell2("è¿è¡æ¶é´" + " (h)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | var runtime = Math.Round((decimal)item.RunTime / 3600, 1); |
| | |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ³µåå·", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2(Pump?.Code, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | string PumpCode = ""; |
| | | if (Pump != null) |
| | | PumpCode = Pump.Code; |
| | | cell = CreateCell2(PumpCode, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("çµæºåå·", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2(Motor?.Code, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | string MotorCode = ""; |
| | | if (Pump != null) |
| | | MotorCode = Motor.Code; |
| | | cell = CreateCell2(MotorCode, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | cell = CreateCell2("æ»çµè½" + " (A)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | |
| | | wpavg = Math.Round((double)item.WPavg, 2).ToString(); |
| | | if (item.WPavg > 1000) |
| | | wpavg = Math.Round((double)item.WPavg, 1).ToString(); |
| | | cell = CreateCell2(item.WPavg < 1 ? @"/" : wpavg, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | cell = CreateCell2(item.WPavg == 0 ? @"/" : wpavg, _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | |
| | | cell = CreateCell2("èç
¤" + " (t)", _fontSize11, 1, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | var run_coal = item.Pavg + item.BootTimes / 3600f; |
| | | var value = ((run_coal / 10000f) * 2.7978); |
| | | cell = CreateCell2(value == 0 ? "/" : Math.Round((double)value, 5).ToString(), _fontSize11, 3, 1, 40, 0, Element.ALIGN_CENTER); |
| | | table.AddCell(cell); |
| | | } |
| | | table.SetWidths(widths); |
| | |
| | | table1.WidthPercentage = percentage;//è¡¨æ ¼æå çé¢çç¾åæ¯ |
| | | return table1; |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ® å¹´ å æï¼è·åå½æç¬¬ä¸å¤© |
| | | /// </summary> |
| | | /// <param name="years">å¹´</param> |
| | | /// <param name="months">æ</param> |
| | | /// <returns>è¿åï¼yyyy-MM-dd å½¢å¼</returns> |
| | | public DateTime GetFirstDayByYearMonth(int years, int months) |
| | | { |
| | | DateTime datetime = DateTime.Parse(years + "-" + months + "-" + "15"); |
| | | return datetime.AddDays(1 - datetime.Day); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ® å¹´ å æï¼è·å彿æåä¸å¤© |
| | | /// </summary> |
| | | /// <param name="years">å¹´</param> |
| | | /// <param name="months">æ</param> |
| | | /// <returns>è¿åï¼yyyy-MM-dd å½¢å¼</returns> |
| | | public DateTime GetLastDayByYearMonth(int years, int months) |
| | | { |
| | | DateTime datetime = DateTime.Parse(years + "-" + months + "-" + "15"); |
| | | return datetime.AddDays(1 - datetime.Day).AddMonths(1).AddDays(-1); |
| | | } |
| | | } |
| | | } |
| | | #endregion |