|
@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using SqlSugar;
|
|
|
using System.Threading;
|
|
|
+using Hotline.Configurations;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Dependency;
|
|
@@ -24,6 +25,7 @@ using Hotline.Settings;
|
|
|
using Novacode;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Settings.TimeLimitDomain;
|
|
|
+using Microsoft.Extensions.Options;
|
|
|
|
|
|
namespace Hotline.Application.Orders
|
|
|
{
|
|
@@ -45,6 +47,7 @@ namespace Hotline.Application.Orders
|
|
|
private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
|
|
|
private readonly IOrderDomainService _orderDomainService;
|
|
|
private readonly IOrderScreenRepository _orderScreenRepository;
|
|
|
+ private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
|
|
|
|
|
|
public OrderSecondaryHandlingApplication(
|
|
|
IMapper mapper,
|
|
@@ -62,6 +65,7 @@ namespace Hotline.Application.Orders
|
|
|
IRepository<OrderVisitDetail> orderVisitedDetailRepository,
|
|
|
IOrderDomainService orderDomainService,
|
|
|
IOrderScreenRepository orderScreenRepository,
|
|
|
+ IOptionsSnapshot<AppConfiguration> appOptions,
|
|
|
ICalcExpireTime expireTime)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
@@ -80,6 +84,7 @@ namespace Hotline.Application.Orders
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_expireTime = expireTime;
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
+ _appOptions = appOptions;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -205,13 +210,16 @@ namespace Hotline.Application.Orders
|
|
|
await _orderPublishRepository.RemoveAsync(publish, false, cancellationToken);
|
|
|
}
|
|
|
|
|
|
- var screen = await _orderScreenRepository.Queryable().FirstAsync(
|
|
|
- x => x.OrderId == model.OrderId &&
|
|
|
- (x.Status != EScreenStatus.End && x.Status != EScreenStatus.Refuse), cancellationToken);
|
|
|
- if (screen != null)
|
|
|
+ if (_appOptions.Value.IsYiBin)
|
|
|
{
|
|
|
- await _orderScreenRepository.RemoveAsync(screen, false, cancellationToken);
|
|
|
- }
|
|
|
+ var screen = await _orderScreenRepository.Queryable().FirstAsync(
|
|
|
+ x => x.OrderId == model.OrderId &&
|
|
|
+ (x.Status != EScreenStatus.End && x.Status != EScreenStatus.Refuse), cancellationToken);
|
|
|
+ if (screen != null)
|
|
|
+ {
|
|
|
+ await _orderScreenRepository.RemoveAsync(screen, false, cancellationToken);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
await _workflowApplication.RecallAsync(recall, expiredTime.ExpiredTime, isOrderFiled, EWorkflowTraceType.SecondHandle, cancellationToken);
|
|
|
visit.VisitState = EVisitState.None;
|