浏览代码

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

qinchaoyue 5 月之前
父节点
当前提交
9ee861f713

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

@@ -2066,7 +2066,7 @@ public class OrderController : BaseController
 
         var stream = ExcelHelper.CreateStream(dtos);
 
-        return ExcelStreamResult(stream, "工单甄别列表数据");
+        return ExcelStreamResult(stream, "工单甄别数据");
     }
 
 
@@ -4915,7 +4915,8 @@ public class OrderController : BaseController
                 {
                     var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
                     dto.NextHandlers = new List<FlowStepHandler> { handler };
-                }
+                    await _orderSpecialRepository.Updateable().SetColumns(x => new OrderSpecial { NextHandlers = dto.NextHandlers }).Where(x => x.Id == model.Id).ExecuteCommandAsync();
+				}
             }
 
             var recall = new RecallDto
@@ -5122,7 +5123,8 @@ public class OrderController : BaseController
                 {
                     var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
                     dto.NextHandlers = new List<FlowStepHandler> { handler };
-                }
+                    await _orderSpecialRepository.Updateable().SetColumns(x => new OrderSpecial { NextHandlers = dto.NextHandlers }).Where(x => x.Id == model.Id).ExecuteCommandAsync();
+				}
             }
 
             var recall = new RecallDto
@@ -5242,15 +5244,16 @@ public class OrderController : BaseController
         var order = await _orderRepository.GetAsync(x => x.Id == special.OrderId);
         if (special.State == 1)
         {
-            if (_appOptions.Value.IsZiGong && dto.BusinessType == EBusinessType.Send)
+            if (_appOptions.Value.IsZiGong && special.BusinessType == EBusinessType.Send)
             {
                 // 平均派单
                 var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
                 if (averageSendOrder)
                 {
                     var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
-                    dto.NextHandlers = new List<FlowStepHandler> { handler };
-                }
+                    special.NextHandlers = new List<FlowStepHandler> { handler };
+                    await _orderSpecialRepository.Updateable().SetColumns(x => new OrderSpecial { NextHandlers = special.NextHandlers }).Where(x => x.Id == special.Id).ExecuteCommandAsync();
+				}
             }
 
             var recall = new RecallDto
@@ -5389,7 +5392,19 @@ public class OrderController : BaseController
             var order = await _orderRepository.GetAsync(x => x.Id == special.OrderId);
             if (special.State == 1)
             {
-                var recall = new RecallDto
+	            if (_appOptions.Value.IsZiGong && special.BusinessType == EBusinessType.Send)
+	            {
+		            // 平均派单
+		            var averageSendOrder = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.AverageSendOrder).SettingValue[0]);
+		            if (averageSendOrder)
+		            {
+			            var handler = await _orderDomainService.AverageOrder(HttpContext.RequestAborted);
+			            special.NextHandlers = new List<FlowStepHandler> { handler };
+			            await _orderSpecialRepository.Updateable().SetColumns(x => new OrderSpecial { NextHandlers = special.NextHandlers }).Where(x => x.Id == special.Id).ExecuteCommandAsync();
+					}
+	            }
+
+				var recall = new RecallDto
                 {
                     WorkflowId = special.WorkflowId!,
                     NextStepCode = special.NextStepCode,

+ 24 - 12
src/Hotline.Application/Orders/OrderApplication.cs

@@ -114,8 +114,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
     private readonly IRepository<OrderObserve> _orderObserveRepository;
     private readonly IOrderTerminateRepository _orderTerminateRepository;
     private readonly IRepository<OrderPublishHistory> _orderPublishHistoryRepository;
+    private readonly IOrderDelayRepository _orderDelayRepository;
 
-    public OrderApplication(
+	public OrderApplication(
         IOrderDomainService orderDomainService,
         IOrderRepository orderRepository,
         IWorkflowDomainService workflowDomainService,
@@ -151,7 +152,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         IRepository<TranspondCityRawData> transpondCityRawDataRepository,
         IRepository<OrderObserve> orderObserveRepository,
         IOrderTerminateRepository orderTerminateRepository,
-        IRepository<OrderPublishHistory> orderPublishHistoryRepository)
+        IRepository<OrderPublishHistory> orderPublishHistoryRepository,
+        IOrderDelayRepository orderDelayRepository)
     {
         _orderDomainService = orderDomainService;
         _workflowDomainService = workflowDomainService;
@@ -189,7 +191,9 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         _orderTerminateRepository = orderTerminateRepository;
         _orderPublishHistoryRepository = orderPublishHistoryRepository;
         _sessionContext = sessionContext;
-    }
+        _orderDelayRepository = orderDelayRepository;
+
+	}
 
     /// <summary>
     /// 更新工单办理期满时间(延期调用,其他不调用)
@@ -2561,16 +2565,23 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         var screen = await _orderScreenRepository.Queryable().Where(x => x.OrderId == dto.OrderId && (int)x.Status < 2).ToListAsync(cancellationToken);
         //var order = await _orderRepository.Queryable().Includes(d => d.Workflow).FirstAsync(d => d.Id == dto.OrderId);
         var sendBackAudit = await _orderSendBackAuditRepository.Queryable().Where(x => x.OrderId == dto.OrderId && x.State == ESendBackAuditState.Apply).ToListAsync(cancellationToken);
-        if (_appOptions.Value.IsYiBin)
+        var orderDelay = await _orderDelayRepository.Queryable().Where(x => x.OrderId == dto.OrderId && x.DelayState == EDelayState.Examining).ToListAsync(cancellationToken);
+
+		if (_appOptions.Value.IsYiBin)
         {
             if (screen.Any())
             {
-                _orderScreenRepository.RemoveRangeAsync(screen, true, cancellationToken);
+               await  _orderScreenRepository.RemoveRangeAsync(screen, true, cancellationToken);
             }
 
             if (sendBackAudit.Any())
             {
-                _orderSendBackAuditRepository.RemoveRangeAsync(sendBackAudit, true, cancellationToken);
+               await _orderSendBackAuditRepository.RemoveRangeAsync(sendBackAudit, true, cancellationToken);
+            }
+
+            if (orderDelay.Any())
+            {
+                await _orderDelayRepository.RemoveRangeAsync(orderDelay, true, cancellationToken);
             }
 
             if (order.Workflow.IsInCountersign)
@@ -2700,7 +2711,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
             }
 
             _mapper.Map(expiredTimeConfig, order);
-            await _orderRepository.UpdateAsync(order, cancellationToken);
+            //await _orderRepository.UpdateAsync(order, cancellationToken);
             //特提(撤回至发起)
             if (!string.IsNullOrEmpty(order.WorkflowId))
             {
@@ -2721,13 +2732,13 @@ public class OrderApplication : IOrderApplication, IScopeDependency
                     order.ExpiredTime, nextHandler, cancellationToken);
                 order.FileEmpty();
 
-                var status = EOrderStatus.WaitForAccept;
+                order.Status = EOrderStatus.WaitForAccept;
                 if (isPaiDan)
                 {
-	                status = EOrderStatus.Handling;
+	                order.Status = EOrderStatus.Handling;
                 }
-                await _orderRepository.Updateable().SetColumns(o => new Order { Status = status }).Where(o => o.Id == order.Id).ExecuteCommandAsync(cancellationToken);
-                //await _orderRepository.UpdateAsync(order, cancellationToken);
+                //await _orderRepository.Updateable().SetColumns(o => new Order { Status = status }).Where(o => o.Id == order.Id).ExecuteCommandAsync(cancellationToken);
+                
                 //处理回访和发布信息
 
                 var publish = await _orderPublishRepository.GetAsync(x => x.OrderId == order.Id);
@@ -2753,9 +2764,10 @@ public class OrderApplication : IOrderApplication, IScopeDependency
                 }
 
             }
+            await _orderRepository.UpdateAsync(order, cancellationToken);
             //await _workflowDomainService.RecallToStartStepAsync(order.WorkflowId, "省工单重派", current, cancellationToken);
         }
-        return _mapper.Map<AddOrderResponse>(order);
+		return _mapper.Map<AddOrderResponse>(order);
     }
 
     /// <summary>

+ 5 - 6
src/Hotline.Application/Subscribers/DatasharingSubscriber.cs

@@ -656,7 +656,7 @@ namespace Hotline.Application.Subscribers
             {
                 //处理省下行回访
                 var order = await _orderRepository.Queryable().Where(x => x.ReceiveProvinceNo == dto.ProvinceNo).FirstAsync();
-                if (order != null)
+                if (order != null && order.Status<= EOrderStatus.Filed)
                 {
                     //判断是否有发布数据
                     var orderPublish = await _orderPublishRepository.Queryable()
@@ -680,11 +680,10 @@ namespace Hotline.Application.Subscribers
                     orderVisit = new OrderVisit();
                     orderVisit.No = order.No;
                     orderVisit.OrderId = order.Id;
-                    orderVisit.VisitState = EVisitState.WaitForVisit;
                     orderVisit.PublishTime = DateTime.Now;
                     orderVisit.IsCanHandle = true;
                     orderVisit.EmployeeId = order.CenterToOrgHandlerId;
-                    orderVisit.VisitState = EVisitState.Visited;
+                    orderVisit.VisitState = EVisitState.None;
                     orderVisit.VisitTime = dto.VisitTime;
                     orderVisit.VisitType = dto.VisitType;
                     orderVisit.IsCanAiVisit = false;
@@ -721,9 +720,9 @@ namespace Hotline.Application.Subscribers
 
 
                     await _orderVisitedDetailRepository.AddRangeAsync(visitedDetail, cancellationToken);
-                    order.Visited(satisfy.Key, satisfy.Value);
-                    order.Status = EOrderStatus.Visited;
-                    await _orderRepository.UpdateAsync(order, cancellationToken);
+                    //order.Visited(satisfy.Key, satisfy.Value);
+                    //order.Status = EOrderStatus.Visited;
+                    //await _orderRepository.UpdateAsync(order, cancellationToken);
                 }
             }
         }

+ 18 - 12
src/Hotline/FlowEngine/WorkflowModules/WorkflowModuleConsts.cs

@@ -35,9 +35,14 @@ public class WorkflowModuleConsts
     public const string KnowledgeUpdate = "KnowledgeUpdate";
 
     /// <summary>
-    /// 知识删除
+    /// 知识下架
     /// </summary>
-    public const string KnowledgeDelete = "KnowledgeDelete";
+    public const string KnowledgeOffshelf = "KnowledgeOffshelf";
+
+	/// <summary>
+	/// 知识删除
+	/// </summary>
+	public const string KnowledgeDelete = "KnowledgeDelete";
 
     /// <summary>
     /// 分机小休申请
@@ -58,14 +63,15 @@ public class WorkflowModuleConsts
 	public static List<WorkflowModule> AllModules =>
         new()
         {
-            new(OrderHandle, "工单办理"),
-            new(KnowledgeAdd, "新增知识审批"),
-            new(KnowledgeUpdate, "知识更新"),
-            new(KnowledgeDelete, "知识删除"),
-            new(TelRestApply, "分机小休申请"),
-            new(OrderDelay,"工单延期"),
-            new(OrderPrevious,"工单退回"),
-            new(OrderScreen,"工单甄别"),
-            new(OrderTerminate,"工单终止"),
-        };
+			new(OrderHandle, "工单办理"),
+			new(KnowledgeAdd, "新增知识"),
+			new(KnowledgeUpdate, "知识更新"),
+			new(KnowledgeOffshelf,"知识下架"),
+			new(KnowledgeDelete, "知识删除"),
+			new(TelRestApply, "分机小休申请"),
+			new(OrderDelay,"工单延期"),
+			new(OrderPrevious,"工单退回"),
+			new(OrderScreen,"工单甄别"),
+			new(OrderTerminate,"工单终止"),
+		};
 }