|
@@ -70,9 +70,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
private readonly IRepository<WorkflowStep> _workflowStepRepository;
|
|
|
private readonly ISystemLogRepository _systemLogRepository;
|
|
|
private readonly IOrderSnapshotRepository _orderSnapshotRepository;
|
|
|
- private readonly ICalcExpireTime _expireTime;
|
|
|
+ private readonly ICalcExpireTime _expireTime;
|
|
|
|
|
|
- public OrderDomainService(
|
|
|
+ public OrderDomainService(
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<OrderRedo> orderRedoRepository,
|
|
|
IRepository<OrderPublish> orderPublishRepository,
|
|
@@ -98,7 +98,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
ISystemLogRepository systemLogRepository,
|
|
|
IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
IOrderSnapshotRepository orderSnapshotRepository,
|
|
|
- ICalcExpireTime expireTime)
|
|
|
+ ICalcExpireTime expireTime)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_orderRedoRepository = orderRedoRepository;
|
|
@@ -124,9 +124,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
_systemLogRepository = systemLogRepository;
|
|
|
_appOptions = appOptions;
|
|
|
_orderSnapshotRepository = orderSnapshotRepository;
|
|
|
- _expireTime = expireTime;
|
|
|
+ _expireTime = expireTime;
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 归档后自动发布
|
|
@@ -603,33 +603,33 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
.Where(x => x.SchedulingTime == time).CountAsync(cancellationToken);
|
|
|
if (schedulings > 0)
|
|
|
{
|
|
|
- var sendNum = steps.Count / schedulings;
|
|
|
- scheduling.SendOrderNum += sendNum;
|
|
|
- if (!scheduling.LoginSendOrderNum.HasValue)
|
|
|
- {
|
|
|
- scheduling.LoginSendOrderNum = scheduling.LoginSendOrderNum.HasValue && scheduling.LoginSendOrderNum > sendNum ? scheduling.LoginSendOrderNum : sendNum;
|
|
|
- await _schedulingRepository.Updateable()
|
|
|
- .SetColumns(s => new Scheduling() { LoginSendOrderNum = scheduling.LoginSendOrderNum })
|
|
|
- .Where(s => s.SchedulingTime == scheduling.SchedulingTime).ExecuteCommandAsync(cancellationToken);
|
|
|
- }
|
|
|
- sendNum = scheduling.LoginSendOrderNum.Value;
|
|
|
- await _schedulingRepository.Updateable()
|
|
|
- .SetColumns(s => new Scheduling() { SendOrderNum = scheduling.SendOrderNum, AtWork = scheduling.AtWork })
|
|
|
- .Where(s => s.Id == scheduling.Id).ExecuteCommandAsync(cancellationToken);
|
|
|
-
|
|
|
- if (sendNum <= 0) return;
|
|
|
- var sendSteps = steps.Take(sendNum).ToList();
|
|
|
- await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
- {
|
|
|
- CenterToOrgHandlerId = user.OrgId,
|
|
|
- CenterToOrgHandlerName = user.Name
|
|
|
- }).Where(o => sendSteps.Any(s => s.ExternalId == o.Id)).ExecuteCommandAsync(cancellationToken);
|
|
|
-
|
|
|
- await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, string? roleId, string? roleName, ICollection<WorkflowStep> steps)>
|
|
|
- {
|
|
|
- new(user.Id, user.Name, user.OrgId, user.Organization.Name,roleId,"派单员", sendSteps)
|
|
|
- }, cancellationToken);
|
|
|
- }
|
|
|
+ var sendNum = steps.Count / schedulings;
|
|
|
+ scheduling.SendOrderNum += sendNum;
|
|
|
+ if (!scheduling.LoginSendOrderNum.HasValue)
|
|
|
+ {
|
|
|
+ scheduling.LoginSendOrderNum = scheduling.LoginSendOrderNum.HasValue && scheduling.LoginSendOrderNum > sendNum ? scheduling.LoginSendOrderNum : sendNum;
|
|
|
+ await _schedulingRepository.Updateable()
|
|
|
+ .SetColumns(s => new Scheduling() { LoginSendOrderNum = scheduling.LoginSendOrderNum })
|
|
|
+ .Where(s => s.SchedulingTime == scheduling.SchedulingTime).ExecuteCommandAsync(cancellationToken);
|
|
|
+ }
|
|
|
+ sendNum = scheduling.LoginSendOrderNum.Value;
|
|
|
+ await _schedulingRepository.Updateable()
|
|
|
+ .SetColumns(s => new Scheduling() { SendOrderNum = scheduling.SendOrderNum, AtWork = scheduling.AtWork })
|
|
|
+ .Where(s => s.Id == scheduling.Id).ExecuteCommandAsync(cancellationToken);
|
|
|
+
|
|
|
+ if (sendNum <= 0) return;
|
|
|
+ var sendSteps = steps.Take(sendNum).ToList();
|
|
|
+ await _orderRepository.Updateable().SetColumns(o => new Order()
|
|
|
+ {
|
|
|
+ CenterToOrgHandlerId = user.OrgId,
|
|
|
+ CenterToOrgHandlerName = user.Name
|
|
|
+ }).Where(o => sendSteps.Any(s => s.ExternalId == o.Id)).ExecuteCommandAsync(cancellationToken);
|
|
|
+
|
|
|
+ await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, string? roleId, string? roleName, ICollection<WorkflowStep> steps)>
|
|
|
+ {
|
|
|
+ new(user.Id, user.Name, user.OrgId, user.Organization.Name,roleId,"派单员", sendSteps)
|
|
|
+ }, cancellationToken);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -702,7 +702,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
{
|
|
|
var valid = new OrderValidation { Validation = false, Result = "" };
|
|
|
var hotspot = await _hotspotRepository.GetAsync(dto.HotspotId, cancellationToken);
|
|
|
- if (hotspot.TrunkNum.Equals(AppDefaults.TrafficTrunkNum))
|
|
|
+ if (hotspot != null && hotspot.TrunkNum.Equals(AppDefaults.TrafficTrunkNum))
|
|
|
{
|
|
|
switch (dto.AcceptTypeCode)
|
|
|
{
|
|
@@ -771,7 +771,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
return valid;
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
+
|
|
|
#region 即将超期和超期短信
|
|
|
|
|
|
/// <summary>
|
|
@@ -830,35 +830,38 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
|
|
|
#region 计算甄别申请截至日期
|
|
|
|
|
|
- public async Task<DateTime> GetScreenByEndTime() {
|
|
|
+ public async Task<DateTime> GetScreenByEndTime()
|
|
|
+ {
|
|
|
|
|
|
var endTime = DateTime.Now;
|
|
|
var beginTime = DateTime.Now;
|
|
|
var timeValue = 1;
|
|
|
- if (_appOptions.Value.IsZiGong)
|
|
|
+ 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);
|
|
|
+ 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) {
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ endTime = (await _expireTime.CalcEndTime(beginTime, beginTime, ETimeType.WorkDay, timeValue, 0, 0)).EndTime;
|
|
|
+ return endTime;
|
|
|
}
|
|
|
- #endregion
|
|
|
+ #endregion
|
|
|
|
|
|
- #region private
|
|
|
+ #region private
|
|
|
|
|
|
- private async Task<Order> GetOrderByFlowIdAsync(string workflowId, CancellationToken cancellationToken)
|
|
|
+ private async Task<Order> GetOrderByFlowIdAsync(string workflowId, CancellationToken cancellationToken)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(workflowId))
|
|
|
throw UserFriendlyException.SameMessage("无效流程编号");
|