|
@@ -39,6 +39,8 @@ using System.Security.Cryptography;
|
|
|
using Hotline.FlowEngine.Definitions;
|
|
|
using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Snapshot.Interfaces;
|
|
|
+using Hotline.Share.Enums.Settings;
|
|
|
+using Hotline.Settings.TimeLimitDomain;
|
|
|
|
|
|
namespace Hotline.Orders;
|
|
|
|
|
@@ -68,8 +70,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
private readonly IRepository<WorkflowStep> _workflowStepRepository;
|
|
|
private readonly ISystemLogRepository _systemLogRepository;
|
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
+ private readonly ICalcExpireTime _expireTime;
|
|
|
|
|
|
- public OrderDomainService(
|
|
|
+ public OrderDomainService(
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<OrderRedo> orderRedoRepository,
|
|
|
IRepository<OrderPublish> orderPublishRepository,
|
|
@@ -94,7 +97,8 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
IRepository<WorkflowStep> workflowStepRepository,
|
|
|
ISystemLogRepository systemLogRepository,
|
|
|
IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
- IOrderSnapshotRepository orderSnapshotRepository)
|
|
|
+ IOrderSnapshotRepository orderSnapshotRepository,
|
|
|
+ ICalcExpireTime expireTime)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_orderRedoRepository = orderRedoRepository;
|
|
@@ -120,7 +124,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
_systemLogRepository = systemLogRepository;
|
|
|
_appOptions = appOptions;
|
|
|
_orderSnapshotRepository = orderSnapshotRepository;
|
|
|
- }
|
|
|
+ _expireTime = expireTime;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 归档后自动发布
|
|
@@ -821,10 +827,38 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
-
|
|
|
- #region private
|
|
|
|
|
|
- private async Task<Order> GetOrderByFlowIdAsync(string workflowId, CancellationToken cancellationToken)
|
|
|
+ #region 计算甄别申请截至日期
|
|
|
+
|
|
|
+ public async Task<DateTime> GetScreenByEndTime() {
|
|
|
+
|
|
|
+ var endTime = DateTime.Now;
|
|
|
+ var beginTime = DateTime.Now;
|
|
|
+ var timeValue = 1;
|
|
|
+ if (_appOptions.Value.IsZiGong)
|
|
|
+ {
|
|
|
+ timeValue = 2;
|
|
|
+ }
|
|
|
+ else if (_appOptions.Value.IsLuZhou)
|
|
|
+ {
|
|
|
+ DateTime firstDayOfMonth = new DateTime(beginTime.Year, beginTime.Month, 1);
|
|
|
+ DateTime lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);
|
|
|
+ beginTime = new DateTime(lastDayOfMonth.Year, lastDayOfMonth.Month, lastDayOfMonth.Day, 23, 59, 59);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ScreenApplyEndTime);
|
|
|
+ if (int.Parse(setting?.SettingValue[0]) > 0) {
|
|
|
+ timeValue = int.Parse(setting?.SettingValue[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ endTime = (await _expireTime.CalcEndTime(beginTime, beginTime, ETimeType.WorkDay, timeValue, 0, 0)).EndTime;
|
|
|
+ return endTime;
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region private
|
|
|
+
|
|
|
+ private async Task<Order> GetOrderByFlowIdAsync(string workflowId, CancellationToken cancellationToken)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(workflowId))
|
|
|
throw UserFriendlyException.SameMessage("无效流程编号");
|