浏览代码

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

田爽 5 月之前
父节点
当前提交
390fc39831

+ 16 - 8
src/Hotline.Api/Controllers/WebPortalController.cs

@@ -959,14 +959,22 @@ namespace Hotline.Api.Controllers
         {
             var startDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
             var endDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
-            GetStatistDto getStatistDto = new()
-            {
-                AllCount = await _orderRepository.Queryable().Where(p => p.Status > EOrderStatus.WaitForAccept).CountAsync(),
-                AllTrandCount = await _orderRepository.Queryable().Where(p => p.Status >= EOrderStatus.Filed).CountAsync(),
-                DayCount = await _orderRepository.Queryable().Where(p => p.StartTime >= startDate && p.StartTime <= endDate && p.Status > EOrderStatus.WaitForAccept).CountAsync(),
-                DayTrandCount = await _orderRepository.Queryable().Where(p => p.ActualHandleTime >= startDate && p.ActualHandleTime <= endDate && p.Status >= EOrderStatus.Filed).CountAsync()
-            };
-
+            //GetStatistDto getStatistDto = new()
+            //{
+            //    AllCount = await _orderRepository.Queryable().Where(p => p.Status > EOrderStatus.WaitForAccept).CountAsync(),
+            //    AllTrandCount = await _orderRepository.Queryable().Where(p => p.Status >= EOrderStatus.Filed).CountAsync(),
+            //    DayCount = await _orderRepository.Queryable().Where(p => p.StartTime >= startDate && p.StartTime <= endDate && p.Status > EOrderStatus.WaitForAccept).CountAsync(),
+            //    DayTrandCount = await _orderRepository.Queryable().Where(p => p.ActualHandleTime >= startDate && p.ActualHandleTime <= endDate && p.Status >= EOrderStatus.Filed).CountAsync()
+            //};
+            var getStatistDto = await _orderRepository.Queryable()
+          .Select(p => new GetStatistDto
+          {
+              AllCount = SqlFunc.AggregateSum(SqlFunc.IIF(p.Status > EOrderStatus.WaitForAccept, 1, 0)),
+              AllTrandCount = SqlFunc.AggregateSum(SqlFunc.IIF(p.Status >= EOrderStatus.Filed, 1, 0)),
+              DayCount = SqlFunc.AggregateSum(SqlFunc.IIF(p.StartTime >= startDate && p.StartTime <= endDate && p.Status > EOrderStatus.WaitForAccept, 1, 0)),
+              DayTrandCount = SqlFunc.AggregateSum(SqlFunc.IIF(p.ActualHandleTime >= startDate && p.ActualHandleTime <= endDate && p.Status >= EOrderStatus.Filed, 1, 0)),
+          })
+          .FirstAsync();
             return OpenResponse.Ok(WebPortalDeResponse<GetStatistDto>.Success(getStatistDto));
         }
         #endregion

+ 1 - 1
src/Hotline/FlowEngine/Workflows/Workflow.cs

@@ -641,7 +641,7 @@ public partial class Workflow
     public void EndCountersign()
     {
         IsInCountersign = false;
-        TopCountersignStepId = null;
+        //TopCountersignStepId = null;
     }
 
     /// <summary>

+ 3 - 1
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -276,7 +276,9 @@ namespace Hotline.FlowEngine.Workflows
 
             StepDefine nextStepDefine;
             if (isNextDynamic
-                || (currentStep.IsInCountersign() && !currentStep.IsTopCountersignEndStep(workflow.TopCountersignStepId))
+                || (workflow.IsInCountersign
+                    && currentStep.IsInCountersign() 
+                    && !currentStep.IsTopCountersignEndStep(workflow.TopCountersignStepId))
                 || dto.IsStartCountersign)
             {
                 //下一步配置为当前节点配置