Developer 058d8edffa 添加通知系统和工作任务分配功能
- 新增通知系统完整架构,包含通知设置、历史记录、任务管理等核心功能
- 实现工作任务分配服务,支持人员和设备的智能分配
- 添加人员分组管理功能,支持灵活的通知目标配置
- 完善相关枚举定义和数据传输对象

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-05 08:34:01 +08:00

147 lines
3.5 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.ComponentModel.DataAnnotations;
using FreeSql.DataAnnotations;
using ZhonTai.Admin.Core.Entities;
using NPP.SmartSchedue.Api.Contracts.Core.Consts;
using NPP.SmartSchedue.Api.Contracts.Core.Enums;
namespace NPP.SmartSchedue.Api.Contracts.Domain.Notification;
/// <summary>
/// 通知历史记录实体
/// 决策点8简单记录记录发送时间、接收人、成功失败状态
/// 决策点5不支持多租户继承EntityBase
/// </summary>
[Table(Name = DbConsts.TableNamePrefix + "notification_history")]
public partial class NotificationHistoryEntity : EntityBase
{
#region
/// <summary>
/// 通知设置ID
/// </summary>
[Required(ErrorMessage = "通知设置ID不能为空")]
public long NotificationSettingId { get; set; }
/// <summary>
/// 接收人员ID
/// </summary>
[Required(ErrorMessage = "接收人员ID不能为空")]
public long RecipientPersonnelId { get; set; }
/// <summary>
/// 接收人员姓名
/// </summary>
[Column(StringLength = 100)]
public string RecipientPersonnelName { get; set; } = "";
/// <summary>
/// 接收人员邮箱
/// </summary>
[Column(StringLength = 200)]
public string RecipientEmail { get; set; } = "";
#endregion
#region
/// <summary>
/// 通知方式
/// </summary>
public int NotificationType { get; set; }
/// <summary>
/// 通知标题
/// </summary>
[Column(StringLength = 500)]
public string NotificationTitle { get; set; } = "";
/// <summary>
/// 通知内容
/// </summary>
[Column(DbType = "text")]
public string NotificationContent { get; set; } = "";
#endregion
#region
/// <summary>
/// 计划发送时间
/// </summary>
public DateTime PlannedSendTime { get; set; }
/// <summary>
/// 实际发送时间
/// </summary>
public DateTime? ActualSendTime { get; set; }
/// <summary>
/// 发送状态
/// </summary>
public int SendStatus { get; set; } = (int)NotificationStatusEnum.Pending;
/// <summary>
/// 发送结果信息
/// </summary>
[Column(StringLength = 1000)]
public string SendResult { get; set; } = "";
/// <summary>
/// 错误信息
/// </summary>
[Column(StringLength = 1000)]
public string ErrorMessage { get; set; } = "";
#endregion
#region
/// <summary>
/// 重试次数
/// </summary>
public int RetryCount { get; set; } = 0;
/// <summary>
/// 最大重试次数
/// </summary>
public int MaxRetryCount { get; set; } = 3;
/// <summary>
/// 下次重试时间
/// </summary>
public DateTime? NextRetryTime { get; set; }
#endregion
#region
/// <summary>
/// 业务类型(如:工作任务、设备维护等)
/// </summary>
[Column(StringLength = 100)]
public string BusinessType { get; set; } = "";
/// <summary>
/// 业务ID工作任务ID、设备ID等
/// </summary>
public long? BusinessId { get; set; }
/// <summary>
/// 业务数据JSON格式存储相关业务信息
/// </summary>
[Column(DbType = "text")]
public string BusinessData { get; set; } = "";
#endregion
#region
/// <summary>
/// 通知设置实体
/// </summary>
[Navigate("NotificationSettingId")]
public NotificationSettingEntity? NotificationSetting { get; set; }
#endregion
}