فهرست منبع

Merge branch 'master' of http://110.188.24.182:10023/Fengwo/hotline

xf 1 سال پیش
والد
کامیت
47a9fb4458

+ 21 - 1
src/Hotline.Api/Controllers/DataSharing/EnterpriseController.cs

@@ -1,9 +1,12 @@
 using DotNetCore.CAP;
 using Hotline.DataSharing;
 using Hotline.DataSharing.Enterprise;
+using Hotline.DataSharing.Order;
+using Hotline.DataSharing.Province.Notifications;
 using Hotline.Share.Dtos.DataSharing;
 using Hotline.Share.Dtos.DataSharing.Enterprise.Receive;
 using MapsterMapper;
+using MediatR;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using Sharing.Share.Dtos.DataSharing.Enterprise;
@@ -20,17 +23,25 @@ namespace Hotline.Api.Controllers.DataSharing
         private readonly IMapper _mapper;
         private readonly IRepository<DsReceiveWriteResult> _receiveWriteResultRepository;
         private readonly EnterpriseClient _enterpriseClient;
+        private readonly IMediator _mediator;
+        private readonly IRepository<DsOrder> _dataOrderRepository;
 
         /// <summary>
         /// 
         /// </summary>
         /// <param name="mapper"></param>
         /// <param name="receiveWriteResultRepository"></param>
-        public EnterpriseController(IMapper mapper, IRepository<DsReceiveWriteResult> receiveWriteResultRepository, EnterpriseClient enterpriseClient)
+        /// <param name="enterpriseClient"></param>
+        /// <param name="mediator"></param>
+        /// <param name="dataOrderRepository"></param>
+        public EnterpriseController(IMapper mapper, IRepository<DsReceiveWriteResult> receiveWriteResultRepository, EnterpriseClient enterpriseClient,
+         IMediator mediator, IRepository<DsOrder> dataOrderRepository)
         {
             _mapper = mapper;
             _receiveWriteResultRepository = receiveWriteResultRepository;
             _enterpriseClient = enterpriseClient;
+            _mediator = mediator;
+            _dataOrderRepository = dataOrderRepository;
         }
 
         /// <summary>
@@ -78,6 +89,15 @@ namespace Hotline.Api.Controllers.DataSharing
             var id = await _receiveWriteResultRepository.AddAsync(data, HttpContext.RequestAborted);
             if (!string.IsNullOrEmpty(id))
             {
+                string FinishType = "";
+                if (dto.ReplyResultType == 2)
+                    FinishType = "0";
+                else if (dto.ReplyResultType == 1)
+                    FinishType = "1";
+
+                var order = await _dataOrderRepository.GetAsync(p => p.OrderNo == dto.ReplyCode, HttpContext.RequestAborted);
+                if (order != null)
+                    await _mediator.Send(new OrderResultNotify { OrderId = order.OrderId, FinishType = FinishType, Opinion = dto.ReplyContent }, HttpContext.RequestAborted);
                 //向业务系统推送消息
                 // await _capPublisher.PublishAsync("", _mapper.Map<DataWriteResultDto>(dto), cancellationToken: HttpContext.RequestAborted);
                 //这里往业务系统推送数据

+ 12 - 6
src/Hotline.Api/Controllers/DataSharing/ProvinceController.cs

@@ -237,8 +237,9 @@ namespace Hotline.Api.Controllers.DataSharing
             var id = await InitReceiveProvinceData(dto.CaseSerial, dto.CliengGuid, "send_supervise_info", System.Text.Json.JsonSerializer.Serialize(dto));
             if (!string.IsNullOrEmpty(id))
             {
+                var listFiles = await GetFileData(dto.CliengGuid, dto.CaseSerial, "督办工单派发");
                 //向业务系统推送消息
-                await _mediator.Send(new ProvinceOrderSuperviseNotify { ProvinceOrderSuperviseDto = _mapper.Map<ProvinceOrderSuperviseDto>(dto) }, HttpContext.RequestAborted);
+                await _mediator.Send(new ProvinceOrderSuperviseNotify { ProvinceOrderSuperviseDto = _mapper.Map<ProvinceOrderSuperviseDto>(dto), Files = listFiles }, HttpContext.RequestAborted);
                 return OpenResponse.Ok(Reponse.Success("您已成功提交数据!"));
 
             }
@@ -305,7 +306,8 @@ namespace Hotline.Api.Controllers.DataSharing
 
             if (!string.IsNullOrEmpty(id))
             {
-                await _mediator.Send(new ScreenProvinceResultNotify { ProvinceScreenResult = _mapper.Map<ProvinceScreenResult>(dto) }, HttpContext.RequestAborted);
+                var listFiles = await GetFileData(dto.CliengGuid, dto.CaseSerial, "工单甄别结果");
+                await _mediator.Send(new ScreenProvinceResultNotify { ProvinceScreenResult = _mapper.Map<ProvinceScreenResult>(dto), Files = listFiles }, HttpContext.RequestAborted);
 
                 return OpenResponse.Ok(Reponse.Success("您已成功提交数据!"));
             }
@@ -338,8 +340,9 @@ namespace Hotline.Api.Controllers.DataSharing
 
             if (!string.IsNullOrEmpty(id))
             {
+                var listFiles = await GetFileData(dto.CliengGuid, dto.CaseSerial, "工单延期审核结果");
                 //向业务系统推送消息
-                await _mediator.Send(new DelayProvinceResultNotify { IsPass = dto.AuditResult == "1", Opinion = dto.AuditOpinion, No = dto.CaseSerial }, HttpContext.RequestAborted);
+                await _mediator.Send(new DelayProvinceResultNotify { IsPass = dto.AuditResult == "1", Opinion = dto.AuditOpinion, No = dto.CaseSerial, Files = listFiles }, HttpContext.RequestAborted);
                 return OpenResponse.Ok(Reponse.Success("您已成功提交数据!"));
             }
             else
@@ -404,7 +407,7 @@ namespace Hotline.Api.Controllers.DataSharing
 
             if (!string.IsNullOrEmpty(id))
             {
-              var data=  await _dataOrderRepository.GetAsync(p => p.ProvinceNo == dto.CaseSerial, HttpContext.RequestAborted);
+                var data = await _dataOrderRepository.GetAsync(p => p.ProvinceNo == dto.CaseSerial, HttpContext.RequestAborted);
                 if (data != null)
                     await _mediator.Send(new CancelOrderAsyncNotify { Opinion = dto.RevokeReasion, OrderId = data.OrderId });
                 //向业务系统推送消息
@@ -513,7 +516,10 @@ namespace Hotline.Api.Controllers.DataSharing
                     //将工单的办理状态改为办理完成,终止拉取办理信息
                     tempData.IsEnd = true;
                     await _sendCaseInfoRepository.UpdateAsync(tempData, HttpContext.RequestAborted);
+
+                    await _mediator.Send(new OrderResultNotify { OrderId = tempData.OrderID, FinishType = dto.FinishType, Opinion = dto.FdBack }, HttpContext.RequestAborted);
                 }
+
                 //向业务系统推送消息
                 //await _capPublisher.PublishAsync(Sharing.Share.Mq.EventNames.SharingOrderReultSend, _mapper.Map<ReultSendDto>(dto), cancellationToken: HttpContext.RequestAborted);
                 return OpenResponse.Ok(Reponse.Success("您已成功提交数据!"));
@@ -750,11 +756,11 @@ namespace Hotline.Api.Controllers.DataSharing
                             break;
                         case "screen_case_result_receive":
                             listFiles = await InitFileData(listData, "工单甄别结果");
-                            await _mediator.Send(new ScreenProvinceResultNotify { ProvinceScreenResult = new() { CaseSerial = tmpCaseMaterialInfo.CaseSerial } }, HttpContext.RequestAborted);
+                            await _mediator.Send(new ScreenProvinceResultNotify { ProvinceScreenResult = new() { CaseSerial = tmpCaseMaterialInfo.CaseSerial }, Files = listFiles }, HttpContext.RequestAborted);
                             break;
                         case "delay_case_result_receive":
                             listFiles = await InitFileData(listData, "工单延期审核结果");
-                            await _mediator.Send(new DelayProvinceResultNotify { No = tmpCaseMaterialInfo.CaseSerial }, HttpContext.RequestAborted);
+                            await _mediator.Send(new DelayProvinceResultNotify { No = tmpCaseMaterialInfo.CaseSerial, Files = listFiles }, HttpContext.RequestAborted);
                             break;
                         case "supply_case_info_receive":
                             listFiles = await InitFileData(listData, "工单补充");

+ 2 - 1
src/Hotline.Application/FlowEngine/IWorkflowApplication.cs

@@ -1,6 +1,7 @@
 using Hotline.FlowEngine.Definitions;
 using Hotline.Orders;
 using Hotline.Share.Dtos;
+using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.FlowEngine;
 using Hotline.Share.Dtos.FlowEngine.Definition;
 using Hotline.Share.Dtos.Settings;
@@ -44,7 +45,7 @@ namespace Hotline.Application.FlowEngine
         /// <summary>
         /// 跳转至结束节点(无视流程模板配置直接跳至结束节点)
         /// </summary>
-        Task JumpToEndAsync(string workflowId, string opinion, EReviewResult? reviewResult = EReviewResult.Unknown,
+        Task JumpToEndAsync(string workflowId, string opinion,List<FileDto> file, EReviewResult? reviewResult = EReviewResult.Unknown,
             CancellationToken cancellationToken = default);
 
         /// <summary>

+ 3 - 1
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -28,6 +28,7 @@ using XF.Domain.Exceptions;
 using XF.Domain.Extensions;
 using XF.Domain.Repository;
 using XF.Utility.EnumExtensions;
+using Hotline.Share.Dtos.File;
 
 namespace Hotline.Application.FlowEngine;
 
@@ -309,7 +310,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
     /// <summary>
     /// 跳转至结束节点(无视流程模板配置直接跳至结束节点)
     /// </summary>
-    public async Task JumpToEndAsync(string workflowId, string opinion, EReviewResult? reviewResult = EReviewResult.Unknown,
+    public async Task JumpToEndAsync(string workflowId, string opinion,List<FileDto> files, EReviewResult? reviewResult = EReviewResult.Unknown,
         CancellationToken cancellationToken = default)
     {
         var workflow =
@@ -324,6 +325,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
         var endTrace = await _workflowDomainService.EndAsync(workflow, new BasicWorkflowDto
             {
                 Opinion = opinion,
+                Files = files
             }, endStepDefine, currentStep,
             reviewResult, cancellationToken);
     }

+ 1 - 1
src/Hotline.Application/Handlers/Order/DelayProvinceResultNotifyHandler.cs

@@ -45,7 +45,7 @@ namespace Hotline.Application.Handlers.Order
 
             if (dto.IsPass)
             {
-                await _workflowApplication.JumpToEndAsync(orderDelay.WorkflowId, dto.Opinion, EReviewResult.Approval,
+                await _workflowApplication.JumpToEndAsync(orderDelay.WorkflowId, dto.Opinion, notification.Files,EReviewResult.Approval,
                     cancellationToken);
             }
             else

+ 4 - 2
src/Hotline.Application/Handlers/Order/OrderResultNotifyHandler.cs

@@ -2,6 +2,7 @@
 using Hotline.DataSharing.Province.Notifications;
 using Hotline.File;
 using Hotline.Orders;
+using Hotline.Share.Dtos.FlowEngine;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
@@ -29,10 +30,11 @@ namespace Hotline.Application.Handlers.Order
             {
 				if ("0".Equals(request.FinishType))
 				{
-					//todo  等_workflowApplication 新加一个退回上一个节点的方法
+					await _workflowApplication.PreviousAsync(
+						new PreviousWorkflowDto { WorkflowId = order.WorkflowId, Opinion = request.Opinion, Files = request.Files }, cancellationToken: cancellationToken);
 				}
 				else if ("1".Equals(request.FinishType)) {
-					await _workflowApplication.JumpToEndAsync(order.WorkflowId, request.Opinion, cancellationToken: cancellationToken);
+					await _workflowApplication.JumpToEndAsync(order.WorkflowId, request.Opinion, request.Files, cancellationToken: cancellationToken);
 				}
 			}
         }

+ 1 - 1
src/Hotline.Application/Handlers/Order/ScreenProvinceResultNotifyHandler.cs

@@ -47,7 +47,7 @@ namespace Hotline.Application.Handlers.Order
             var pass = "1".Equals(dto.AuditResult);
             if (pass)
             {
-                await _workflowApplication.JumpToEndAsync(orderScreen.WorkflowId, dto.AuditOpinion, EReviewResult.Approval,
+                await _workflowApplication.JumpToEndAsync(orderScreen.WorkflowId, dto.AuditOpinion, notification.Files,EReviewResult.Approval,
                     cancellationToken);
             }
             else

+ 4 - 1
src/Hotline/DataSharing/Province/Notifications/DelayProvinceResultNotify.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Hotline.Share.Dtos.File;
 using MediatR;
 
 namespace Hotline.DataSharing.Province.Notifications
@@ -26,5 +27,7 @@ namespace Hotline.DataSharing.Province.Notifications
         /// 办理意见
         /// </summary>
         public string Opinion { get; set; }
-    }
+
+        public List<FileDto> Files { get; set; }
+	}
 }

+ 4 - 2
src/Hotline/DataSharing/Province/Notifications/OrderResultNotify.cs

@@ -1,4 +1,5 @@
-using MediatR;
+using Hotline.Share.Dtos.File;
+using MediatR;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -7,6 +8,7 @@ using System.Threading.Tasks;
 
 namespace Hotline.DataSharing.Province.Notifications
 {
+	// 不接受补附件
 	public class OrderResultNotify : INotification
 	{
 		public string OrderId { get; set; }
@@ -15,6 +17,6 @@ namespace Hotline.DataSharing.Province.Notifications
 
 		public string FinishType { get; set; }
 
-		//public string Status { get; set; }
+		public List<FileDto> Files { get; set; }
 	}
 }

+ 4 - 1
src/Hotline/DataSharing/Province/Notifications/ScreenProvinceResultNotify.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Dtos.Order;
+using Hotline.Share.Dtos.File;
+using Hotline.Share.Dtos.Order;
 using MediatR;
 
 namespace Hotline.DataSharing.Province.Notifications;
@@ -9,4 +10,6 @@ namespace Hotline.DataSharing.Province.Notifications;
 public class ScreenProvinceResultNotify : INotification
 {
     public ProvinceScreenResult ProvinceScreenResult { get; set; }
+
+    public List<FileDto> Files { get; set; }
 }