Ver código fonte

Merge branch 'feature/snapshot' of http://110.188.24.182:10023/Fengwo/hotline into feature/snapshot

qinchaoyue 4 meses atrás
pai
commit
ca3ed2bb21
18 arquivos alterados com 237 adições e 175 exclusões
  1. 38 7
      src/Hotline.Api/Controllers/OrderController.cs
  2. 7 0
      src/Hotline.Application/FlowEngine/WorkflowApplication.cs
  3. 7 2
      src/Hotline.Application/Handlers/FlowEngine/WorkflowNextHandler.cs
  4. 1 1
      src/Hotline.Application/Orders/Handles/OrderHandler/AddOrderPushMessageNotifyHandler.cs
  5. 1 1
      src/Hotline.Application/Orders/Handles/OrderHandler/GetOrderDetailNotifyHandler.cs
  6. 1 1
      src/Hotline.Application/Orders/Handles/OrderHandler/OrderRelateCallHandler.cs
  7. 1 1
      src/Hotline.Application/Orders/Handles/OrderHandler/OrderVisitSmsHandler.cs
  8. 3 3
      src/Hotline.Application/Orders/Handles/OrderHandler/TranspondCityNotifyHandler.cs
  9. 1 1
      src/Hotline.Application/Orders/Handles/OrderHandler/UpdateOrderPushMessageNotifyHandler.cs
  10. 9 9
      src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs
  11. 102 0
      src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs
  12. 37 0
      src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs
  13. 1 1
      src/Hotline.Application/Orders/Handles/SnapshotHandler/GuiderSystemTimeoutHandler.cs
  14. 0 102
      src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs
  15. 0 37
      src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs
  16. 17 9
      src/Hotline.Share/Dtos/FlowEngine/BasicWorkflowDto.cs
  17. 2 0
      src/Hotline.Share/Dtos/FlowEngine/NextStepOption.cs
  18. 9 0
      src/Hotline.Share/Dtos/Order/OrderStartFlowDto.cs

+ 38 - 7
src/Hotline.Api/Controllers/OrderController.cs

@@ -18,7 +18,6 @@ using Hotline.Import;
 using Hotline.Orders;
 using Hotline.Orders.Notifications;
 using Hotline.OrderTranspond;
-using Hotline.Permissions;
 using Hotline.Push.FWMessage;
 using Hotline.Push.Notifies;
 using Hotline.Repository.SqlSugar.CallCenter;
@@ -66,12 +65,12 @@ using XF.Utility.EnumExtensions;
 using Hotline.Application.Contracts.Validators.FlowEngine;
 using Hotline.Authentications;
 using Hotline.Share.Dtos.CallCenter;
-using NPOI.SS.Formula.Functions;
-using System.Threading;
 using Hotline.Share.Mq;
 using Hotline.CallCenter.Calls;
+using Hotline.FlowEngine.Notifications;
 using Hotline.Share.Dtos.Order.Detail;
-using Hotline.Share.Dtos.File;
+using Hotline.Snapshot.Interfaces;
+using Hotline.Snapshot.Notifications;
 
 namespace Hotline.Api.Controllers;
 
@@ -126,7 +125,6 @@ public class OrderController : BaseController
     private readonly IOrderApplication _orderApplication;
     private readonly IPushDomainService _pushDomainService;
     private readonly ILogger<OrderController> _logger;
-    private readonly ITypedCache<YbEnterpriseToken> _cacheResponse;
     private readonly IRepository<OrderSendBackAudit> _orderSendBackAuditRepository;
     private readonly IRepository<User> _userRepository;
     private readonly IExportApplication _exportApplication;
@@ -147,6 +145,7 @@ public class OrderController : BaseController
     private readonly IRepository<OrderRevoke> _orderRevokeRepository;
     private readonly IOrderTerminateRepository _orderTerminateRepository;
     private readonly ISystemLogApplication _systemLogApplication;
+    private readonly IOrderSnapshotRepository _orderSnapshotRepository;
 
     public OrderController(
         IOrderDomainService orderDomainService,
@@ -213,7 +212,8 @@ public class OrderController : BaseController
         BaseDataApplication baseDataApplication,
         IOrderTerminateRepository orderTerminateRepository,
         ITypedCache<string> typeCache,
-        ISystemLogApplication systemLogApplication)
+        ISystemLogApplication systemLogApplication,
+        IOrderSnapshotRepository orderSnapshotRepository)
     {
         _orderDomainService = orderDomainService;
         _orderRepository = orderRepository;
@@ -257,7 +257,6 @@ public class OrderController : BaseController
         _logger = logger;
         _orderApplication = orderApplication;
         _pushDomainService = pushDomainService;
-        _cacheResponse = cacheResponse;
         _orderSendBackAuditRepository = orderSendBackAuditRepository;
         _userRepository = userRepository;
         _exportApplication = exportApplication;
@@ -281,6 +280,7 @@ public class OrderController : BaseController
         _typeCache = typeCache;
         _baseDataApplication = baseDataApplication;
         _systemLogApplication = systemLogApplication;
+        _orderSnapshotRepository = orderSnapshotRepository;
     }
 
     #endregion
@@ -3903,6 +3903,20 @@ public class OrderController : BaseController
             outDto.Opinion = await _typeCache.GetAsync($"tmp_opinion_{orderId}{_sessionContext.UserId}", HttpContext.RequestAborted);
         }
 
+        //随手拍
+        bool.TryParse(_systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
+            out bool isSnapshotEnable);
+        if (isSnapshotEnable)
+        {
+            var orderSnapshot = await _orderSnapshotRepository.GetAsync(orderId, HttpContext.RequestAborted);
+            if (orderSnapshot is null)
+                throw new UserFriendlyException($"无效编号, id: {orderId}");
+            if (string.CompareOrdinal(orderSnapshot.IndustryName, "安全隐患") == 0)
+            {
+                outDto.Steps = outDto.Steps.Where(d => d.BusinessType != EBusinessType.Send).ToList();
+            }
+        }
+
         return outDto;
     }
 
@@ -3919,6 +3933,23 @@ public class OrderController : BaseController
                 $"非法参数, {string.Join(',', validResult.Errors.Select(d => d.ErrorMessage))}");
         var order = await _orderApplication.SaveOrderWorkflowInfo(dto, HttpContext.RequestAborted);
 
+        //随手拍推送网格员
+        bool.TryParse(
+            _systemSettingCacheManager.GetSetting(SettingConstants.Snapshot)?.SettingValue[0],
+            out bool isSnapshotEnable);
+        if (isSnapshotEnable)
+        {
+            if (string.Compare(TagDefaults.OrderMark, dto.Workflow.Tag,
+                    StringComparison.OrdinalIgnoreCase) == 0)
+            {
+                var orderSnapshot = await _orderSnapshotRepository.GetAsync(order.Id, HttpContext.RequestAborted);
+                if (orderSnapshot is null)
+                    throw new UserFriendlyException($"无效编号, id: {order.Id}");
+                orderSnapshot.IsSafetyDepartment = dto.Data.IsSafetyDepartment;
+                await _orderSnapshotRepository.UpdateAsync(orderSnapshot, HttpContext.RequestAborted);
+            }
+        }
+
         var workflow = await _workflowDomainService.GetWorkflowAsync(dto.Workflow.WorkflowId, withSteps: true, withTraces: true,
             cancellationToken: HttpContext.RequestAborted);
 

+ 7 - 0
src/Hotline.Application/FlowEngine/WorkflowApplication.cs

@@ -572,6 +572,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
                 StepType = stepDefine.StepType,
                 BusinessType = stepDefine.BusinessType,
                 HandlerType = stepDefine.HandlerType,
+                Tag = stepDefine.Tag ?? string.Empty,
                 OrgLevel = stepDefine.HandlerType is EHandlerType.OrgLevel ? orgLevel : null,
             };
             var orgs = await _organizeRepository.Queryable()
@@ -869,6 +870,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
                     BusinessType = stepDefine.BusinessType,
                     //HandlerType = stepDefine.HandlerType,
                     HandlerType = EHandlerType.AssignedUser, //指定办理人(业务需求)
+                    Tag = stepDefine.Tag ?? string.Empty,
                     Items = new List<FlowStepHandler> { handler } //handlers
                 };
             }
@@ -901,6 +903,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
                 StepType = stepDefine.StepType,
                 BusinessType = stepDefine.BusinessType,
                 HandlerType = stepDefine.HandlerType,
+                Tag = stepDefine.Tag ?? string.Empty,
                 Items = handlers
             };
         }
@@ -1045,6 +1048,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
             StepType = stepDefine.StepType,
             BusinessType = stepDefine.BusinessType,
             HandlerType = stepDefine.HandlerType,
+            Tag = stepDefine.Tag ?? string.Empty,
             OrgLevel = stepDefine.HandlerType is EHandlerType.OrgLevel ? orgLevel : null,
             Items = handlers
         };
@@ -1081,6 +1085,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
             BusinessType = prevStep.BusinessType,
             //HandlerType = prevStep.HandlerType,
             HandlerType = EHandlerType.AssignedUser, //指定办理人(业务需求)
+            Tag = prevStep.Tag ?? string.Empty,
             Items = new List<FlowStepHandler> { handler } //handlers //new List<Kv> { new(prevStep.HandlerId, prevStep.HandlerName) },
         };
     }
@@ -1480,6 +1485,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
             StepType = stepType,
             BusinessType = businessType,
             HandlerType = handlerType, //目前所有动态策略均属于部门等级
+            Tag = string.Empty,
             Items = items
         };
     }
@@ -1620,6 +1626,7 @@ public class WorkflowApplication : IWorkflowApplication, IScopeDependency
             StepType = stepType,
             BusinessType = businessType,
             HandlerType = EHandlerType.OrgLevel, //目前所有动态策略均属于部门等级
+            Tag = string.Empty,
             Items = items
         };
     }

+ 7 - 2
src/Hotline.Application/Handlers/FlowEngine/WorkflowNextHandler.cs

@@ -23,6 +23,7 @@ using Hotline.Share.Enums.Order;
 using Hotline.Share.Enums.Push;
 using Hotline.Share.Enums.Quality;
 using Hotline.Share.Mq;
+using Hotline.Snapshot.Interfaces;
 using Hotline.Snapshot.Notifications;
 using Hotline.Users;
 using Mapster;
@@ -33,6 +34,7 @@ using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using XF.Domain.Authentications;
 using XF.Domain.Entities;
+using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 
 namespace Hotline.Application.Handlers.FlowEngine;
@@ -41,6 +43,7 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
 {
     private readonly IOrderDomainService _orderDomainService;
     private readonly ICalcExpireTime _expireTime;
+    private readonly IOrderSnapshotRepository _orderSnapshotRepository;
     private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
     private readonly IOrderRepository _orderRepository;
     private readonly ICapPublisher _capPublisher;
@@ -70,7 +73,8 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
         ISystemSettingCacheManager systemSettingCacheManager,
         Publisher publisher,
         IOptionsSnapshot<AppConfiguration> appOptions,
-        ICalcExpireTime expireTime)
+        ICalcExpireTime expireTime,
+        IOrderSnapshotRepository orderSnapshotRepository)
     {
         _orderDomainService = orderDomainService;
         _orderRepository = orderRepository;
@@ -87,6 +91,7 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
         _publisher = publisher;
         _appOptions = appOptions;
         _expireTime = expireTime;
+        _orderSnapshotRepository = orderSnapshotRepository;
     }
 
     /// <summary>Handles a notification</summary>
@@ -239,7 +244,7 @@ public class WorkflowNextHandler : INotificationHandler<NextStepNotify>
                         out bool isSnapshotEnable);
                     if (isSnapshotEnable)
                     {
-                        if (string.Compare(notification.NextStepDefine.Tag, TagDefaults.Wanggeyuan,
+                        if (string.Compare(TagDefaults.Wanggeyuan, notification.NextStepDefine.Tag,
                                 StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             await _publisher.PublishAsync(new PostGuiderSystemNotification(order.Id),

+ 1 - 1
src/Hotline.Application/Handlers/Order/AddOrderPushMessageNotifyHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/AddOrderPushMessageNotifyHandler.cs

@@ -6,7 +6,7 @@ using Hotline.Share.Enums.Push;
 using MediatR;
 using Microsoft.Extensions.Logging;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Order
 {
     /// <summary>
     /// 新增工单发送短信

+ 1 - 1
src/Hotline.Application/Handlers/Order/GetOrderDetailNotifyHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/GetOrderDetailNotifyHandler.cs

@@ -7,7 +7,7 @@ using Hotline.FlowEngine.Workflows;
 using Hotline.Orders.Notifications;
 using MediatR;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Order
 {
     public class GetOrderDetailNotifyHandler : INotificationHandler<GetOrderDetailNotify>
     {

+ 1 - 1
src/Hotline.Application/Handlers/Order/OrderRelateCallHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/OrderRelateCallHandler.cs

@@ -12,7 +12,7 @@ using System.Threading.Tasks;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Order
 {
     public class OrderRelateCallHandler : ICapSubscribe, ITransientDependency
     {

+ 1 - 1
src/Hotline.Application/Handlers/Order/OrderVisitSmsHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/OrderVisitSmsHandler.cs

@@ -17,7 +17,7 @@ using MediatR;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Handlers.Order;
+namespace Hotline.Application.Orders.Handles.Order;
 public class OrderVisitSmsHandler : INotificationHandler<ReceiveMessageNotify>
 {
     private readonly IOrderVisitDomainService _orderVisitDomainService;

+ 3 - 3
src/Hotline.Application/Handlers/Order/TranspondCityNotifyHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/TranspondCityNotifyHandler.cs

@@ -13,9 +13,9 @@ using System;
 using Hotline.DI;
 using XF.Domain.Repository;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Order
 {
-   // [Injection(AppScopes = EAppScope.YiBin)]
+    // [Injection(AppScopes = EAppScope.YiBin)]
     public class TranspondCityNotifyHandler : INotificationHandler<OrderStartWorkflowNotify>
     {
         private readonly IMapper _mapper;
@@ -63,7 +63,7 @@ namespace Hotline.Application.Handlers.Order
                     if (order.Transpond.HasValue && order.Transpond.Value)
                     {
                         var orderDto = _mapper.Map<OrderDto>(order);
-                        await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderTranspondCity, orderDto);
+                        await _capPublisher.PublishAsync(Share.Mq.EventNames.HotlineOrderTranspondCity, orderDto);
                         //保存本地数据
                         TranspondCityRawData cityRawData = new TranspondCityRawData
                         {

+ 1 - 1
src/Hotline.Application/Handlers/Order/UpdateOrderPushMessageNotifyHandler.cs → src/Hotline.Application/Orders/Handles/OrderHandler/UpdateOrderPushMessageNotifyHandler.cs

@@ -6,7 +6,7 @@ using Hotline.Share.Enums.Push;
 using MediatR;
 using Microsoft.Extensions.Logging;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Order
 {
     public class UpdateOrderPushMessageNotifyHandler : INotificationHandler<UpdateOrderNotify>
     {

+ 9 - 9
src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs → src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs

@@ -1,25 +1,25 @@
 using DotNetCore.CAP;
+using Hotline.Configurations;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.WorkflowModules;
 using Hotline.Orders;
+using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
 using MediatR;
-using Hotline.Share.Dtos;
-using XF.Domain.Repository;
-using XF.Domain.Authentications;
-using Hotline.Configurations;
 using Microsoft.Extensions.Options;
+using XF.Domain.Authentications;
+using XF.Domain.Repository;
 
-namespace Hotline.Application.Orders.OrderScreenHandler;
+namespace Hotline.Application.Orders.Handles.OrderScreenHandler;
 public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
 {
     private readonly IOrderRepository _orderRepository;
     private readonly ICapPublisher _capPublisher;
     private readonly IMapper _mapper;
     private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
-    private readonly IRepository<OrderScreen> _orderScreenRepository;
+    private readonly IRepository<Hotline.Orders.OrderScreen> _orderScreenRepository;
     private readonly IRepository<OrderVisit> _orderVisitRepository;
     private readonly ISessionContext _sessionContext;
     private readonly IRepository<OrderScreenDetail> _orderScreenDetailRepository;
@@ -30,7 +30,7 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
         ICapPublisher capPublisher,
         IMapper mapper,
         IRepository<OrderVisitDetail> orderVisitedDetailRepository,
-        IRepository<OrderScreen> orderScreenRepository,
+        IRepository<Hotline.Orders.OrderScreen> orderScreenRepository,
         IRepository<OrderVisit> orderVisitRepository,
         ISessionContext sessionContext,
         IRepository<OrderScreenDetail> orderScreenDetailRepository,
@@ -97,7 +97,7 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
                                 //获取回访明细
                                 var visitDe = visit.OrderVisitDetails.First(x => x.Id == screen.VisitDetailId);
                                 //推省上
-                                await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderScreenApplyed,
+                                await _capPublisher.PublishAsync(Share.Mq.EventNames.HotlineOrderScreenApplyed,
                                     new PublishVisitDto()
                                     {
                                         Order = _mapper.Map<OrderDto>(visit.Order),
@@ -113,7 +113,7 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
                                     });
 
                                 //推门户
-                                await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineOrderVisitedWeb, new PublishVisitAllDto()
+                                await _capPublisher.PublishAsync(Share.Mq.EventNames.HotlineOrderVisitedWeb, new PublishVisitAllDto()
                                 {
                                     Id = visit.Id,
                                     Order = _mapper.Map<OrderDto>(visit.Order),

+ 102 - 0
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs

@@ -0,0 +1,102 @@
+using DotNetCore.CAP;
+using Hotline.Configurations;
+using Hotline.FlowEngine.Notifications;
+using Hotline.FlowEngine.WorkflowModules;
+using Hotline.Orders;
+using Hotline.Share.Dtos.Order;
+using Hotline.Share.Enums.Order;
+using Hotline.Share.Mq;
+using MapsterMapper;
+using MediatR;
+using Microsoft.Extensions.Options;
+using XF.Domain.Authentications;
+using XF.Domain.Repository;
+
+namespace Hotline.Application.Orders.Handles.OrderScreen;
+public class OrderScreenNextWorkflowHandler : INotificationHandler<NextStepNotify>
+{
+    private readonly ICapPublisher _capPublisher;
+    private readonly IMapper _mapper;
+    private readonly IOrderScreenRepository _orderScreenRepository;
+    private readonly ISessionContext _sessionContext;
+    private readonly IRepository<OrderScreenDetail> _orderScreenDetailRepository;
+    private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
+
+    public OrderScreenNextWorkflowHandler(
+        ICapPublisher capPublisher,
+        IMapper mapper,
+        IOrderScreenRepository orderScreenRepository,
+        ISessionContext sessionContext,
+        IOptionsSnapshot<AppConfiguration> appOptions,
+        IRepository<OrderScreenDetail> orderScreenDetailRepository)
+    {
+        _capPublisher = capPublisher;
+        _mapper = mapper;
+        _orderScreenRepository = orderScreenRepository;
+        _sessionContext = sessionContext;
+        _orderScreenDetailRepository = orderScreenDetailRepository;
+        _appOptions = appOptions;
+    }
+
+    /// <summary>Handles a notification</summary>
+    /// <param name="notification">The notification</param>
+    /// <param name="cancellationToken">Cancellation token</param>
+    public async Task Handle(NextStepNotify notification, CancellationToken cancellationToken)
+    {
+        if (notification.Workflow.ModuleCode == WorkflowModuleConsts.OrderScreen)
+        {
+            var workflow = notification.Workflow;
+            var nextTag = string.IsNullOrEmpty(notification.NextStepDefine.Tag)
+                ? null
+                : System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.NextStepDefine.Tag);
+            var screen = await _orderScreenRepository.Queryable().Includes(x => x.Order)
+                .Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
+            if (screen != null)
+            {
+                screen.Status = EScreenStatus.Approval;
+                screen.Flowed(workflow.FlowedUserIds, workflow.FlowedOrgIds, workflow.HandlerUsers, workflow.HandlerOrgs);
+                //如果下个节点是省审批,则修改为省甄别
+                if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org && nextTag.Value == TagDefaults.TagValue.Province)
+                    screen.IsProScreen = true;
+                await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
+            }
+
+            if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org)
+            {
+                switch (nextTag.Value)
+                {
+                    case TagDefaults.TagValue.Province:
+                        if (screen != null)
+                        {
+                            var screenDto = _mapper.Map<OrderScreenListDto>(screen);
+                            if (screen.Order != null && screen.Order.Source == ESource.ProvinceStraight)
+                            {
+                                var screenOrderDto = _mapper.Map<OrderDto>(screen.Order);
+                                //省件甄别--以省审批前一个节点整理的甄别意见为准推送省上 宜宾
+                                if (_appOptions.Value.IsYiBin)
+                                {
+                                    screenDto.Content = notification.Dto.Opinion;
+                                    screenDto.Files = new List<Share.Dtos.File.FileDto>();
+                                }
+                                //推省上
+                                _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+                                {
+                                    Order = screenOrderDto,
+                                    Screen = screenDto,
+                                    ClientGuid = ""
+                                });
+                            }
+                        }
+
+                        break;
+                }
+            }
+            OrderScreenDetail detail = new OrderScreenDetail
+            {
+                ScreenId = screen.Id
+            };
+            detail.Audit(_sessionContext.UserId, _sessionContext.UserName, _sessionContext.OrgId, _sessionContext.OrgName, 1);
+            await _orderScreenDetailRepository.AddAsync(detail, cancellationToken);
+        }
+    }
+}

+ 37 - 0
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs

@@ -0,0 +1,37 @@
+using Hotline.FlowEngine.Notifications;
+using Hotline.FlowEngine.WorkflowModules;
+using Hotline.Orders;
+using MediatR;
+
+namespace Hotline.Application.Orders.Handles.OrderScreen;
+
+public class OrderScreenStartWorkflowHandler : INotificationHandler<StartWorkflowNotify>
+{
+    private readonly IOrderScreenRepository _orderScreenRepository;
+
+    public OrderScreenStartWorkflowHandler(
+        IOrderScreenRepository orderScreenRepository
+    )
+    {
+        _orderScreenRepository = orderScreenRepository;
+    }
+
+    /// <summary>Handles a notification</summary>
+    /// <param name="notification">The notification</param>
+    /// <param name="cancellationToken">Cancellation token</param>
+    public async Task Handle(StartWorkflowNotify notification, CancellationToken cancellationToken)
+    {
+        if (notification.Workflow.ModuleCode == WorkflowModuleConsts.OrderScreen)
+        {
+            var workflow = notification.Workflow;
+            var screen = await _orderScreenRepository.Queryable().Includes(x => x.Order)
+                .Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
+            if (screen != null)
+            {
+                screen.WorkflowId = workflow.Id;
+                screen.Flowed(workflow.FlowedUserIds, workflow.FlowedOrgIds, workflow.HandlerUsers, workflow.HandlerOrgs);
+                await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
+            }
+        }
+    }
+}

+ 1 - 1
src/Hotline.Application/Handlers/Order/GuiderSystemTimeoutHandler.cs → src/Hotline.Application/Orders/Handles/SnapshotHandler/GuiderSystemTimeoutHandler.cs

@@ -17,7 +17,7 @@ using Hotline.Snapshot.Notifications;
 using MediatR;
 using XF.Domain.Exceptions;
 
-namespace Hotline.Application.Handlers.Order
+namespace Hotline.Application.Orders.Handles.Snapshot
 {
     /// <summary>
     /// 需求:坐席派给网格员的安全隐患工单若未推送成功超过4小时或者网格员超过4小时没回复,则自动流转到标注节点待标注列表

+ 0 - 102
src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs

@@ -1,102 +0,0 @@
-using DotNetCore.CAP;
-using Hotline.Configurations;
-using Hotline.FlowEngine.Notifications;
-using Hotline.FlowEngine.WorkflowModules;
-using Hotline.Orders;
-using Hotline.Share.Dtos.Order;
-using Hotline.Share.Enums.Order;
-using Hotline.Share.Mq;
-using MapsterMapper;
-using MediatR;
-using Microsoft.Extensions.Options;
-using XF.Domain.Authentications;
-using XF.Domain.Repository;
-
-namespace Hotline.Application.Orders.OrderScreenHandler;
-public class OrderScreenNextWorkflowHandler : INotificationHandler<NextStepNotify>
-{
-	private readonly ICapPublisher _capPublisher;
-	private readonly IMapper _mapper;
-	private readonly IOrderScreenRepository _orderScreenRepository;
-	private readonly ISessionContext _sessionContext;
-	private readonly IRepository<OrderScreenDetail> _orderScreenDetailRepository;
-	private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
-
-	public OrderScreenNextWorkflowHandler(
-		ICapPublisher capPublisher,
-		IMapper mapper,
-		IOrderScreenRepository orderScreenRepository,
-		ISessionContext sessionContext,
-		IOptionsSnapshot<AppConfiguration> appOptions,
-		IRepository<OrderScreenDetail> orderScreenDetailRepository)
-	{
-		_capPublisher = capPublisher;
-		_mapper = mapper;
-		_orderScreenRepository = orderScreenRepository;
-		_sessionContext = sessionContext;
-		_orderScreenDetailRepository = orderScreenDetailRepository;
-		_appOptions = appOptions;
-	}
-
-	/// <summary>Handles a notification</summary>
-	/// <param name="notification">The notification</param>
-	/// <param name="cancellationToken">Cancellation token</param>
-	public async Task Handle(NextStepNotify notification, CancellationToken cancellationToken)
-	{
-		if (notification.Workflow.ModuleCode == WorkflowModuleConsts.OrderScreen) 
-		{
-			var workflow = notification.Workflow;
-			var nextTag = string.IsNullOrEmpty(notification.NextStepDefine.Tag)
-				? null
-				: System.Text.Json.JsonSerializer.Deserialize<DefinitionTag>(notification.NextStepDefine.Tag);
-			var screen = await _orderScreenRepository.Queryable().Includes(x => x.Order)
-				.Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
-			if (screen != null)
-			{
-				screen.Status = EScreenStatus.Approval;
-				screen.Flowed(workflow.FlowedUserIds, workflow.FlowedOrgIds, workflow.HandlerUsers, workflow.HandlerOrgs);
-				//如果下个节点是省审批,则修改为省甄别
-				if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org && nextTag.Value == TagDefaults.TagValue.Province)
-					screen.IsProScreen = true;
-				await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
-			}
-
-			if (nextTag is not null && nextTag.Type == TagDefaults.TagType.Org)
-			{
-				switch (nextTag.Value)
-				{
-					case TagDefaults.TagValue.Province:
-						if (screen != null)
-						{
-							var screenDto = _mapper.Map<OrderScreenListDto>(screen);
-							if (screen.Order != null && screen.Order.Source == ESource.ProvinceStraight)
-							{
-								var screenOrderDto = _mapper.Map<OrderDto>(screen.Order);
-								//省件甄别--以省审批前一个节点整理的甄别意见为准推送省上 宜宾
-								if (_appOptions.Value.IsYiBin)
-								{
-									screenDto.Content = notification.Dto.Opinion;
-									screenDto.Files = new List<Share.Dtos.File.FileDto>();
-								}
-								//推省上
-								_capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
-								{
-									Order = screenOrderDto,
-									Screen = screenDto,
-									ClientGuid = ""
-								});
-							}
-						}
-
-						break;
-				}
-			}
-			OrderScreenDetail detail = new OrderScreenDetail
-			{
-				ScreenId = screen.Id
-			};
-			detail.Audit(_sessionContext.UserId, _sessionContext.UserName, _sessionContext.OrgId, _sessionContext.OrgName, 1);
-			await _orderScreenDetailRepository.AddAsync(detail, cancellationToken);
-		}
-	}
-}

+ 0 - 37
src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenStartWorkflowHandler.cs

@@ -1,37 +0,0 @@
-using Hotline.FlowEngine.Notifications;
-using Hotline.FlowEngine.WorkflowModules;
-using Hotline.Orders;
-using MediatR;
-
-namespace Hotline.Application.Orders.OrderScreenHandler;
-
-public class OrderScreenStartWorkflowHandler : INotificationHandler<StartWorkflowNotify>
-{
-	private readonly IOrderScreenRepository _orderScreenRepository;
-
-	public OrderScreenStartWorkflowHandler(
-		IOrderScreenRepository orderScreenRepository
-	)
-	{
-		_orderScreenRepository = orderScreenRepository;
-	}
-
-	/// <summary>Handles a notification</summary>
-	/// <param name="notification">The notification</param>
-	/// <param name="cancellationToken">Cancellation token</param>
-	public async Task Handle(StartWorkflowNotify notification, CancellationToken cancellationToken)
-	{
-		if (notification.Workflow.ModuleCode == WorkflowModuleConsts.OrderScreen)
-		{
-			var workflow = notification.Workflow;
-			var screen = await _orderScreenRepository.Queryable().Includes(x => x.Order)
-				.Where(x => x.Id == workflow.ExternalId).FirstAsync(cancellationToken);
-			if (screen != null)
-			{
-				screen.WorkflowId = workflow.Id;
-				screen.Flowed(workflow.FlowedUserIds, workflow.FlowedOrgIds, workflow.HandlerUsers, workflow.HandlerOrgs);
-				await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
-			}
-		}
-	}
-}

+ 17 - 9
src/Hotline.Share/Dtos/FlowEngine/BasicWorkflowDto.cs

@@ -20,6 +20,8 @@ public class BasicWorkflowDto : EndWorkflowDto
     public bool BackToCountersignEnd { get; set; }
 
     public EFlowDirection? FlowDirection { get; set; }
+    
+    #region currentStepInfo
 
     /// <summary>
     /// 办理对象类型
@@ -31,6 +33,20 @@ public class BasicWorkflowDto : EndWorkflowDto
     /// </summary>
     public EStepType StepType { get; set; }
 
+    /// <summary>
+    /// 模板配置节点业务类型
+    /// </summary>
+    public EBusinessType BusinessType { get; set; }
+
+    /// <summary>
+    /// 发起会签
+    /// </summary>
+    public bool IsStartCountersign { get; set; }
+
+    public string Tag { get; set; }
+
+    #endregion
+
     /// <summary>
     /// 根据办理者类型不同,此字段为不同内容
     /// <example>
@@ -49,10 +65,7 @@ public class BasicWorkflowDto : EndWorkflowDto
     /// </summary>
     public string? NextMainHandler { get; set; }
 
-    /// <summary>
-    /// 发起会签
-    /// </summary>
-    public bool IsStartCountersign { get; set; }
+   
 
     ///// <summary>
     ///// 办理方式
@@ -64,11 +77,6 @@ public class BasicWorkflowDto : EndWorkflowDto
     /// </summary>
     public External External { get; set; }
 
-    /// <summary>
-    /// 模板配置节点业务类型
-    /// </summary>
-    public EBusinessType BusinessType { get; set; }
-
     /// <summary>
     /// 审核结果(非审批流程无意义)
     /// </summary>

+ 2 - 0
src/Hotline.Share/Dtos/FlowEngine/NextStepOption.cs

@@ -35,6 +35,8 @@ public class NextStepOption : Kv
     /// </summary>
     public EHandlerType HandlerType { get; set; }
 
+    public string Tag { get; set; }
+
     /// <summary>
     /// 节点部门等级(非部门等级办理时无效)
     /// </summary>

+ 9 - 0
src/Hotline.Share/Dtos/Order/OrderStartFlowDto.cs

@@ -134,6 +134,15 @@ namespace Hotline.Share.Dtos.Order
         public ETimeType? TimeLimitUnit { get; set; }
 
         #endregion
+
+        #region 随手拍业务
+
+        /// <summary>
+        /// 部门标记是否安全生产
+        /// </summary>
+        public bool? IsSafetyDepartment { get; set; }
+
+        #endregion
     }
 
     public class CrossStep : BasicWorkflowDto