|
@@ -1,34 +1,14 @@
|
|
|
using DotNetCore.CAP;
|
|
|
-using Hotline.Application.CallCenter;
|
|
|
-using Hotline.Application.JudicialManagement;
|
|
|
-using Hotline.Application.Orders;
|
|
|
-using Hotline.Application.Quality;
|
|
|
-using Hotline.Article;
|
|
|
-using Hotline.CallCenter.Configs;
|
|
|
-using Hotline.CallCenter.Tels;
|
|
|
using Hotline.FlowEngine.Notifications;
|
|
|
using Hotline.FlowEngine.WorkflowModules;
|
|
|
-using Hotline.KnowledgeBase;
|
|
|
using Hotline.Orders;
|
|
|
-using Hotline.Settings.TimeLimits;
|
|
|
-using Hotline.Share.Dtos.FlowEngine.Workflow;
|
|
|
using Hotline.Share.Dtos.Order;
|
|
|
-using Hotline.Share.Dtos.TrCallCenter;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
-using Hotline;
|
|
|
using MapsterMapper;
|
|
|
using MediatR;
|
|
|
-using Microsoft.Extensions.Logging;
|
|
|
-using Microsoft.Extensions.Options;
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using Hotline.Application.Handlers.FlowEngine;
|
|
|
using Hotline.Share.Dtos;
|
|
|
-using XF.Domain.Authentications;
|
|
|
using XF.Domain.Repository;
|
|
|
+using XF.Domain.Authentications;
|
|
|
|
|
|
namespace Hotline.Application.Orders.OrderScreenHandler;
|
|
|
public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
|
|
@@ -37,16 +17,20 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
|
|
|
private readonly ICapPublisher _capPublisher;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
|
|
|
- private readonly IRepository<Hotline.Orders.OrderScreen> _orderScreenRepository;
|
|
|
+ private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
private readonly IRepository<OrderVisit> _orderVisitRepository;
|
|
|
+ private readonly ISessionContext _sessionContext;
|
|
|
+ private readonly IRepository<OrderScreenDetail> _orderScreenDetailRepository;
|
|
|
|
|
|
public OrderScreenEndWorkflowHandler(
|
|
|
IOrderRepository orderRepository,
|
|
|
ICapPublisher capPublisher,
|
|
|
IMapper mapper,
|
|
|
IRepository<OrderVisitDetail> orderVisitedDetailRepository,
|
|
|
- IRepository<Hotline.Orders.OrderScreen> orderScreenRepository,
|
|
|
- IRepository<OrderVisit> orderVisitRepository)
|
|
|
+ IRepository<OrderScreen> orderScreenRepository,
|
|
|
+ IRepository<OrderVisit> orderVisitRepository,
|
|
|
+ ISessionContext sessionContext,
|
|
|
+ IRepository<OrderScreenDetail> orderScreenDetailRepository)
|
|
|
{
|
|
|
_orderRepository = orderRepository;
|
|
|
_capPublisher = capPublisher;
|
|
@@ -54,6 +38,8 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_orderVisitedDetailRepository = orderVisitedDetailRepository;
|
|
|
_orderVisitRepository = orderVisitRepository;
|
|
|
+ _sessionContext = sessionContext;
|
|
|
+ _orderScreenDetailRepository = orderScreenDetailRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>Handles a notification</summary>
|
|
@@ -130,8 +116,15 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
|
|
|
await _orderRepository.OrderScreenRevisionVisit(screen.VisitId, true, cancellationToken);
|
|
|
screen.Status = EScreenStatus.Refuse;
|
|
|
screen.ReplyContent = workflow.ActualOpinion;
|
|
|
- await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
|
|
|
}
|
|
|
+ screen.NewestAuditTime = DateTime.Now;
|
|
|
+ await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
|
|
|
+ OrderScreenDetail detail = new OrderScreenDetail
|
|
|
+ {
|
|
|
+ ScreenId = screen.Id
|
|
|
+ };
|
|
|
+ detail.Audit(_sessionContext.UserId, _sessionContext.UserName, _sessionContext.OrgId, _sessionContext.OrgName, 1);
|
|
|
+ await _orderScreenDetailRepository.AddAsync(detail, cancellationToken);
|
|
|
}
|
|
|
}
|
|
|
}
|