68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
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 BatchCellInput
|
|
{
|
|
/// <summary>
|
|
/// 员工ID
|
|
/// </summary>
|
|
[Required(ErrorMessage = "员工ID不能为空")]
|
|
public long PersonnelId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 要设置的单元格列表
|
|
/// </summary>
|
|
[Required(ErrorMessage = "单元格列表不能为空")]
|
|
[MinLength(1, ErrorMessage = "至少需要指定一个单元格")]
|
|
public List<CellPosition> Cells { 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; } = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单元格位置信息
|
|
/// 表示网格中的一个特定单元格(日期+班次)
|
|
/// </summary>
|
|
public class CellPosition
|
|
{
|
|
/// <summary>
|
|
/// 日期
|
|
/// </summary>
|
|
[Required(ErrorMessage = "日期不能为空")]
|
|
public DateTime Date { get; set; }
|
|
|
|
/// <summary>
|
|
/// 班次ID
|
|
/// </summary>
|
|
[Required(ErrorMessage = "班次ID不能为空")]
|
|
public long ShiftId { get; set; }
|
|
} |