FIC_Solar/SolarPower/Models/Operation.cs
2021-06-23 11:10:27 +08:00

194 lines
6.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SolarPower.Models
{
public class Operation:Created
{
public int Id { get; set; }//流水號
public byte Delete { get; set; }//刪除
public string PlanId { get; set; }//計畫單號
public int PowerStationId { get; set; }//電站編號
public string SerialNumber { get; set; }//計畫單號用流水號
public int ScheduleNum { get; set; }//排程數字
public byte ScheduleType { get; set; }//排程屬性0:天 1:周 2:月 3:季 4:年
public int WorkDay { get; set; }//預期工作天數
public DateTime StartTime { get; set; }//開始時間
public byte Type { get; set; }//項目, 0:清洗 1:巡檢
public byte EmailType { get; set; }//email提醒種類0:當天 1:前一天 2:前兩天 3:前三天
public string Description { get; set; }//描述
}
public class PowerStationIdList
{
public string Text { get; set; }
public string Value { get; set; }
}
public class OperationCreatePlanModal : Created
{
private string startTime = "", endTime = "";
public int Id { get; set; }
public int PowerStationId { get; set; }
public int Type { get; set; }
public int ScheduleNum { get; set; }
public int ScheduleType { get; set; }
public int WorkDay { get; set; }
public string StartTime
{
get
{
if (!string.IsNullOrEmpty(startTime))
{
return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd");
}
else
{
return null;
}
}
set { startTime = value; }
}
public string EndTime
{
get
{
if (!string.IsNullOrEmpty(endTime))
{
return Convert.ToDateTime(endTime).ToString("yyyy-MM-dd");
}
else
{
return null;
}
}
set { endTime = value; }
}
public string Description { get; set; }
public int EmailType { get; set; }
}
public class OperationCreatePlan : OperationCreatePlanModal
{
public string PlanId { get; set; }
public string SerialNumber { get; set; }
private string updatedAt;
public int UpdatedBy { get; set; } //修改者
public string UpdatedAt { get { return Convert.ToDateTime(updatedAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { updatedAt = value; } } //修改時間
}
public class OperationPlanTable : OperationCreatePlan
{
public string TypeName { get; set; }
public string PowerStationName { get; set; }
public string Schedule { get; set; }
public string EmailTypeName { get; set; }
public string CreatedPerson { get; set; }
public string Function { get; set; }//功能
public string ScheduleDay { get; set; }
public string StartTimeString { get; set; }
public string CreateTimeString { get; set; }
}
public class PlanToRecord : Created
{
public int PowerStationId { get; set; }
public int WorkType { get; set; }
public string StartTime { get; set; }
public string EndTime { get; set; }
}
/// <summary>
/// 運維作業記錄的搜尋條件
/// </summary>
public class PostOperationRecodeFilter
{
public List<int> CityIds { get; set; } //縣市編號
public List<int> PowerStationIds { get; set; } //電站編號
public byte WorkType { get; set; } //工作項目
public string Range { get; set; } //取得搜尋範圍
}
/// <summary>
/// 運維作業記錄的表單
/// </summary>
public class OperationRecodeDataTable
{
private string startTime, endTime, finishTime;
public string PowerStationName { get; set; } //電站名稱
public string FormId { get; set; } //表單號
public byte WorkType { get; set; } //工作項目
public string WorkTypeText
{
get
{
Dictionary<int, string> pairs = new Dictionary<int, string>()
{
{ 0, "清洗"},
{ 1, "巡檢"},
{ 2, "維修"},
};
return pairs[WorkType];
}
} //工作項目名稱
public string FixDo { get; set; } //維修項目
public byte Status { get; set; } //狀態
public string StatusText
{
get
{
Dictionary<int, string> pairs = new Dictionary<int, string>()
{
{ 0, "未完成"},
{ 1, "完成"},
{ 2, "未完成-過期"},
{ 3, "完成-過期"},
};
return pairs[Status];
}
} //狀態名稱
public string WorkPersonName { get; set; } //處理人員
public string StartTime
{
get
{
if (!string.IsNullOrEmpty(startTime))
{
return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd");
}
else
{
return null;
}
}
set { startTime = value; }
} //開始時間
public string EndTime
{
get
{
if (!string.IsNullOrEmpty(endTime))
{
return Convert.ToDateTime(endTime).ToString("yyyy-MM-dd");
}
else
{
return null;
}
}
set { endTime = value; }
} // 結束時間
public string OperationPredict
{
get
{
return StartTime + " ~ " + EndTime;
}
} //本次作業預計
public string FileList { get; set; } //本次作業預計
public string FinishTime { get; set; } //本次作業預計
}
}