feat 工作网格

This commit is contained in:
2025-02-18 16:10:38 +08:00
parent 66df7b809b
commit c9df417799
26 changed files with 1070 additions and 2 deletions

View File

@@ -0,0 +1,72 @@
using Dlhis.Entity.Basic.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
namespace Dlhis.Basic.WorkGrids.Response;
public class WorkGridTimePeriodPageResponse
{
public long Id { get; set; }
/// <summary>
/// 班次
/// </summary>
public WorkGridTimePeriodEnumType Type { get; set; }
/// <summary>
/// 班次描述
/// </summary>
public string TypeDesc => Type.GetDescription();
/// <summary>
/// 前
/// </summary>
public int Before { get; set; }
/// <summary>
/// 后
/// </summary>
public int After { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public TimeOnly Start { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public TimeOnly End { get; set; }
/// <summary>
/// 配置描述
/// </summary>
public string Description
{
get { return Type.GetDescription() + "打卡时间从" + Start + "到" + End + "\r\n" + "上班允许提前" + GetTimeDescription(Before) + "\r\n" + "下班允许延迟" + GetTimeDescription(After); }
}
private string GetTimeDescription(int minutes)
{
string d;
if (minutes >= 60)
{
var remaining = minutes % 60;
d = $"{minutes / 60}小时";
if (remaining > 0)
{
d += $"{remaining}分钟";
}
}
else
{
d = $"{minutes}分钟";
}
return d;
}
}