Asoka.Wang 0a2e2d9b18 123
2025-09-02 18:52:35 +08:00

63 lines
1.9 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.ComponentModel.DataAnnotations;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;
namespace NPP.SmartSchedue.Api.Contracts.Services.Time.Input;
/// <summary>
/// 周期性设置输入模型
/// 用于按周模式批量设置班次不可用标记
/// </summary>
public class WeeklyPatternInput
{
/// <summary>
/// 员工ID
/// </summary>
[Required(ErrorMessage = "员工ID不能为空")]
public long PersonnelId { get; set; }
/// <summary>
/// 设置开始日期
/// </summary>
[Required(ErrorMessage = "开始日期不能为空")]
public DateTime StartDate { get; set; }
/// <summary>
/// 设置结束日期
/// </summary>
[Required(ErrorMessage = "结束日期不能为空")]
public DateTime EndDate { get; set; }
/// <summary>
/// 周模式配置:每周哪些天的哪些班次不可用
/// 键: 星期几 (0=周日, 1=周一, 2=周二, ..., 6=周六)
/// 值: 该星期对应的不可用班次ID列表
/// 例如: {1: [1,2], 5: [3]} 表示每周一的1,2班次不可用每周五的3班次不可用
/// </summary>
[Required(ErrorMessage = "周模式配置不能为空")]
public Dictionary<int, List<long>> WeeklyPattern { get; set; }
/// <summary>
/// 不可用原因类型
/// </summary>
[Required(ErrorMessage = "原因类型不能为空")]
public UnavailabilityReasonType ReasonType { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[StringLength(200, ErrorMessage = "备注长度不能超过200字符")]
public string Remark { get; set; }
/// <summary>
/// 优先级权重
/// </summary>
[Range(1, 100, ErrorMessage = "优先级权重必须在1-100之间")]
public int Priority { get; set; } = 1;
/// <summary>
/// 是否覆盖已有标记
/// </summary>
public bool OverwriteExisting { get; set; } = false;
}