|
@@ -213,6 +213,26 @@ public class Workflow : CreationEntity
|
|
|
/// </summary>
|
|
|
public DateTime? CenterToOrgTime { get; set; }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 办结时长(分钟)
|
|
|
+ /// 办结时间-交办时间
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(DefaultValue = "0")]
|
|
|
+ public double HandleDuration { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 办结工作日时长
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(DefaultValue = "0")]
|
|
|
+ public double HandleDurationWorkday { get; set; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 全流程时长(分钟)
|
|
|
+ /// 归档时间-创建时间
|
|
|
+ /// </summary>
|
|
|
+ [SugarColumn(DefaultValue = "0")]
|
|
|
+ public double AllDuration { get; set; }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 外部业务唯一标识
|
|
|
/// </summary>
|
|
@@ -337,6 +357,7 @@ public class Workflow : CreationEntity
|
|
|
{
|
|
|
Status = EWorkflowStatus.Completed;
|
|
|
CompleteTime = DateTime.Now;
|
|
|
+ SetAllDuration();
|
|
|
|
|
|
UpdateActualOption();
|
|
|
}
|
|
@@ -405,6 +426,8 @@ public class Workflow : CreationEntity
|
|
|
actualHandlerId, actualHandlerName,
|
|
|
actualHandleOrgCode, actualHandleOrgName,
|
|
|
actualHandleOrgAreaCode, actualHandleOrgAreaName);
|
|
|
+
|
|
|
+ SetHandleDuration();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -645,6 +668,22 @@ public class Workflow : CreationEntity
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void SetHandleDuration()
|
|
|
+ {
|
|
|
+ if (!ActualHandleTime.HasValue)
|
|
|
+ throw new ArgumentNullException($"{ActualHandleTime} is null");
|
|
|
+ if (!CenterToOrgTime.HasValue)
|
|
|
+ throw new ArgumentNullException($"{CenterToOrgTime} is null");
|
|
|
+ HandleDuration = (ActualHandleTime - CenterToOrgTime).Value.TotalMinutes;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SetAllDuration()
|
|
|
+ {
|
|
|
+ if (!CompleteTime.HasValue)
|
|
|
+ throw new ArgumentNullException($"{CompleteTime} is null");
|
|
|
+ AllDuration = (CompleteTime - CreationTime).Value.TotalMinutes;
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
}
|
|
|
|