72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class ShipblockTask
|
|
{
|
|
// 기본 정보
|
|
public string PROJ_NO;
|
|
public string BLK_NO;
|
|
public string L1;
|
|
public string L2;
|
|
public string L3;
|
|
public string L4;
|
|
public string L5;
|
|
public string L6;
|
|
public string L7;
|
|
public string L8;
|
|
public string SHIP_TYPE;
|
|
|
|
// 계획 일정 (파란색 막대)
|
|
public string STDT21;
|
|
public string FNDT21;
|
|
public int DUR21;
|
|
|
|
// 실적 일정 (연두색 막대)
|
|
public string STDT23;
|
|
public string FNDT23;
|
|
public int DUR23;
|
|
|
|
// 추가 작업 코드들...
|
|
public string STDT43, FNDT43; public int DUR43;
|
|
public string STDT44, FNDT44; public int DUR44;
|
|
public string STDT46, FNDT46; public int DUR46;
|
|
public string STDT49, FNDT49; public int DUR49;
|
|
public string STDT4A, FNDT4A; public int DUR4A;
|
|
public string STDT4B, FNDT4B; public int DUR4B;
|
|
public string STDT62, FNDT62; public int DUR62;
|
|
|
|
[NonSerialized] public float CalculatedProgress;
|
|
|
|
public DateTime? GetPlanStart() => ParseDate(STDT21);
|
|
public DateTime? GetPlanEnd() => ParseDate(FNDT21);
|
|
public DateTime? GetActualStart() => ParseDate(STDT23);
|
|
public DateTime? GetActualEnd() => ParseDate(FNDT23);
|
|
|
|
private DateTime? ParseDate(string dateStr)
|
|
{
|
|
if (string.IsNullOrEmpty(dateStr) || dateStr == "null") return null;
|
|
if (DateTime.TryParseExact(dateStr, "yyyyMMdd", null, System.Globalization.DateTimeStyles.None, out DateTime date))
|
|
return date;
|
|
return null;
|
|
}
|
|
|
|
public string GetDisplayName()
|
|
{
|
|
// L1~L8 중 가장 하위 유효값
|
|
if (!string.IsNullOrEmpty(L8)) return L8;
|
|
if (!string.IsNullOrEmpty(L7)) return L7;
|
|
if (!string.IsNullOrEmpty(L6)) return L6;
|
|
if (!string.IsNullOrEmpty(L5)) return L5;
|
|
if (!string.IsNullOrEmpty(L4)) return L4;
|
|
if (!string.IsNullOrEmpty(L3)) return L3;
|
|
if (!string.IsNullOrEmpty(L2)) return L2;
|
|
return L1 ?? BLK_NO;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class ShipblockDataWrapper
|
|
{
|
|
public List<ShipblockTask> items;
|
|
} |