修改警告export excel

This commit is contained in:
dev02 2022-11-10 11:08:24 +08:00
parent d4d0c4d7b2
commit 2a1e0d8575
2 changed files with 33 additions and 15 deletions

View File

@ -121,11 +121,11 @@ namespace FrontendWebApi.ApiControllers
cell = row.CreateCell(i); cell = row.CreateCell(i);
if (i == 0) if (i == 0)
{ {
cell.SetCellValue(a.building_tag + a.floor_tag); cell.SetCellValue(a.buildingFloorName);
} }
if (i == 1) if (i == 1)
{ {
cell.SetCellValue(a.error_code); cell.SetCellValue(a.uuid);
} }
if (i == 2) if (i == 2)
{ {
@ -133,19 +133,19 @@ namespace FrontendWebApi.ApiControllers
} }
if (i == 3) if (i == 3)
{ {
cell.SetCellValue(a.error_type); cell.SetCellValue(a.alarmClass);
} }
if (i == 4) if (i == 4)
{ {
cell.SetCellValue(a.device_number); cell.SetCellValue(a.sourceName_zh);
} }
if (i == 5) if (i == 5)
{ {
cell.SetCellValue(a.error_reason); cell.SetCellValue(a.msgText);
} }
if (i == 6) if (i == 6)
{ {
cell.SetCellValue(a.ACKconfirm); cell.SetCellValue(a.ackState_zh);
} }
if (i == 7) if (i == 7)
{ {

View File

@ -1,14 +1,32 @@
namespace FrontendWebApi.Models using System;
using System.Collections.Generic;
namespace FrontendWebApi.Models
{ {
public class Alert : Actor public class Alert
{ {
public string building_tag { get; set; } public string buildingFloorName { get; set; } //building_name and floor_name
public string floor_tag { get; set; } public string uuid { get; set; } //error_code
public string error_code { get; set; } public string alarmClass { get; set; } //error_type
public string error_type { get; set; } public string msgText { get; set; } //error_reason
public string device_number { get; set; } public string sourceName_zh { get; set; } //device_number
public string error_reason { get; set; } public string ackState { get; set; } //ACKconfirm: Acked/Unacked
public string ACKconfirm { get; set; } public DateTime timestamp { get; set; }//發生時間 occur time
public string formId { get; set; } public string formId { get; set; }
public string ackState_zh
{
get
{
Dictionary<string, string> name = new Dictionary<string, string>()
{
{ "Acked" , "確認" },
{ "Unacked" , "未確認" }
};
return name[ackState];
}
}
public string created_at { get { return timestamp.ToString(); } set { } }
public string Created_at { get { return Convert.ToDateTime(created_at).ToString("yyyy-MM-dd HH:mm:ss"); } set { created_at = value; } } //發生時間顯示
} }
} }