using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities.Auditing;
using ContractService.Authorization.Users;
using ContractService.CommonManager.States;
using ContractService.Configuration;
namespace ContractService.LegalContract
{
///
/// 合同关键点
///
[Table("Ls_LegalContractKeyPoints")]
public class LegalContractKeyPointInfo : FullAuditedEntity
{
public LegalContractKeyPointInfo()
{
NotifyType = NotifyTypeDefinition.None;
}
///
/// 父关键点
///
[MaxLength(IwbConsts.PrimaryKey)]
public string ParentNo { get; set; }
[ForeignKey("ParentNo")]
public LegalContractKeyPointInfo ParentInfo { get; set; }
///
/// 关键点名称
///
[MaxLength(50)]
public string Name { get; set; }
///
/// 标签
///
[MaxLength(200)]
public string Tags { get; set; }
///
/// 关键点描述
///
[MaxLength(500)]
public string Description { get; set; }
///
/// 关键点等级
///
public int KeyPointLevel { get; set; }
///
/// 关键点状态
///
public int KeyPointState { get; set; }
///
/// 过期日期
///
public DateTime? ExpireDate { get; set; }
///
/// 开始报警日期
///
public DateTime? AlarmDate { get; set; }
public DateTime? ExecuteDate { get; set; }
///
/// 父关键点执行后多少天过期
///
public int ExpireDay { get; set; }
///
/// 父关键点执行后多少天报警
///
public int AlarmDay { get; set; }
///
/// 路径
///
[MaxLength(500)]
public string KeyPointPath { get; set; }
///
/// 合同信息
///
[MaxLength(IwbConsts.PrimaryKey)]
public string ContractNo { get; set; }
[ForeignKey("ContractNo")]
public LegalContractInfo ContractInfo { get; set; }
[MaxLength(1000)]
public string Remark { get; set; }
public int NotifyType { get; set; }
}
public class NotifyTypeDefinition
{
public const int None = 0;
public const int Alarm = 1;
public const int Expire = 2;
}
///
/// 关键点状态定义
///
public class LegalKeyPointStateDefinition
{
///
/// 新建
///
public const int New = 1;
///
/// 待执行
///
public const int Run = 2;
///
/// 已执行
///
public const int Executed = 3;
///
/// 挂起
///
public const int Hang = 4;
///
/// 结束
///
public const int End = 5;
public static string GetName(int definition, IStatesManager statesManager)
{
return statesManager.GetDisplayValue("KeyPoint", "State", definition + "");
}
}
///
/// 关键点级别定义
///
public class LegalKeyPointLevelDefinition
{
///
/// 一般
///
public const int Common= 1;
///
/// 重要
///
public const int Important = 2;
///
/// 紧急
///
public const int Urgent = 3;
public static string GetName(int definition, IStatesManager statesManager)
{
return statesManager.GetDisplayValue("KeyPoint", "Level", definition + "");
}
}
}