LegalContractKeyPointInfo.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. using Abp.Domain.Entities.Auditing;
  5. using ContractService.Authorization.Users;
  6. using ContractService.CommonManager.States;
  7. using ContractService.Configuration;
  8. namespace ContractService.LegalContract
  9. {
  10. /// <summary>
  11. /// 合同关键点
  12. /// </summary>
  13. [Table("Ls_LegalContractKeyPoints")]
  14. public class LegalContractKeyPointInfo : FullAuditedEntity<string, User>
  15. {
  16. public LegalContractKeyPointInfo()
  17. {
  18. NotifyType = NotifyTypeDefinition.None;
  19. }
  20. /// <summary>
  21. /// 父关键点
  22. /// </summary>
  23. [MaxLength(IwbConsts.PrimaryKey)]
  24. public string ParentNo { get; set; }
  25. [ForeignKey("ParentNo")]
  26. public LegalContractKeyPointInfo ParentInfo { get; set; }
  27. /// <summary>
  28. /// 关键点名称
  29. /// </summary>
  30. [MaxLength(50)]
  31. public string Name { get; set; }
  32. /// <summary>
  33. /// 标签
  34. /// </summary>
  35. [MaxLength(200)]
  36. public string Tags { get; set; }
  37. /// <summary>
  38. /// 关键点描述
  39. /// </summary>
  40. [MaxLength(500)]
  41. public string Description { get; set; }
  42. /// <summary>
  43. /// 关键点等级
  44. /// </summary>
  45. public int KeyPointLevel { get; set; }
  46. /// <summary>
  47. /// 关键点状态
  48. /// </summary>
  49. public int KeyPointState { get; set; }
  50. /// <summary>
  51. /// 过期日期
  52. /// </summary>
  53. public DateTime? ExpireDate { get; set; }
  54. /// <summary>
  55. /// 开始报警日期
  56. /// </summary>
  57. public DateTime? AlarmDate { get; set; }
  58. public DateTime? ExecuteDate { get; set; }
  59. /// <summary>
  60. /// 父关键点执行后多少天过期
  61. /// </summary>
  62. public int ExpireDay { get; set; }
  63. /// <summary>
  64. /// 父关键点执行后多少天报警
  65. /// </summary>
  66. public int AlarmDay { get; set; }
  67. /// <summary>
  68. /// 路径
  69. /// </summary>
  70. [MaxLength(500)]
  71. public string KeyPointPath { get; set; }
  72. /// <summary>
  73. /// 合同信息
  74. /// </summary>
  75. [MaxLength(IwbConsts.PrimaryKey)]
  76. public string ContractNo { get; set; }
  77. [ForeignKey("ContractNo")]
  78. public LegalContractInfo ContractInfo { get; set; }
  79. [MaxLength(1000)]
  80. public string Remark { get; set; }
  81. public int NotifyType { get; set; }
  82. }
  83. public class NotifyTypeDefinition
  84. {
  85. public const int None = 0;
  86. public const int Alarm = 1;
  87. public const int Expire = 2;
  88. }
  89. /// <summary>
  90. /// 关键点状态定义
  91. /// </summary>
  92. public class LegalKeyPointStateDefinition
  93. {
  94. /// <summary>
  95. /// 新建
  96. /// </summary>
  97. public const int New = 1;
  98. /// <summary>
  99. /// 待执行
  100. /// </summary>
  101. public const int Run = 2;
  102. /// <summary>
  103. /// 已执行
  104. /// </summary>
  105. public const int Executed = 3;
  106. /// <summary>
  107. /// 挂起
  108. /// </summary>
  109. public const int Hang = 4;
  110. /// <summary>
  111. /// 结束
  112. /// </summary>
  113. public const int End = 5;
  114. public static string GetName(int definition, IStatesManager statesManager)
  115. {
  116. return statesManager.GetDisplayValue("KeyPoint", "State", definition + "");
  117. }
  118. }
  119. /// <summary>
  120. /// 关键点级别定义
  121. /// </summary>
  122. public class LegalKeyPointLevelDefinition
  123. {
  124. /// <summary>
  125. /// 一般
  126. /// </summary>
  127. public const int Common= 1;
  128. /// <summary>
  129. /// 重要
  130. /// </summary>
  131. public const int Important = 2;
  132. /// <summary>
  133. /// 紧急
  134. /// </summary>
  135. public const int Urgent = 3;
  136. public static string GetName(int definition, IStatesManager statesManager)
  137. {
  138. return statesManager.GetDisplayValue("KeyPoint", "Level", definition + "");
  139. }
  140. }
  141. }