Browse Source

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

qinchaoyue 3 months ago
parent
commit
f8936cb275

+ 6 - 2
src/Hotline.Application/Orders/Handles/OrderScreenHandler/OrderScreenNextWorkflowHandler.cs

@@ -77,8 +77,12 @@ public class OrderScreenNextWorkflowHandler : INotificationHandler<NextStepNotif
                                     screenDto.Content = notification.Dto.Opinion;
                                     screenDto.Files = new List<Share.Dtos.File.FileDto>();
                                 }
-                                //推省上
-                                _capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
+								if (_appOptions.Value.IsLuZhou)
+								{
+									screenDto.Content = notification.Dto.Opinion;
+								}
+								//推省上
+								_capPublisher.Publish(EventNames.HotlineOrderScreenApply, new PublishScreenDto()
                                 {
                                     Order = screenOrderDto,
                                     Screen = screenDto,

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

@@ -1,106 +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>();
-								}
-								if (_appOptions.Value.IsLuZhou)
-								{
-									screenDto.Content = notification.Dto.Opinion;
-								}
-								//推省上
-								_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);
-		}
-	}
-}

+ 4 - 3
src/Hotline.Application/Tools/StringExtensions.cs

@@ -31,17 +31,18 @@ public static class StringExtensions
 
         //去除html标签
         var sb = new StringBuilder();
-        while (content.StartsWith('<') || content.EndsWith('>'))
+        while (!string.IsNullOrEmpty(content) && (content.StartsWith('<') || content.EndsWith('>')))
         {
             var indexright = content.IndexOf('>');
             var indexSecLeft = content.IndexOf('<', indexright);
             if (indexSecLeft < indexright)
             {
-                content = content.Remove(0, indexright);
+                content = content.Remove(0, indexright + 1);
             }
             else
             {
-                var str = content.Substring(indexright, indexSecLeft - indexright + 1);
+                var startIndex = indexright + 1;
+                var str = content.Substring(startIndex, indexSecLeft - startIndex);
                 if (!string.IsNullOrEmpty(str)) sb.AppendLine(str);
                 content = content.Remove(0, indexSecLeft);
             }

+ 3 - 1
src/Hotline.Share/Dtos/Order/OrderBiDto.cs

@@ -535,7 +535,9 @@ namespace Hotline.Share.Dtos.Order
         /// <summary>
         /// 是否省工单(空为全部  true为省工单 false为市工单)
         /// </summary>
-        public bool? IsProvinceOrder { get; set; }
+        public bool IsProvinceOrder { get; set; }
+
+        public string IsProvinceText => IsProvinceOrder ? "省工单" : "市工单";
     }
 
 

+ 33 - 0
src/Hotline.Share/Enums/FlowEngine/EBusinessType.cs

@@ -28,9 +28,42 @@ public enum EBusinessType
     [Description("部门领导节点")]
     DepartmentLeader = 3,
 
+    /// <summary>
+    /// 中心班长
+    /// </summary>
+    [Description("中心班长")]
+    CenterMonitor = 4,
+
+    /// <summary>
+    /// 中心领导
+    /// </summary>
+    [Description("中心领导")]
+    CenterLeader = 5,
+
     /// <summary>
     /// 归档节点
     /// </summary>
     [Description("归档节点")]
     File = 99,
+
+    [Description("其他")]
+    Unknown = 100,
+
+    /// <summary>
+    /// 发布
+    /// </summary>
+    [Description("发布节点")]
+    Publish = 110,
+
+    /// <summary>
+    /// 回访
+    /// </summary>
+    [Description("回访节点")]
+    Visit = 120,
+
+    /// <summary>
+    /// 结束(为了与老系统保持一致,额外添加在回访后的节点)
+    /// </summary>
+    [Description("结束节点(兼容老系统习惯)")]
+    TrashEnd = 130,
 }