|
@@ -1,63 +1,63 @@
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using Hotline.Application.FlowEngine;
|
|
|
-using Hotline.DataSharing.Province.Notifications;
|
|
|
-using Hotline.Orders;
|
|
|
-using Hotline.Share.Dtos.FlowEngine;
|
|
|
-using Hotline.Share.Enums.FlowEngine;
|
|
|
-using Hotline.Share.Enums.Order;
|
|
|
-using MediatR;
|
|
|
-using Microsoft.AspNetCore.Http;
|
|
|
-using XF.Domain.Exceptions;
|
|
|
-using XF.Domain.Repository;
|
|
|
+//using System;
|
|
|
+//using System.Collections.Generic;
|
|
|
+//using System.Linq;
|
|
|
+//using System.Text;
|
|
|
+//using System.Threading.Tasks;
|
|
|
+//using Hotline.Application.FlowEngine;
|
|
|
+//using Hotline.DataSharing.Province.Notifications;
|
|
|
+//using Hotline.Orders;
|
|
|
+//using Hotline.Share.Dtos.FlowEngine;
|
|
|
+//using Hotline.Share.Enums.FlowEngine;
|
|
|
+//using Hotline.Share.Enums.Order;
|
|
|
+//using MediatR;
|
|
|
+//using Microsoft.AspNetCore.Http;
|
|
|
+//using XF.Domain.Exceptions;
|
|
|
+//using XF.Domain.Repository;
|
|
|
|
|
|
-namespace Hotline.Application.Handlers.Order
|
|
|
-{
|
|
|
- public class ScreenProvinceResultNotifyHandler : INotificationHandler<ScreenProvinceResultNotify>
|
|
|
- {
|
|
|
- private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
- private readonly IWorkflowApplication _workflowApplication;
|
|
|
+//namespace Hotline.Application.Handlers.Order
|
|
|
+//{
|
|
|
+// public class ScreenProvinceResultNotifyHandler : INotificationHandler<ScreenProvinceResultNotify>
|
|
|
+// {
|
|
|
+// private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
+// private readonly IWorkflowApplication _workflowApplication;
|
|
|
|
|
|
- public ScreenProvinceResultNotifyHandler(
|
|
|
- IRepository<OrderScreen> orderScreenRepository,
|
|
|
- IWorkflowApplication workflowApplication)
|
|
|
- {
|
|
|
- _orderScreenRepository = orderScreenRepository;
|
|
|
- _workflowApplication = workflowApplication;
|
|
|
- }
|
|
|
+// public ScreenProvinceResultNotifyHandler(
|
|
|
+// IRepository<OrderScreen> orderScreenRepository,
|
|
|
+// IWorkflowApplication workflowApplication)
|
|
|
+// {
|
|
|
+// _orderScreenRepository = orderScreenRepository;
|
|
|
+// _workflowApplication = workflowApplication;
|
|
|
+// }
|
|
|
|
|
|
- /// <summary>Handles a notification</summary>
|
|
|
- /// <param name="notification">The notification</param>
|
|
|
- /// <param name="cancellationToken">Cancellation token</param>
|
|
|
- public async Task Handle(ScreenProvinceResultNotify notification, CancellationToken cancellationToken)
|
|
|
- {
|
|
|
- var dto = notification.ProvinceScreenResult;
|
|
|
- var orderScreen = await _orderScreenRepository.Queryable()
|
|
|
- .Includes(d => d.Order)
|
|
|
- .Includes(d => d.Workflow)
|
|
|
- .FirstAsync(d => d.Order.ProvinceNo == dto.CaseSerial && d.Status == EScreenStatus.Approval, cancellationToken);
|
|
|
- if (orderScreen is null)
|
|
|
- throw new UserFriendlyException("无效省工单编号");
|
|
|
- if (string.IsNullOrEmpty(orderScreen.WorkflowId))
|
|
|
- throw new UserFriendlyException("无效甄别审批流程编号");
|
|
|
+// /// <summary>Handles a notification</summary>
|
|
|
+// /// <param name="notification">The notification</param>
|
|
|
+// /// <param name="cancellationToken">Cancellation token</param>
|
|
|
+// public async Task Handle(ScreenProvinceResultNotify notification, CancellationToken cancellationToken)
|
|
|
+// {
|
|
|
+// var dto = notification.ProvinceScreenResult;
|
|
|
+// var orderScreen = await _orderScreenRepository.Queryable()
|
|
|
+// .Includes(d => d.Order)
|
|
|
+// .Includes(d => d.Workflow)
|
|
|
+// .FirstAsync(d => d.Order.ProvinceNo == dto.CaseSerial && d.Status == EScreenStatus.Approval, cancellationToken);
|
|
|
+// if (orderScreen is null)
|
|
|
+// throw new UserFriendlyException("无效省工单编号");
|
|
|
+// if (string.IsNullOrEmpty(orderScreen.WorkflowId))
|
|
|
+// throw new UserFriendlyException("无效甄别审批流程编号");
|
|
|
|
|
|
- if (dto.AuditResult)
|
|
|
- {
|
|
|
- await _workflowApplication.JumpToEndAsync(orderScreen.WorkflowId, dto.AuditOpinion, notification.Files,EReviewResult.Approval,
|
|
|
- true,cancellationToken);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var rejectDto = new RejectDto
|
|
|
- {
|
|
|
- WorkflowId = orderScreen.WorkflowId,
|
|
|
- Opinion = dto.AuditOpinion,
|
|
|
- };
|
|
|
- await _workflowApplication.RejectAsync(rejectDto, cancellationToken);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+// if (dto.AuditResult)
|
|
|
+// {
|
|
|
+// await _workflowApplication.JumpToEndAsync(orderScreen.WorkflowId, dto.AuditOpinion, notification.Files,EReviewResult.Approval,
|
|
|
+// true,cancellationToken);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// var rejectDto = new RejectDto
|
|
|
+// {
|
|
|
+// WorkflowId = orderScreen.WorkflowId,
|
|
|
+// Opinion = dto.AuditOpinion,
|
|
|
+// };
|
|
|
+// await _workflowApplication.RejectAsync(rejectDto, cancellationToken);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//}
|