diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 08985a7..6904700 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -970,6 +970,23 @@ namespace FrontendWebApi.ApiControllers "第二校區總盤", "薄膜分盤" }; + List need_green_device = new List + { + "第一校區總盤", + "圖資大樓總盤", + "教學大樓總盤", + "教學大樓總盤", + "電子館分盤", + "機械館分盤", + "電機館分盤", + "學5舍總盤", + "8眷舍分盤", + "企教分盤", + "7眷舍分盤", + "第二校區總盤", + "薄膜一館分盤", + "薄膜二館分盤" + }; int count_index = 1; string last_build = ""; string last_device = ""; @@ -1026,12 +1043,12 @@ namespace FrontendWebApi.ApiControllers string deviceFullName = r.device_full_name; columnIndex = 0; - if (last_device == "電機館分盤") + if (last_device == "電機館分盤" || last_device == "薄膜分盤") { flag = false; } - if (flag && buildingName == "化工館" && deviceFullName == "電機館分盤") + if ((flag && buildingName == "化工館" && deviceFullName == "電機館分盤") || (flag && buildingName == "綠能中心" && deviceFullName == "薄膜分盤")) { row = sheet.GetRow(rowIndex) ?? sheet.CreateRow(rowIndex); cell = row.GetCell(columnIndex++) ?? row.CreateCell(columnIndex++); @@ -1046,7 +1063,7 @@ namespace FrontendWebApi.ApiControllers foreach (var timeStampData in buildingSumData[last_build]) { cell = row.GetCell(columnIndex++) ?? row.CreateCell(columnIndex++); - cell.SetCellValue(timeStampData.Value); + cell.SetCellValue(timeStampData.Value.ToString()); } rowIndex++; @@ -1096,7 +1113,7 @@ namespace FrontendWebApi.ApiControllers cell = row.GetCell(columnIndex++) ?? row.CreateCell(columnIndex++); cell.SetCellValue(deviceFullName); - if (total_flag) + if (total_flag || need_green_device.Contains(deviceFullName)) { cell.CellStyle = greenCellStyle; } @@ -1260,7 +1277,7 @@ order by e.report_priority, a.priority"; { timeStamp = "last year different", // 或者是您所需的日期格式 device_number = x.device_number, - avg_rawdata = Math.Round(double.Parse(x.searchM) - double.Parse(x.lastY), 2).ToString() + avg_rawdata = Math.Round(double.Parse(x.searchM) - double.Parse(x.lastY)).ToString() }) ); diff --git a/FrontendWebApi/template/ElectricEachTotalCompare_temp.xlsx b/FrontendWebApi/template/ElectricEachTotalCompare_temp.xlsx index c8f3032..1fed71c 100644 Binary files a/FrontendWebApi/template/ElectricEachTotalCompare_temp.xlsx and b/FrontendWebApi/template/ElectricEachTotalCompare_temp.xlsx differ