فهرست منبع

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

田爽 10 ماه پیش
والد
کامیت
a4f5c2cb52
22فایلهای تغییر یافته به همراه728 افزوده شده و 703 حذف شده
  1. 25 25
      src/Hotline.Api/Controllers/Bi/BiCallController.cs
  2. 190 295
      src/Hotline.Api/Controllers/Bi/BiOrderController.cs
  3. 44 48
      src/Hotline.Api/Controllers/Bigscreen/DataScreenController.cs
  4. 31 31
      src/Hotline.Api/Controllers/Bigscreen/EnforcementScreenController.cs
  5. 37 37
      src/Hotline.Api/Controllers/EnforcementOrderController.cs
  6. 98 94
      src/Hotline.Api/Controllers/OrderController.cs
  7. 14 5
      src/Hotline.Api/Controllers/TestController.cs
  8. 0 105
      src/Hotline.Api/config/appsettings.Development.json
  9. 11 2
      src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs
  10. 12 3
      src/Hotline.Application/Orders/OrderApplication.cs
  11. 24 24
      src/Hotline.Application/StatisticalReport/OrderReportApplication.cs
  12. 11 11
      src/Hotline.Share/Dtos/Bi/BiOrderDto.cs
  13. 8 8
      src/Hotline.Share/Dtos/JudicialManagement/QueryEventClassificationStatisticsDto.cs
  14. 161 0
      src/Hotline.Share/Dtos/Order/OrderBiDto.cs
  15. 4 0
      src/Hotline.Share/Dtos/Realtime/SeatStateDto.cs
  16. 2 2
      src/Hotline.Share/Requests/DepartmentKeyWordRequest.cs
  17. 2 2
      src/Hotline.Share/Requests/DepartmentalProcessingStatisticsDto.cs
  18. 2 2
      src/Hotline.Share/Requests/HighFrequencyCallStatisticsListRequest.cs
  19. 2 2
      src/Hotline/FlowEngine/Workflows/IWorkflowDomainService.cs
  20. 4 5
      src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs
  21. 45 1
      src/Hotline/Orders/Order.cs
  22. 1 1
      src/Hotline/Settings/TimeLimits/TimeLimitDomainService.cs

+ 25 - 25
src/Hotline.Api/Controllers/Bi/BiCallController.cs

@@ -291,30 +291,30 @@ public class BiCallController : BaseController
     /// <returns></returns>
     [HttpGet("hourcall")]
     [AllowAnonymous]
-    public async Task<List<TrCallHourDto>> QueryHourCall([FromQuery] DateTime beginDate, DateTime? endDate, string source)
+    public async Task<List<TrCallHourDto>> QueryHourCall([FromQuery]DateTime StartTime,DateTime? EndTime, string source)
     {
         //获取配置
         int noConnectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.NoConnectByeTimes)?.SettingValue[0]);
         int effectiveTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.EffectiveTimes)?.SettingValue[0]);
         int connectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.ConnectByeTimes)?.SettingValue[0]);
-        var list = await _trCallRecordRepositoryEx.GetCallHourList(beginDate, endDate, noConnectByeTimes, effectiveTimes, connectByeTimes, source);
+        var list = await _trCallRecordRepositoryEx.GetCallHourList(StartTime, EndTime, noConnectByeTimes,effectiveTimes,connectByeTimes,source);
         return list;
     }
 
-    /// <summary>
-    /// 通话时段统计明细
-    /// </summary>
-    /// <returns></returns>
-    [HttpGet("hourcall_list")]
-    public async Task<object> QueryCallList([FromQuery] DateTime beginDate, DateTime? endDate, string type, string source, TimeSpan? startHourTo, int pageIndex, int pageSize)
-    {
-        //获取配置
-        int noConnectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.NoConnectByeTimes)?.SettingValue[0]);
-        int effectiveTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.EffectiveTimes)?.SettingValue[0]);
-        int connectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.ConnectByeTimes)?.SettingValue[0]);
-        var list = await _trCallRecordRepositoryEx.GetCallList(beginDate, endDate, noConnectByeTimes, effectiveTimes, connectByeTimes, type, source, startHourTo, pageIndex, pageSize);
-        return list;
-    }
+	/// <summary>
+	/// 通话时段统计明细
+	/// </summary>
+	/// <returns></returns>
+	[HttpGet("hourcall_list")]
+	public async Task<object> QueryCallList([FromQuery] DateTime StartTime, DateTime? EndTime, string type, string source, TimeSpan? startHourTo , int pageIndex, int pageSize)
+	{
+		//获取配置
+		int noConnectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.NoConnectByeTimes)?.SettingValue[0]);
+		int effectiveTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.EffectiveTimes)?.SettingValue[0]);
+		int connectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.ConnectByeTimes)?.SettingValue[0]);
+		var list = await _trCallRecordRepositoryEx.GetCallList(StartTime, EndTime, noConnectByeTimes, effectiveTimes, connectByeTimes, type, source, startHourTo,pageIndex, pageSize);
+		return list;
+	}
 
     /// <summary>
     /// 通话时段统计明细获取基本信息
@@ -332,22 +332,22 @@ public class BiCallController : BaseController
         return rsp;
     }
 
-    /// <summary>
-    /// 热线号码统计
-    /// </summary>
-    /// <param name="StartDate"></param>
-    /// <param name="EndDate"></param>
-    /// <returns></returns>
-    [AllowAnonymous]
+	/// <summary>
+	/// 热线号码统计
+	/// </summary>
+	/// <param name="StartTime"></param>
+	/// <param name="EndTime"></param>
+	/// <returns></returns>
+	[AllowAnonymous]
     [HttpGet("gateway-query")]
-    public async Task<List<CallHotLineDto>> QueryGateWay(DateTime beginDate, DateTime endDate, string gateway)
+    public async Task<List<CallHotLineDto>> QueryGateWay(DateTime StartTime, DateTime EndTime,string gateway)
     {
         //获取配置
         int noConnectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.NoConnectByeTimes)?.SettingValue[0]);
         int effectiveTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.EffectiveTimes)?.SettingValue[0]);
         int connectByeTimes = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.ConnectByeTimes)?.SettingValue[0]);
         int ringTims = int.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.RingTims)?.SettingValue[0]);
-        var list = await _trCallRecordRepositoryEx.GetCallHotLineList(beginDate, endDate, gateway, noConnectByeTimes, effectiveTimes, connectByeTimes, ringTims);
+        var list = await _trCallRecordRepositoryEx.GetCallHotLineList(StartTime, EndTime, gateway, noConnectByeTimes, effectiveTimes, connectByeTimes, ringTims);
         return list;
     }
 }

+ 190 - 295
src/Hotline.Api/Controllers/Bi/BiOrderController.cs

@@ -14,6 +14,7 @@ using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Bi;
 using Hotline.Share.Dtos.Bigscreen;
 using Hotline.Share.Dtos.CallCenter;
+using Hotline.Share.Dtos.DataSharing.PusherHotlineDto;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.CallCenter;
@@ -22,6 +23,7 @@ using Hotline.Share.Enums.Order;
 using Hotline.Share.Requests;
 using Hotline.Tools;
 using MapsterMapper;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using NPOI.SS.Formula.Functions;
 using Org.BouncyCastle.Utilities;
@@ -31,6 +33,7 @@ using XF.Domain.Authentications;
 using XF.Domain.Constants;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
+using XF.Utility.EnumExtensions;
 using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
 
 namespace Hotline.Api.Controllers.Bi
@@ -740,13 +743,13 @@ namespace Hotline.Api.Controllers.Bi
         /// </summary>
         /// <returns></returns>
         [HttpGet("visit-measure-statistics")]
-        public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartDate, DateTime EndDate, string? VisitName)
+        public async Task<VisitMeasureStatisticsDto> VisitMeasureStatistics(DateTime StartTime, DateTime EndTime, string? VisitName)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var list = await _orderVisitRepository.Queryable()
                 .Includes(x => x.Employee)
-                 .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited)
+                 .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited)
                  .WhereIF(!string.IsNullOrEmpty(VisitName), x => x.Employee.Name.Contains(VisitName))
                  .GroupBy(x => new { x.EmployeeId, x.Employee.Name })
                  .Select(x => new VisitMeasureStatisticsModelDto()
@@ -762,18 +765,18 @@ namespace Hotline.Api.Controllers.Bi
 
             //查询AIVisit
             returnModel.AiVisitCount = await _aiOrderVisitDetailRepository.Queryable()
-                .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess != null).CountAsync();
+                .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess != null).CountAsync();
 
             returnModel.AiVisitSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
                 .Includes(x => x.OrderVisit)
-                .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
+                .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") != "2").CountAsync();
 
             returnModel.AiVisitNoSatisfiedCount = await _aiOrderVisitDetailRepository.Queryable()
                 .Includes(x => x.OrderVisit)
-                .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
+                .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == true && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "1" && SqlFunc.JsonField(x.OrderVisit.NowEvaluate, "Key") == "2").CountAsync();
 
             returnModel.AIVisitFailCount = await _aiOrderVisitDetailRepository.Queryable()
-                .Where(x => x.AiVisitTime >= StartDate && x.AiVisitTime <= EndDate && x.IsSuccess == false).CountAsync();
+                .Where(x => x.AiVisitTime >= StartTime && x.AiVisitTime <= EndTime && x.IsSuccess == false).CountAsync();
 
 
             return returnModel;
@@ -782,14 +785,14 @@ namespace Hotline.Api.Controllers.Bi
         /// <summary>
         /// 热点类型小类统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="TypeId">0:全部 ,1:市民,2:企业</param>
         /// <returns></returns>
         [HttpGet("hotspot-statistics")]
-        public async Task<object> HotspotStatistics(DateTime StartDate, DateTime EndDate, int TypeId, string? HotspotCode)
+        public async Task<object> HotspotStatistics(DateTime StartTime, DateTime EndTime, int TypeId, string? HotspotCode)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var IsCenter = _sessionContext.OrgIsCenter;
 
@@ -797,7 +800,7 @@ namespace Hotline.Api.Controllers.Bi
             {
                 var list = await _hotspotTypeRepository.Queryable()
                 .LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
-                .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && o.Id != null)
+                .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && o.Id != null)
                 .WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
                 .WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
                 .WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
@@ -826,7 +829,7 @@ namespace Hotline.Api.Controllers.Bi
                 string countx = HotspotCode.Length.ToString();
                 var list = await _hotspotTypeRepository.Queryable()
                 .LeftJoin<Order>((it, o) => it.Id == o.HotspotId)
-                .Where((it, o) => o.CreationTime >= StartDate && o.CreationTime <= EndDate && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
+                .Where((it, o) => o.CreationTime >= StartTime && o.CreationTime <= EndTime && it.ParentId.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>(countx)) == HotspotCode)
                 .WhereIF(TypeId == 1, (it, o) => o.IdentityType == EIdentityType.Citizen)
                 .WhereIF(TypeId == 2, (it, o) => o.IdentityType == EIdentityType.Enterprise)
                 .WhereIF(IsCenter == false, (it, o) => o.ActualHandleOrgCode.StartsWith(_sessionContext.RequiredOrgId))
@@ -854,8 +857,8 @@ namespace Hotline.Api.Controllers.Bi
         /// <summary>
         /// 部门满意度统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="OrgName"></param>
         /// <param name="TypeId">1:办件结果 2:办件态度</param>
         /// <param name="LineNum"></param>
@@ -865,7 +868,7 @@ namespace Hotline.Api.Controllers.Bi
         {
             var data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto);
 
-			var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
             {
                 OrgName = "区县合计",
                 TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
@@ -915,46 +918,46 @@ namespace Hotline.Api.Controllers.Bi
         [HttpPost("visit-org-satisfaction-statistics/_export")]
         public async Task<FileStreamResult> VisitAndOrgSatisfactionStatisticsExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
         {
-	        List<VisitAndOrgSatisfactionStatisticsDto> data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto.QueryDto);
-			var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "区县合计",
-				TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
-			};
-			var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "市直合计",
-				TotalSumCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
-			};
-			var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "总计",
-				TotalSumCount = data.Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = data.Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = data.Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = data.Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = data.Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
-			};
-			data.Add(countySumModel);
-			data.Add(citySumModel);
-			data.Add(sumModel);
+            List<VisitAndOrgSatisfactionStatisticsDto> data = await _orderApplication.VisitAndOrgSatisfactionStatistics(dto.QueryDto);
+            var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "区县合计",
+                TotalSumCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
+            };
+            var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "市直合计",
+                TotalSumCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = data.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
+            };
+            var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "总计",
+                TotalSumCount = data.Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = data.Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = data.Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = data.Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = data.Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = data.Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = data.Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = data.Sum(x => x.NoPutThroughCount),
+            };
+            data.Add(countySumModel);
+            data.Add(citySumModel);
+            data.Add(sumModel);
             dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
             var dtos = data
              .Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
@@ -970,8 +973,8 @@ namespace Hotline.Api.Controllers.Bi
         /// <summary>
         /// 子部门满意度明细
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="OrgCode"></param>
         /// <param name="TypeId"></param>
         /// <param name="LineNum"></param>
@@ -979,8 +982,8 @@ namespace Hotline.Api.Controllers.Bi
         [HttpGet("visit-org-statisfaction-org-detail")]
         public async Task<VisitAndOrgSatisfactionStatisticsResultDto> VisitAndOrgStatisfactionOrgDetail([FromQuery] PagedKeywordSonRequest dto)
         {
-			var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto);
-			var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto);
+            var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
             {
                 OrgName = "区县合计",
                 TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
@@ -1022,93 +1025,93 @@ namespace Hotline.Api.Controllers.Bi
             return new VisitAndOrgSatisfactionStatisticsResultDto { DataList = list, CountySumModel = countySumModel, CitySumModel = citySumModel, SumModel = sumModel };
         }
 
-		/// <summary>
-		/// 部门满意度统计导出
-		/// </summary>
-		/// <returns></returns>
-		[HttpPost("visit-org-statisfaction-org-detail/_export")]
-		public async Task<FileStreamResult> VisitAndOrgStatisfactionOrgDetailExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
-		{
-			var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto.QueryDto);
-			var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "区县合计",
-				TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
-			};
-			var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "市直合计",
-				TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
-			};
-			var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
-			{
-				OrgName = "总计",
-				TotalSumCount = list.Sum(x => x.TotalSumCount),
-				VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
-				SatisfiedCount = list.Sum(x => x.SatisfiedCount),
-				RegardedAsSatisfiedCount = list.Sum(x => x.RegardedAsSatisfiedCount),
-				DefaultSatisfiedCount = list.Sum(x => x.DefaultSatisfiedCount),
-				NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
-				NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
-				NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
-			};
-			list.Add(countySumModel);
-			list.Add(citySumModel);
-			list.Add(sumModel);
-			dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
-			var dtos = list
-			 .Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
-			 .Cast<object>()
-			 .ToList();
-
-			var stream = ExcelHelper.CreateStream(dtos);
-
-			return ExcelStreamResult(stream, "部门满意度统计数据");
-		}
-
-		/// <summary>
-		/// 部门满意度明细
-		/// </summary>
-		/// <param name="StartDate"></param>
-		/// <param name="EndDate"></param>
-		/// <param name="OrgCode"></param>
-		/// <param name="TypeId"></param>
-		/// <param name="LineNum"></param>
-		/// <returns></returns>
-		[HttpGet("visit-org-satisfaction-detail")]
+        /// <summary>
+        /// 部门满意度统计导出
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost("visit-org-statisfaction-org-detail/_export")]
+        public async Task<FileStreamResult> VisitAndOrgStatisfactionOrgDetailExport([FromBody] ExportExcelDto<PagedKeywordSonRequest> dto)
+        {
+            var list = await _orderApplication.VisitAndOrgStatisfactionOrgDetail(dto.QueryDto);
+            var countySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "区县合计",
+                TotalSumCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.County).Sum(x => x.NoPutThroughCount),
+            };
+            var citySumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "市直合计",
+                TotalSumCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = list.Where(x => x.OrgType == EOrgType.City).Sum(x => x.NoPutThroughCount),
+            };
+            var sumModel = new VisitAndOrgSatisfactionStatisticsDto()
+            {
+                OrgName = "总计",
+                TotalSumCount = list.Sum(x => x.TotalSumCount),
+                VerySatisfiedCount = list.Sum(x => x.VerySatisfiedCount),
+                SatisfiedCount = list.Sum(x => x.SatisfiedCount),
+                RegardedAsSatisfiedCount = list.Sum(x => x.RegardedAsSatisfiedCount),
+                DefaultSatisfiedCount = list.Sum(x => x.DefaultSatisfiedCount),
+                NoSatisfiedCount = list.Sum(x => x.NoSatisfiedCount),
+                NoEvaluateCount = list.Sum(x => x.NoEvaluateCount),
+                NoPutThroughCount = list.Sum(x => x.NoPutThroughCount),
+            };
+            list.Add(countySumModel);
+            list.Add(citySumModel);
+            list.Add(sumModel);
+            dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
+            var dtos = list
+             .Select(stu => _mapper.Map(stu, typeof(VisitAndOrgSatisfactionStatisticsDto), dynamicClass))
+             .Cast<object>()
+             .ToList();
+
+            var stream = ExcelHelper.CreateStream(dtos);
+
+            return ExcelStreamResult(stream, "部门满意度统计数据");
+        }
+
+        /// <summary>
+        /// 部门满意度明细
+        /// </summary>
+        /// <param name="StartDate"></param>
+        /// <param name="EndDate"></param>
+        /// <param name="OrgCode"></param>
+        /// <param name="TypeId"></param>
+        /// <param name="LineNum"></param>
+        /// <returns></returns>
+        [HttpGet("visit-org-satisfaction-detail")]
         public async Task<PagedDto<OrderVisitDetailDto>> VisitAndOrgSatisfactionDetail([FromQuery] VisitAndOrgSatisfactionDetailDto dto)
         {
             var (total, items) = await _orderApplication.VisitAndOrgSatisfactionDetail(dto)
-				.ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
+                .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
             return new PagedDto<OrderVisitDetailDto>(total, _mapper.Map<IReadOnlyList<OrderVisitDetailDto>>(items));
         }
 
-		/// <summary>
-		/// 部门满意度明细导出
-		/// </summary>
-		/// <returns></returns>
-		[HttpPost("visit-org-satisfaction-detail/_export")]
+        /// <summary>
+        /// 部门满意度明细导出
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost("visit-org-satisfaction-detail/_export")]
         public async Task<FileStreamResult> VisitAndOrgSatisfactionDetailExport([FromBody] ExportExcelDto<VisitAndOrgSatisfactionDetailDto> dto)
         {
             var query = _orderApplication.VisitAndOrgSatisfactionDetail(dto.QueryDto);
             List<OrderVisitDetail> data;
             if (dto.IsExportAll)
             {
-	            data = await query.ToListAsync(HttpContext.RequestAborted);
+                data = await query.ToListAsync(HttpContext.RequestAborted);
             }
             else
             {
@@ -1121,7 +1124,7 @@ namespace Hotline.Api.Controllers.Bi
             dynamic? dynamicClass = DynamicClassHelper.CreateDynamicClass(dto.ColumnInfos);
 
             var dtos = dataDtos
-				.Select(stu => _mapper.Map(stu, typeof(OrderVisitDetailDto), dynamicClass))
+                .Select(stu => _mapper.Map(stu, typeof(OrderVisitDetailDto), dynamicClass))
                 .Cast<object>()
                 .ToList();
 
@@ -1138,19 +1141,19 @@ namespace Hotline.Api.Controllers.Bi
         /// <param name="EndDate"></param>
         /// <returns></returns>
         [HttpGet("center_report_forms_statistics")]
-        public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartDate, DateTime EndDate)
+        public async Task<CenterReportStatisticsDto> CenterReportFormsStatistics(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             CenterReportStatisticsDto centerReportStatisticsDto = new();
 
             //信件总量
-            int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate).CountAsync();
+            int sourceChannelCount = await _orderRepository.Queryable().Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime).CountAsync();
 
             #region 通话记录
             //通话记录
             var callData = await _trCallRecordRepository.Queryable()
-                .Where(p => p.CreatedTime >= StartDate && p.CreatedTime <= EndDate && p.Gateway != "82826886" && SqlFunc.Length(p.Gateway) != 4)
+                .Where(p => p.CreatedTime >= StartTime && p.CreatedTime <= EndTime && p.Gateway != "82826886" && SqlFunc.Length(p.Gateway) != 4)
                 .Select(o => new CenterReportCallDto
                 {
                     EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.OnState == EOnState.On, 1, 0)),//有效
@@ -1167,7 +1170,7 @@ namespace Hotline.Api.Controllers.Bi
             #region 工单
             //工单
             var orderData = await _orderRepository.Queryable()
-                .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
+                .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
                 .Select(x => new CenterReportOrderDto
                 {
                     EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(true, 1, 0)),
@@ -1183,7 +1186,7 @@ namespace Hotline.Api.Controllers.Bi
             #region 信件来源
             //信件来源
             var sourceChannelData = await _orderRepository.Queryable()
-                .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
+                .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
                 .Select(it => new
                 {
                     SourceChannelCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.SourceChannelCode), "QT", it.SourceChannelCode)
@@ -1222,7 +1225,7 @@ namespace Hotline.Api.Controllers.Bi
             #region 信件分类
             //信件来源
             var acceptTypeData = await _orderRepository.Queryable(false, false, false)
-                .Where(p => p.CreationTime >= StartDate && p.CreationTime <= EndDate)
+                .Where(p => p.CreationTime >= StartTime && p.CreationTime <= EndTime)
                 .Select(it => new
                 {
                     AcceptTypeCode = SqlFunc.IIF(SqlFunc.IsNullOrEmpty(it.AcceptTypeCode), "40", it.AcceptTypeCode)
@@ -1256,15 +1259,15 @@ namespace Hotline.Api.Controllers.Bi
             CenterReportVisitdDto centerReportVisitd = new()
             {
                 Visitd = await _orderVisitRepository.Queryable()
-              .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited).CountAsync(),
+              .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited).CountAsync(),
                 WaitVisitd = await _orderVisitRepository.Queryable()
-             .Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
+             .Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState != EVisitState.None && x.VisitState != EVisitState.Visited).CountAsync()
             };
 
             //部门
             var listOrg = await _orderVisitDetailRepository.Queryable()
                 .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
-                .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
+                .Where((it, o) => it.VisitTarget == EVisitTarget.Org && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
                  .Select((it, o) => new Satisfaction
                  {
                      Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "1") || SqlFunc.JsonListObjectAny(it.OrgProcessingResults, "key", "2"), 1, 0)),
@@ -1285,7 +1288,7 @@ namespace Hotline.Api.Controllers.Bi
             //坐席
             var listSet = await _orderVisitDetailRepository.Queryable()
                 .LeftJoin<OrderVisit>((it, o) => it.VisitId == o.Id)
-                .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartDate && o.VisitTime <= EndDate && o.VisitState == EVisitState.Visited)
+                .Where((it, o) => it.VisitTarget == EVisitTarget.Seat && o.VisitTime >= StartTime && o.VisitTime <= EndTime && o.VisitState == EVisitState.Visited)
                 .Select((it, o) => new Satisfaction
                 {
                     Dissatisfied = SqlFunc.AggregateSum(SqlFunc.IIF(it.SeatEvaluate == ESeatEvaluate.NoSatisfied, 1, 0)),
@@ -1309,7 +1312,7 @@ namespace Hotline.Api.Controllers.Bi
             //市直部门
             var listOrgStatisticsCityAll = await _orderRepository.Queryable()
               .LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
-              .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
+              .Where((it, o) => (o.OrgType == EOrgType.City || o.OrgType == EOrgType.Province) && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
              .GroupBy((it, o) => new
              {
                  it.OrgLevelOneCode,
@@ -1330,7 +1333,7 @@ namespace Hotline.Api.Controllers.Bi
             //区县部门
             var listOrgStatisticsAreaAll = await _orderRepository.Queryable()
              .LeftJoin<SystemOrganize>((it, o) => it.OrgLevelOneCode == o.Id)
-             .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartDate && it.CreationTime <= EndDate)
+             .Where((it, o) => o.OrgType == EOrgType.County && it.CreationTime >= StartTime && it.CreationTime <= EndTime)
             .GroupBy((it, o) => new
             {
                 it.OrgLevelOneCode,
@@ -1354,30 +1357,33 @@ namespace Hotline.Api.Controllers.Bi
         /// <summary>
         /// 部门受理类型统计周期
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="TypeCode">0:全部,1:中心,2:部门</param>
         /// <returns></returns>
         [HttpGet("department_acceptance_type_statistics")]
-        public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartDate, DateTime EndDate, int TypeCode)
+        public async Task<List<DepartmentAcceptanceTypeStatisticsDto>> DepartmentAcceptanceTypeStatistics(DateTime StartTime, DateTime EndTime, int TypeCode)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var IsCenter = _sessionContext.OrgIsCenter;
 
             var orderData = await _orderRepository.Queryable()
-              .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)
+              .Where(it => it.CreationTime >= StartTime && it.CreationTime <= EndTime && it.Status >= EOrderStatus.Filed)
               .Select(it => new
               {
                   OrgCode = IsCenter == true ? it.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) : it.ActualHandleOrgCode.Substring(0, _sessionContext.RequiredOrgId.Length + 3),
-                  it.AcceptTypeCode,
-                  it.FileDurationWorkday,
-                  it.AllDuration
+                  AcceptTypeCode = it.AcceptTypeCode,
+                  ProcessType = it.ProcessType,
+                  AllTime = it.ProcessType == EProcessType.Zhiban ? it.CreationTimeHandleDurationWorkday : it.CenterToOrgHandleDurationWorkday
+
               })
               .MergeTable()
               .LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
-              .WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
-              .WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
+              //.WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
+              //.WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
+              .WhereIF(TypeCode == 1, (it, o) => it.ProcessType == EProcessType.Zhiban)
+              .WhereIF(TypeCode == 2, (it, o) => it.ProcessType == EProcessType.Jiaoban)
               .WhereIF(IsCenter == false, (it, o) => it.OrgCode.StartsWith(_sessionContext.RequiredOrgId))
                .GroupBy((it, o) => new
                {
@@ -1389,156 +1395,44 @@ namespace Hotline.Api.Controllers.Bi
                 {
                     OrgName = it.OrgCode == "001" ? "热线中心" : o.Name,
                     OrgCode = it.OrgCode,
-                    OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
+                    OrgType = o.OrgType == EOrgType.County ? "区县部门" : "市直部门",
                     ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
-                    ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
+                    ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllTime != null, it.AllTime, 0)),
                     ZxAcceptanceTypeCode = "10",
 
                     JyAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15", 1, 0)),
-                    JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.AllTime != null, it.AllTime, 0)),
                     JyAcceptanceTypeCode = "15",
 
                     QzAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20", 1, 0)),
-                    QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.AllTime != null, it.AllTime, 0)),
                     QzAcceptanceTypeCode = "20",
 
                     ByAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25", 1, 0)),
-                    ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.AllTime != null, it.AllTime, 0)),
                     ByAcceptanceTypeCode = "25",
 
                     JbAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30", 1, 0)),
-                    JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.AllTime != null, it.AllTime, 0)),
                     JbAcceptanceTypeCode = "30",
 
                     TsAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35", 1, 0)),
-                    TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.AllTime != null, it.AllTime, 0)),
                     TsAcceptanceTypeCode = "35",
 
                     QtAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40", 1, 0)),
-                    QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.AllTime != null, it.AllTime, 0)),
                     QtAcceptanceTypeCode = "40",
 
                     YjAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1", 1, 0)),
-                    YjAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
+                    YjAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "1" && it.AllTime != null, it.AllTime, 0)),
                     YjAcceptanceTypeCode = "1"
                 })
               .ToListAsync();
 
-
             return orderData;
         }
 
-        /// <summary>
-        /// 部门受理类型统计周期---子级
-        /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
-        /// <param name="TypeCode">0:全部,1:中心,2:部门</param>
-        /// <param name="OrgCode"></param>
-        /// <returns></returns>
-        [HttpGet("department_acceptance_type_child_statistics")]
-        public async Task<object> DepartmentAcceptanceTypeChildStatistics(DateTime StartDate, DateTime EndDate, int TypeCode, string OrgCode)
-        {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
-
-            // var IsCenter = _sessionContext.OrgIsCenter;
-
-            var orderData = await _orderRepository.Queryable()
-              .Where(it => it.CreationTime >= StartDate && it.CreationTime <= EndDate && it.Status > EOrderStatus.WaitForAccept)// && it.Status >= EOrderStatus.Filed
-              .WhereIF(OrgCode == "001", it => it.ActualHandleOrgCode == OrgCode)
-              .WhereIF(OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(OrgCode))
-
-              .Select(it => new
-              {
-                  // OrgCode = OrgCode == "001" ? OrgCode : it.ActualHandleOrgCode.Substring(0, OrgCode.Length + 3),
-                  OrgCode = it.ActualHandleOrgCode == "001" ? it.ActualHandleOrgCode : it.ActualHandleOrgCode.Substring(0, OrgCode.Length + 3),
-                  it.AcceptTypeCode,
-                  it.FileDurationWorkday,
-                  it.AllDuration
-              })
-              .MergeTable()
-              .LeftJoin<SystemOrganize>((it, o) => it.OrgCode == o.Id)
-
-              .WhereIF(TypeCode == 1, (it, o) => it.OrgCode == "001")
-              .WhereIF(TypeCode == 2, (it, o) => it.OrgCode != "001")
-               //.WhereIF(IsCenter == false, (it, o) => it.OrgCode.StartsWith(_sessionContext.RequiredOrgId))
-
-               .GroupBy((it, o) => new
-               {
-                   it.OrgCode,
-                   o.Name,
-                   o.OrgType
-               })
-                .Select((it, o) => new DepartmentAcceptanceTypeStatisticsDto
-                {
-                    OrgName = it.OrgCode == "001" ? "热线中心" : o.Name,
-                    OrgCode = it.OrgCode,
-                    OrgType = (int)o.OrgType == 2 ? "区县部门" : "市直部门",
-                    ZxAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10", 1, 0)),
-                    ZxAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "10" && it.AllDuration != null, it.AllDuration, 0)),
-                    ZxAcceptanceTypeCode = "10",
-
-                    JyAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15", 1, 0)),
-                    JyAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "15" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    JyAcceptanceTypeCode = "15",
-
-                    QzAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20", 1, 0)),
-                    QzAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "20" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    QzAcceptanceTypeCode = "20",
-
-                    ByAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25", 1, 0)),
-                    ByAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "25" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    ByAcceptanceTypeCode = "25",
-
-                    JbAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30", 1, 0)),
-                    JbAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "30" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    JbAcceptanceTypeCode = "30",
-
-                    TsAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35", 1, 0)),
-                    TsAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "35" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    TsAcceptanceTypeCode = "35",
-
-                    QtAllCount = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40", 1, 0)),
-                    QtAllTimes = SqlFunc.AggregateSum(SqlFunc.IIF(it.AcceptTypeCode == "40" && it.FileDurationWorkday != null, it.FileDurationWorkday, 0)),
-                    QtAcceptanceTypeCode = "40"
-                })
-              .ToListAsync();
-
-            var sumModel = new DepartmentAcceptanceTypeStatisticsDto
-            {
-                OrgName = "合计",
-                ZxAllCount = orderData.Sum(x => x.ZxAllCount),
-                ZxAllTimes = orderData.Sum(x => x.ZxAllTimes),
-                ZxAcceptanceTypeCode = "10",
-
-                JyAllCount = orderData.Sum(x => x.JyAllCount),
-                JyAllTimes = orderData.Sum(x => x.JyAllTimes),
-                JyAcceptanceTypeCode = "15",
-
-                QzAllCount = orderData.Sum(x => x.QzAllCount),
-                QzAllTimes = orderData.Sum(x => x.QzAllTimes),
-                QzAcceptanceTypeCode = "20",
-
-                ByAllCount = orderData.Sum(x => x.ByAllCount),
-                ByAllTimes = orderData.Sum(x => x.ByAllTimes),
-                ByAcceptanceTypeCode = "25",
-
-                JbAllCount = orderData.Sum(x => x.JbAllCount),
-                JbAllTimes = orderData.Sum(x => x.JbAllTimes),
-                JbAcceptanceTypeCode = "30",
-
-                TsAllCount = orderData.Sum(x => x.TsAllCount),
-                TsAllTimes = orderData.Sum(x => x.TsAllTimes),
-                TsAcceptanceTypeCode = "35",
-
-                QtAllCount = orderData.Sum(x => x.QtAllCount),
-                QtAllTimes = orderData.Sum(x => x.QtAllTimes),
-                QtAcceptanceTypeCode = "40"
-            };
-            return new { DataList = orderData, SumModel = sumModel };
-        }
-
-
         /// <summary>
         /// 部门受理类型统计周期--明细列表
         /// </summary>
@@ -1547,15 +1441,16 @@ namespace Hotline.Api.Controllers.Bi
         [HttpGet("department_acceptance_type_order_list")]
         public async Task<PagedDto<OrderDto>> DepartmentAcceptanceTypeOrderList([FromQuery] DepartmentKeyWordRequest dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
             var (total, items) = await _orderRepository.Queryable()
-                .Where(p => p.CreationTime >= dto.StartDate && p.CreationTime <= dto.EndDate && p.Status > EOrderStatus.WaitForAccept)//&& p.Status >= EOrderStatus.Filed
+                .Where(p => p.CreationTime >= dto.StartTime && p.CreationTime <= dto.EndTime && p.Status >= EOrderStatus.Filed)
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == "001", p => p.ActualHandleOrgCode == dto.OrgCode)
+
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId != dto.OrgCode, p => p.ActualHandleOrgCode.StartsWith(dto.OrgCode))
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001" && _sessionContext.RequiredOrgId == dto.OrgCode, p => p.ActualHandleOrgCode == dto.OrgCode)
                 .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), p => p.AcceptTypeCode == dto.AcceptTypeCode)
-                .WhereIF(dto.TypeCode == 1, p => p.ActualHandleOrgCode == "001")
-                .WhereIF(dto.TypeCode == 2, p => p.ActualHandleOrgCode != "001")
+                .WhereIF(dto.TypeCode == 1, p => p.ProcessType == EProcessType.Zhiban)
+                .WhereIF(dto.TypeCode == 2, p => p.ProcessType == EProcessType.Jiaoban)
                 .OrderByDescending(d => d.CreationTime)
                 .ToPagedListAsync(dto, HttpContext.RequestAborted);
 
@@ -1856,10 +1751,10 @@ namespace Hotline.Api.Controllers.Bi
         [HttpGet("high_frequency_call_statistics")]
         public async Task<PagedDto<HighFrequencyCallStatisticsDto>> HighFrequencyCallStatistics([FromQuery] HighFrequencyCallStatisticsRequest dto)
         {
-            if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
+            if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
                 throw UserFriendlyException.SameMessage("请选择时间!");
 
-            dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
             int CallCount = 2;
             var HighFrequencyCallStatistics = _systemSettingCacheManager.GetSetting(SettingConstants.HighFrequencyCallStatistics)?.SettingValue[0];
             if (HighFrequencyCallStatistics != null)
@@ -1867,7 +1762,7 @@ namespace Hotline.Api.Controllers.Bi
 
             var (total, items) = await _trCallRecordRepository.Queryable()
                      .LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
-                   .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
+                   .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
                    .Where((p, o) => p.CallOrderType == ECallOrderType.Order)
                    .Where((p, o) => p.ExternalId != null && o.Id != null)
                    .Where((p, o) => p.CallDirection == ECallDirection.In)
@@ -1900,15 +1795,15 @@ namespace Hotline.Api.Controllers.Bi
         [HttpGet("high_frequency_call_statistics_order_list")]
         public async Task<PagedDto<OrderDto>> HighFrequencyCallStatisticsOrderList([FromQuery] HighFrequencyCallStatisticsListRequest dto)
         {
-            if (!dto.StartDate.HasValue || !dto.EndDate.HasValue)
+            if (!dto.StartTime.HasValue || !dto.EndTime.HasValue)
                 throw UserFriendlyException.SameMessage("请选择时间!");
             if (string.IsNullOrEmpty(dto.FromPhone))
                 throw UserFriendlyException.SameMessage("号码不能为空!");
 
-            dto.EndDate = dto.EndDate.Value.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
             var data = await _trCallRecordRepository.Queryable()
                     .LeftJoin<Order>((p, o) => p.ExternalId == o.Id)
-                   .Where((p, o) => p.OverTime >= dto.StartDate && p.OverTime <= dto.EndDate)
+                   .Where((p, o) => p.OverTime >= dto.StartTime && p.OverTime <= dto.EndTime)
                    .Where((p, o) => p.CallOrderType == ECallOrderType.Order)
                    .Where((p, o) => p.ExternalId != null && o.Id != null)
                     .Where((p, o) => p.CPN == dto.FromPhone)
@@ -1970,7 +1865,7 @@ namespace Hotline.Api.Controllers.Bi
         public async Task<PagedDto<HighMatterWarningDto>> HighMatterWarning([FromQuery] HighMatterWarningRequest dto)
         {
 
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             List<string> filterTitle = new List<string>();
             filterTitle.Add("无声");
@@ -1979,7 +1874,7 @@ namespace Hotline.Api.Controllers.Bi
             filterTitle.Add("测试");
 
             var (total, items) = await _orderRepository.Queryable()
-                .Where(x => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where(x => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
                 .LeftJoin<SystemArea>((it, o) => it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
                 .WhereIF(dto.AreaCodes.Any(), (it, o) => dto.AreaCodes.Contains(it.AreaCode)) //区域
@@ -2034,7 +1929,7 @@ namespace Hotline.Api.Controllers.Bi
         [HttpGet("highmatter-warning-detail")]
         public async Task<PagedDto<OrderDto>> HighMatterWarningDetail([FromQuery] HighMatterWarningDetailRequest dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
             List<string> filterTitle = new List<string>();
             filterTitle.Add("无声");
             filterTitle.Add("骚扰");
@@ -2045,8 +1940,8 @@ namespace Hotline.Api.Controllers.Bi
             .Includes(x => x.OrderScreens)
             .Where(d => d.AcceptTypeCode == dto.AcceptTypeCode) //受理类型
             .Where(d => d.HotspotId == dto.HotspotId) //热点类型
-            .Where(d => d.CreationTime >= dto.StartDate) //受理时间开始
-            .Where(d => d.CreationTime <= dto.EndDate) //受理时间结束
+            .Where(d => d.CreationTime >= dto.StartTime) //受理时间开始
+            .Where(d => d.CreationTime <= dto.EndTime) //受理时间结束
             .Where(d => d.AreaCode == dto.AreaCode) //区域
             .Where(x => filterTitle.Any(s => x.Title.Contains(s)) == false)
             .OrderByDescending(d => d.CreationTime)

+ 44 - 48
src/Hotline.Api/Controllers/Bigscreen/DataScreenController.cs

@@ -44,14 +44,14 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-statistics")]
-        public async Task<OrderStatisticsDto> OrderStatistics(DateTime StartDate,DateTime EndDate)
+        public async Task<OrderStatisticsDto> OrderStatistics(DateTime StartTime,DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             var dto = new OrderStatisticsDto();
 
             #region 办结工单
-            dto.CompletionCount =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status>= EOrderStatus.Filed).CountAsync();
-            int CompletionSum = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status >= EOrderStatus.Handling).CountAsync();
+            dto.CompletionCount =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status>= EOrderStatus.Filed).CountAsync();
+            int CompletionSum = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status >= EOrderStatus.Handling).CountAsync();
             if (CompletionSum==0)
             {
                 dto.CompletionRate = 0;
@@ -63,8 +63,8 @@ namespace Hotline.Api.Controllers.Bigscreen
             #endregion
 
             #region 待受理工单
-            dto.HaveToAcceptCount =await _orderRepository.Queryable(false, false, false).Where(x => x.CreationTime > StartDate && x.CreationTime <= EndDate && x.Status == EOrderStatus.WaitForAccept).CountAsync();
-            int HaveToAcceptSum = await _orderRepository.Queryable(false, false, false).Where(x => x.CreationTime >= StartDate && x.CreationTime <= EndDate).CountAsync();
+            dto.HaveToAcceptCount =await _orderRepository.Queryable(false, false, false).Where(x => x.CreationTime > StartTime && x.CreationTime <= EndTime && x.Status == EOrderStatus.WaitForAccept).CountAsync();
+            int HaveToAcceptSum = await _orderRepository.Queryable(false, false, false).Where(x => x.CreationTime >= StartTime && x.CreationTime <= EndTime).CountAsync();
             if (HaveToAcceptSum == 0)
             {
                 dto.HaveToAcceptRate = 0;
@@ -76,7 +76,7 @@ namespace Hotline.Api.Controllers.Bigscreen
             #endregion
 
             #region 超期工单
-            dto.OverTimeCount = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.ExpiredStatus == EExpiredStatus.Expired).CountAsync();
+            dto.OverTimeCount = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.ExpiredStatus == EExpiredStatus.Expired).CountAsync();
             if (CompletionSum==0)
             {
                 dto.OverTimeRate = 0;
@@ -88,7 +88,7 @@ namespace Hotline.Api.Controllers.Bigscreen
             #endregion
 
             #region 延期工单
-            dto.DelayCount = await _orderDelayRepository.Queryable().Where(x => x.ApplyDelayTime >= StartDate && x.ApplyDelayTime <= EndDate && x.DelayState == EDelayState.Pass).CountAsync();
+            dto.DelayCount = await _orderDelayRepository.Queryable().Where(x => x.ApplyDelayTime >= StartTime && x.ApplyDelayTime <= EndTime && x.DelayState == EDelayState.Pass).CountAsync();
             if (CompletionSum==0)
             {
                 dto.DelayRate = 0;
@@ -101,8 +101,8 @@ namespace Hotline.Api.Controllers.Bigscreen
             #endregion
 
             #region 满意工单
-            dto.SatisfiedCount =await _orderVisitRepository.Queryable().Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited && SqlFunc.JsonField(x.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.NowEvaluate,"Key")!="2" ).CountAsync();
-            int SatisfiedSum = await _orderVisitRepository.Queryable().Where(x => x.VisitTime >= StartDate && x.VisitTime <= EndDate && x.VisitState == EVisitState.Visited).CountAsync();
+            dto.SatisfiedCount =await _orderVisitRepository.Queryable().Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited && SqlFunc.JsonField(x.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(x.NowEvaluate,"Key")!="2" ).CountAsync();
+            int SatisfiedSum = await _orderVisitRepository.Queryable().Where(x => x.VisitTime >= StartTime && x.VisitTime <= EndTime && x.VisitState == EVisitState.Visited).CountAsync();
             if (SatisfiedSum==0)
             {
                 dto.SatisfiedRate = 0;
@@ -115,8 +115,8 @@ namespace Hotline.Api.Controllers.Bigscreen
 
             #region 省工单量
 
-            dto.ProvinceOrderCount =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.IsProvince).CountAsync();
-            dto.ProvinceOrderCompletionCount = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.IsProvince && x.Status >= EOrderStatus.Filed).CountAsync();
+            dto.ProvinceOrderCount =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.IsProvince).CountAsync();
+            dto.ProvinceOrderCompletionCount = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.IsProvince && x.Status >= EOrderStatus.Filed).CountAsync();
             #endregion
 
             return dto;
@@ -147,10 +147,10 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("ordertype-statistics")]
-        public async Task<List<OrderTypeHandleStatisticsDto>> OrderTypeHandleStatistics(DateTime StartDate,DateTime EndDate)
+        public async Task<List<OrderTypeHandleStatisticsDto>> OrderTypeHandleStatistics(DateTime StartTime,DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
-            var list =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.Handling && !string.IsNullOrEmpty(x.AcceptType))
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
+            var list =await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.Handling && !string.IsNullOrEmpty(x.AcceptType))
                 .GroupBy(x=>x.AcceptType)
                 .Select(x => new OrderTypeHandleStatisticsDto
                 { 
@@ -191,16 +191,15 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("earlywarning-statistics")]
-        public async Task<List<EarlyWarningHotsPotsStatisticsDto>> EarlyWarningHotsPotsStatistics(DateTime StartDate, DateTime EndDate,string AreaCode)
+        public async Task<List<EarlyWarningHotsPotsStatisticsDto>> EarlyWarningHotsPotsStatistics(DateTime StartTime, DateTime EndTime,string AreaCode)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             if (AreaCode.Length==6 && AreaCode.IndexOf("00") == 4)
             {
                 AreaCode = AreaCode.Remove(4);
             }
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
              var list = await _orderRepository.Queryable(false, false, false)
-                .Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.AreaCode.StartsWith(AreaCode) && !x.HotspotId.StartsWith("18"))
+                .Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.AreaCode.StartsWith(AreaCode) && !x.HotspotId.StartsWith("18"))
                 .GroupBy(x => new { x.HotspotId, x.HotspotName,x.HotspotSpliceName })
                 .Select(x => new EarlyWarningHotsPotsStatisticsDto()
                 {
@@ -283,11 +282,11 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("orderarea-accept-statistics")]
-        public async Task<List<OrderAreaAcceptStatisticsDto>> OrderAreaAcceptStatistics(DateTime StartDate,DateTime EndDate)
+        public async Task<List<OrderAreaAcceptStatisticsDto>> OrderAreaAcceptStatistics(DateTime StartTime,DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
-            var list = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime>= StartDate && x.StartTime<= EndDate && x.Status > EOrderStatus.WaitForAccept)
+            var list = await _orderRepository.Queryable(false, false, false).Where(x => x.StartTime>= StartTime && x.StartTime<= EndTime && x.Status > EOrderStatus.WaitForAccept)
                 .LeftJoin<SystemArea>((it,o)=> it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
                 .GroupBy((it,o) => new {
                     AreaCode = it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
@@ -307,15 +306,15 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 区域明细数据
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="AreaCode"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("orderareaaccept-query")]
-        public async Task<List<OrderAreaAcceptQueryDto>> OrderAreaAcceptQuery(DateTime StartDate,DateTime EndDate)
+        public async Task<List<OrderAreaAcceptQueryDto>> OrderAreaAcceptQuery(DateTime StartTime,DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
 
             var areaList =await _systemAreaRepository.Queryable()
@@ -343,13 +342,13 @@ namespace Hotline.Api.Controllers.Bigscreen
                 var dto = new OrderAreaAcceptQueryDto();
                 dto.AreaCode = item.Id;
                 dto.AreaName = item.Name;
-                dto.HandlingCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.WaitForAccept && x.Status < EOrderStatus.Filed).CountAsync();
+                dto.HandlingCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.WaitForAccept && x.Status < EOrderStatus.Filed).CountAsync();
 
-                dto.FiledCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status >= EOrderStatus.Filed).CountAsync();
+                dto.FiledCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status >= EOrderStatus.Filed).CountAsync();
 
-                dto.OverTimeCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartDate && x.StartTime <= EndDate && x.ExpiredStatus == EExpiredStatus.Expired).CountAsync();
+                dto.OverTimeCount = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartTime && x.StartTime <= EndTime && x.ExpiredStatus == EExpiredStatus.Expired).CountAsync();
 
-                var hotsPot = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.WaitForAccept).GroupBy(x => new { x.HotspotId, x.HotspotName })
+                var hotsPot = await _orderRepository.Queryable(false, false, false).Where(x => x.AreaCode == item.Id && x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.WaitForAccept).GroupBy(x => new { x.HotspotId, x.HotspotName })
                     .Select(x => new
                     {
                         HotsPotName = x.HotspotName,
@@ -361,12 +360,12 @@ namespace Hotline.Api.Controllers.Bigscreen
                 #region 满意度
                 var SatisfiedCount = await _orderRepository.Queryable(false, false, false)
                     .LeftJoin<OrderVisit>((it, o) => it.Id == o.OrderId && o.VisitState == EVisitState.Visited)
-                    .Where((it, o) => it.AreaCode == item.Id && o.VisitTime >= StartDate && o.VisitTime <= EndDate 
+                    .Where((it, o) => it.AreaCode == item.Id && o.VisitTime >= StartTime && o.VisitTime <= EndTime
                     && SqlFunc.JsonField(o.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(o.NowEvaluate, "Key") != "2")
                     .CountAsync();
                 var VisitCount = await _orderRepository.Queryable(false, false, false)
                     .LeftJoin<OrderVisit>((it, o) => it.Id == o.OrderId && o.VisitState == EVisitState.Visited)
-                    .Where((it, o) => it.AreaCode == item.Id && o.VisitTime >= StartDate && o.VisitTime <= EndDate)
+                    .Where((it, o) => it.AreaCode == item.Id && o.VisitTime >= StartTime && o.VisitTime <= EndTime)
                     .CountAsync();
 
                 if (SatisfiedCount!=0 && VisitCount!=0)
@@ -407,7 +406,7 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("highmatter-warning")]
-        public async Task<List<HighMatterWarningDto>> HighMatterWarning(DateTime StartDate,DateTime EndDate)
+        public async Task<List<HighMatterWarningDto>> HighMatterWarning(DateTime StartTime,DateTime EndTime)
         {
             //var endDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
             //var startDate = endDate.AddDays(-30).Date;
@@ -421,7 +420,7 @@ namespace Hotline.Api.Controllers.Bigscreen
 
 
             var list = await _orderRepository.Queryable(false, false, false)
-                .Where(x => x.CreationTime >= StartDate && x.CreationTime <= EndDate)
+                .Where(x => x.CreationTime >= StartTime && x.CreationTime <= EndTime)
                 .Where(x=> filterTitle.Any(s=> x.Title.Contains(s)) == false)
                 .LeftJoin<SystemArea>((it, o) => it.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
                 .GroupBy((it, o) => new
@@ -458,16 +457,16 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 部门满意度排行榜
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("ordervisit-orgsatisfaction-rank")]
-        public async Task<List<OrderVisitOrgSatisfactionRankDto>> OrderVisitOrgSatisfactionRank(DateTime StartDate,DateTime EndDate)
+        public async Task<List<OrderVisitOrgSatisfactionRankDto>> OrderVisitOrgSatisfactionRank(DateTime StartTime,DateTime EndTime)
         {
            var list = await _orderVisitDetailRepository.Queryable()
                 .Includes(x => x.OrderVisit)
-                .Where(x => x.OrderVisit.VisitTime >= StartDate && x.OrderVisit.VisitTime <= EndDate && x.VisitTarget == EVisitTarget.Org && x.VisitOrgCode.Length >= 6 && x.OrderVisit.VisitState == EVisitState.Visited)
+                .Where(x => x.OrderVisit.VisitTime >= StartTime && x.OrderVisit.VisitTime <= EndTime && x.VisitTarget == EVisitTarget.Org && x.VisitOrgCode.Length >= 6 && x.OrderVisit.VisitState == EVisitState.Visited)
                 .GroupBy(x => new
                 {
                     VisitOrgCode = x.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")),
@@ -486,25 +485,22 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 占比分析
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="IsSource"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-source-accepttype-statistics")]
-        public async Task<List<OrderSourceAndAcceptTtoeStatisticsDto>> OrderSourceAndAcceptTtoeStatistics(DateTime StartDate,DateTime EndDate,bool IsSource)
+        public async Task<List<OrderSourceAndAcceptTtoeStatisticsDto>> OrderSourceAndAcceptTtoeStatistics(DateTime StartTime, DateTime EndTime, bool IsSource)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
-
-
-
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             int SumCount = await _orderRepository.Queryable(false, false, false)
-               .Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.WaitForAccept).CountAsync();
+               .Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.WaitForAccept).CountAsync();
             if (IsSource)
             {
                 var list = await _orderRepository.Queryable(false, false, false)
-                .Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.WaitForAccept)
+                .Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.WaitForAccept)
                 .GroupBy(x => new { x.SourceChannelCode, x.SourceChannel })
                 .Select(x => new OrderSourceAndAcceptTtoeStatisticsDto()
                 {
@@ -517,7 +513,7 @@ namespace Hotline.Api.Controllers.Bigscreen
             else
             {
                 var list = await _orderRepository.Queryable(false, false, false)
-                .Where(x => x.StartTime >= StartDate && x.StartTime <= EndDate && x.Status > EOrderStatus.WaitForAccept)
+                .Where(x => x.StartTime >= StartTime && x.StartTime <= EndTime && x.Status > EOrderStatus.WaitForAccept)
                 .GroupBy( x => new { x.AcceptTypeCode, x.AcceptType })
                 .Select(x => new OrderSourceAndAcceptTtoeStatisticsDto()
                 {

+ 31 - 31
src/Hotline.Api/Controllers/Bigscreen/EnforcementScreenController.cs

@@ -41,15 +41,15 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-module-statistics")]
-        public async Task<OrderModuleDto> GetOrderModuleStatisticsAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<OrderModuleDto> GetOrderModuleStatisticsAsync(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             var dto = new OrderModuleDto();
 
             var data = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null)
-                .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate)
+                .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime)
                 .Select((x, o) => new
                 {
                     x.Id,
@@ -79,7 +79,7 @@ namespace Hotline.Api.Controllers.Bigscreen
             dto.SatisfiedCount = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<OrderVisit>((x, o) => x.Id == o.OrderId)
                 .LeftJoin<OrderVisitDetail>((x, o, p) => o.Id == p.VisitId)
-               .Where((x, o, p) => o.VisitTime >= StartDate && o.VisitTime <= EndDate && p.VisitTarget == EVisitTarget.Org)
+               .Where((x, o, p) => o.VisitTime >= StartTime && o.VisitTime <= EndTime && p.VisitTarget == EVisitTarget.Org)
                .Where((x, o, p) => o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode))
                .Where((x, o, p) => SqlFunc.JsonField(o.NowEvaluate, "Key") != "1" && SqlFunc.JsonField(o.NowEvaluate, "Key") != "2")
                .CountAsync();
@@ -90,19 +90,19 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 左中受理类型
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-accept-type-statistics")]
-        public async Task<List<OrderAcceptTypeStatisticsDto>> GetOrderAcceptTypeStatisticsAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<List<OrderAcceptTypeStatisticsDto>> GetOrderAcceptTypeStatisticsAsync(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var list = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null && o.Status > EOrderStatus.Handling && !string.IsNullOrEmpty(o.AcceptType))
-                .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate)
+                .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime)
                 .Select((x, o) => new
                 {
                     x.Id,
@@ -127,15 +127,15 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 左下高频事项统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="AreaCode"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-event-type-statistics")]
-        public async Task<List<OrderEventTypeStatisticsDto>> GetOrderEventTypeStatisticsAsync(DateTime StartDate, DateTime EndDate, string AreaCode)
+        public async Task<List<OrderEventTypeStatisticsDto>> GetOrderEventTypeStatisticsAsync(DateTime StartTime, DateTime EndTime, string AreaCode)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             if (AreaCode.Length == 6 && AreaCode.IndexOf("00") == 4)
                 AreaCode = AreaCode.Remove(4);
 
@@ -143,7 +143,7 @@ namespace Hotline.Api.Controllers.Bigscreen
                .LeftJoin<Order>((x, o) => x.Id == o.Id)
                .LeftJoin<JudicialComplaintsEventType>((x, o, j) => x.EventTypeOneLevelId == j.Id)
                .Where((x, o, j) => o.Id != null && x.EventTypeOneLevelId != null && j.Id != null)
-               .Where((x, o, j) => o.StartTime >= StartDate && o.StartTime <= EndDate && o.AreaCode.StartsWith(AreaCode))
+               .Where((x, o, j) => o.StartTime >= StartTime && o.StartTime <= EndTime && o.AreaCode.StartsWith(AreaCode))
                .Select((x, o, j) => new
                {
                    x.Id,
@@ -168,14 +168,14 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 中上区域地图数据
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-area-query")]
-        public async Task<List<OrderAreaQueryDto>> GetOrderAreaQueryAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<List<OrderAreaQueryDto>> GetOrderAreaQueryAsync(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var areaList = await _systemAreaRepository.Queryable()
                 .Where(x => !x.Id.EndsWith("00"))
@@ -211,7 +211,7 @@ namespace Hotline.Api.Controllers.Bigscreen
                 var data = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null)
-                .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate && o.AreaCode.StartsWith(item.Id))
+                .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime && o.AreaCode.StartsWith(item.Id))
                 .Select((x, o) => new
                 {
                     x.Id,
@@ -289,19 +289,19 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 右上部门满意度排行榜
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-visitorg-statistics")]
-        public async Task<List<OrderVisitOrgStatisticsDto>> GetOrderVisitOrgStatisticsAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<List<OrderVisitOrgStatisticsDto>> GetOrderVisitOrgStatisticsAsync(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var list = await _enforcementOrdersRepository.Queryable()
                  .LeftJoin<OrderVisit>((x, o) => x.Id == o.OrderId)
                  .LeftJoin<OrderVisitDetail>((x, o, p) => o.Id == p.VisitId)
-                .Where((x, o, p) => o.VisitTime >= StartDate && o.VisitTime <= EndDate && p.VisitTarget == EVisitTarget.Org &&
+                .Where((x, o, p) => o.VisitTime >= StartTime && o.VisitTime <= EndTime && p.VisitTarget == EVisitTarget.Org &&
                 o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode) && p.VisitOrgCode.Length >= 6)
                 .Select((x, o, p) => new
                 {
@@ -380,20 +380,20 @@ namespace Hotline.Api.Controllers.Bigscreen
         /// <summary>
         /// 右下占比分析
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="IsSource"></param>
         /// <returns></returns>
         [AllowAnonymous]
         [HttpGet("order-proportion-statistics")]
-        public async Task<List<OrderProportionStatisticsDto>> GetOrderProportionStatisticsAsync(DateTime StartDate, DateTime EndDate, bool IsSource)
+        public async Task<List<OrderProportionStatisticsDto>> GetOrderProportionStatisticsAsync(DateTime StartTime, DateTime EndTime, bool IsSource)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var SumCount = await _enforcementOrdersRepository.Queryable()
                .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null)
-               .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate && o.Status > EOrderStatus.WaitForAccept)
+               .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime && o.Status > EOrderStatus.WaitForAccept)
                .CountAsync();
 
             if (IsSource)
@@ -401,7 +401,7 @@ namespace Hotline.Api.Controllers.Bigscreen
                 var list = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null)
-                .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate && o.Status > EOrderStatus.WaitForAccept)
+                .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime && o.Status > EOrderStatus.WaitForAccept)
                 .GroupBy((x, o) => new { o.SourceChannelCode, o.SourceChannel })
                 .Select((x, o) => new OrderProportionStatisticsDto()
                 {
@@ -417,7 +417,7 @@ namespace Hotline.Api.Controllers.Bigscreen
                 var list = await _enforcementOrdersRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.Id == o.Id)
                 .Where((x, o) => o.Id != null)
-                .Where((x, o) => o.StartTime >= StartDate && o.StartTime <= EndDate && o.Status > EOrderStatus.WaitForAccept)
+                .Where((x, o) => o.StartTime >= StartTime && o.StartTime <= EndTime && o.Status > EOrderStatus.WaitForAccept)
                 .GroupBy((x, o) => new { o.AcceptTypeCode, o.AcceptType })
                 .Select((x, o) => new OrderProportionStatisticsDto()
                 {

+ 37 - 37
src/Hotline.Api/Controllers/EnforcementOrderController.cs

@@ -263,21 +263,21 @@ namespace Hotline.Api.Controllers
         /// <summary>
         /// 事项分类统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="Id"></param>
         /// <param name="AreaCode"></param>
         /// <returns></returns>
         [HttpGet("event_classification_statistics")]
-        public async Task<object> GetEventClassificationStatisticsAsync(DateTime StartDate, DateTime EndDate, string Id, string AreaCode)
+        public async Task<object> GetEventClassificationStatisticsAsync(DateTime StartTime, DateTime EndTime, string Id, string AreaCode)
         {
 
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var items = await _judicialComplaintsEventTypeRepository.Queryable()
              .LeftJoin<EnforcementOrders>((x, o) => o.EventTypeSpliceName != null && (x.EventTypeName == o.EventTypeSpliceName || o.EventTypeSpliceName.Contains(x.EventTypeName)))
             .LeftJoin<Order>((x, o, p) => p.Id == o.Id)
-            .Where((x, o, p) => p.StartTime >= StartDate && p.StartTime <= EndDate)
+            .Where((x, o, p) => p.StartTime >= StartTime && p.StartTime <= EndTime)
             .WhereIF(!string.IsNullOrEmpty(AreaCode), (x, o, p) => p.AreaCode.StartsWith(AreaCode))
              .Where((x, o, p) => x.ParentId == Id)
              .GroupBy((x, o, p) => new { x.Id, x.EventTypeName })
@@ -294,7 +294,7 @@ namespace Hotline.Api.Controllers
             var data = await _enforcementOrdersRepository.Queryable()
                 .Includes(x => x.Order)
                 .Where(d => d.Order.Id != null)
-                .Where(d => d.Order.StartTime >= StartDate && d.Order.StartTime <= EndDate)
+                .Where(d => d.Order.StartTime >= StartTime && d.Order.StartTime <= EndTime)
                 .GroupBy(d => d.Id)
                  .Select(d => new EventClassificationOrderCountDto
                  {
@@ -324,12 +324,12 @@ namespace Hotline.Api.Controllers
         [HttpGet("event_classification_statistics_order_list")]
         public async Task<PagedDto<EnforcementOrderListDto>> GetEventClassificationStatisticsOrderListAsync([FromQuery] QueryEventClassificationStatisticsDto dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             var (total, items) = await _enforcementOrdersRepository.Queryable()
             .Includes(x => x.Order)
             .Where(d => d.Order.Id != null)
-            .Where(d => d.Order.StartTime >= dto.StartDate && d.Order.StartTime <= dto.EndDate && d.EventTypeId != null)
+            .Where(d => d.Order.StartTime >= dto.StartTime && d.Order.StartTime <= dto.EndTime && d.EventTypeId != null)
             .WhereIF(!string.IsNullOrEmpty(dto.EventTypeId), d => d.EventTypeId.StartsWith(dto.EventTypeId))
             .WhereIF(!string.IsNullOrEmpty(dto.AreaCode), d => d.Order.AreaCode.StartsWith(dto.AreaCode))
               .OrderByDescending(d => d.CreationTime)
@@ -341,18 +341,18 @@ namespace Hotline.Api.Controllers
         /// <summary>
         /// 执法部门办件统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <returns></returns>
         [HttpGet("enforcement_departmental_processing_statistics")]
-        public async Task<object> GetDepartmentalProcessingStatisticsAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<object> GetDepartmentalProcessingStatisticsAsync(DateTime StartTime, DateTime EndTime)
         {
 
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             var data = await _enforcementOrdersRepository.Queryable()
                    .Includes(x => x.Order)
                    .Where(d => d.Order.Id != null)
-                   .Where(d => d.Order.StartTime >= StartDate && d.Order.StartTime <= EndDate)
+                   .Where(d => d.Order.StartTime >= StartTime && d.Order.StartTime <= EndTime)
                     .GroupBy(d => new
                     {
                         OrgCode = d.Order.OrgLevelOneCode,
@@ -375,22 +375,22 @@ namespace Hotline.Api.Controllers
         /// <summary>
         /// 执法部门办件统计---子级
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="OrgCode"></param>
         /// <returns></returns>
         [HttpGet("enforcement_departmental_processing_statistics_child")]
-        public async Task<object> GetDepartmentalProcessingStatisticsChildAsync(DateTime StartDate, DateTime EndDate, string OrgCode)
+        public async Task<object> GetDepartmentalProcessingStatisticsChildAsync(DateTime StartTime, DateTime EndTime, string OrgCode)
         {
 
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             if (string.IsNullOrEmpty(OrgCode))
                 throw UserFriendlyException.SameMessage("部门code不能为空!");
 
             var data = await _enforcementOrdersRepository.Queryable()
                    .Includes(x => x.Order)
                    .Where(d => d.Order.Id != null)
-                   .Where(d => d.Order.StartTime >= StartDate && d.Order.StartTime <= EndDate)
+                   .Where(d => d.Order.StartTime >= StartTime && d.Order.StartTime <= EndTime)
                    .WhereIF(OrgCode == "001", d => d.Order.ActualHandleOrgCode == OrgCode)
                    .WhereIF(OrgCode != "001", d => d.Order.ActualHandleOrgCode.StartsWith(OrgCode))
                     .GroupBy(d => new
@@ -421,12 +421,12 @@ namespace Hotline.Api.Controllers
         [HttpGet("enforcement_departmental_processing_statistics_order_list")]
         public async Task<PagedDto<EnforcementOrderListDto>> GetDepartmentalProcessingStatisticsOrderListAsync([FromQuery] QueryDepartmentalProcessingStatisticsDto dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             var (total, items) = await _enforcementOrdersRepository.Queryable()
             .Includes(x => x.Order)
             .Where(d => d.Order.Id != null)
-            .Where(d => d.Order.StartTime >= dto.StartDate && d.Order.StartTime <= dto.EndDate)
+            .Where(d => d.Order.StartTime >= dto.StartTime && d.Order.StartTime <= dto.EndTime)
             .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == "001", d => d.Order.ActualHandleOrgCode == dto.OrgCode)
             .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001", d => d.Order.ActualHandleOrgCode.StartsWith(dto.OrgCode))
             .WhereIF(dto.TheClueIsTrue == true, d => d.IsTheClueTrue == true)
@@ -443,14 +443,14 @@ namespace Hotline.Api.Controllers
         /// </summary>
         /// <returns></returns>
         [HttpGet("regional_classification_statistics")]
-        public async Task<object> GetRegionalClassificationStatisticsAsync(DateTime StartDate, DateTime EndDate)
+        public async Task<object> GetRegionalClassificationStatisticsAsync(DateTime StartTime, DateTime EndTime)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
             var areaCode = _sessionContext.OrgAreaCode ?? "511500";
             var list = await _enforcementOrdersRepository.Queryable()
                .Includes(x => x.Order)
                .Where(x => x.Order.Id != null)
-               .Where(x => x.Order.StartTime >= StartDate && x.Order.StartTime <= EndDate)
+               .Where(x => x.Order.StartTime >= StartTime && x.Order.StartTime <= EndTime)
                .LeftJoin<SystemArea>((x, o) => x.Order.AreaCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == o.Id)
                .Where((x, o) => x.Order.Status >= EOrderStatus.Filed)
                .WhereIF(areaCode != "511500", (x, o) => x.Order.AreaCode.StartsWith(areaCode))
@@ -482,12 +482,12 @@ namespace Hotline.Api.Controllers
         [HttpGet("regional_classification_statistics_order_list")]
         public async Task<PagedDto<EnforcementOrderListDto>> GetRegionalClassificationStatisticsOrderListAsync([FromQuery] QueryRegionalClassificationStatisticsDto dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             var (total, items) = await _enforcementOrdersRepository.Queryable()
             .Includes(x => x.Order)
             .Where(d => d.Order.Id != null)
-            .Where(d => d.Order.StartTime >= dto.StartDate && d.Order.StartTime <= dto.EndDate)
+            .Where(d => d.Order.StartTime >= dto.StartTime && d.Order.StartTime <= dto.EndTime)
             .WhereIF(!string.IsNullOrEmpty(dto.AreaCode), d => d.Order.AreaCode.StartsWith(dto.AreaCode))
             .WhereIF(dto.TheClueIsTrue == true, d => d.IsTheClueTrue == true)
             .WhereIF(dto.TheClueIsNotTrue == true, d => d.IsTheClueTrue == false)
@@ -501,19 +501,19 @@ namespace Hotline.Api.Controllers
         /// <summary>
         /// 部门满意度统计
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="TypeId">1:办件结果 2:办件态度</param>
         /// <returns></returns>
         [HttpGet("enforcement_visit_org_satisfaction_statistics")]
-        public async Task<object> GetVisitAndOrgSatisfactionStatisticsAsync(DateTime StartDate, DateTime EndDate, int TypeId)
+        public async Task<object> GetVisitAndOrgSatisfactionStatisticsAsync(DateTime StartTime, DateTime EndTime, int TypeId)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var list = await _enforcementOrdersRepository.Queryable()
                  .LeftJoin<OrderVisit>((x, o) => x.Id == o.OrderId)
                  .LeftJoin<OrderVisitDetail>((x, o, p) => o.Id == p.VisitId)
-                .Where((x, o, p) => o.VisitTime >= StartDate && o.VisitTime <= EndDate && p.VisitTarget == EVisitTarget.Org && o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode))
+                .Where((x, o, p) => o.VisitTime >= StartTime && o.VisitTime <= EndTime && p.VisitTarget == EVisitTarget.Org && o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode))
                 .GroupBy((x, o, p) => new
                 {
                     VisitOrgCode = p.VisitOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6"))
@@ -569,20 +569,20 @@ namespace Hotline.Api.Controllers
         /// <summary>
         /// 部门满意度统计----子级
         /// </summary>
-        /// <param name="StartDate"></param>
-        /// <param name="EndDate"></param>
+        /// <param name="StartTime"></param>
+        /// <param name="EndTime"></param>
         /// <param name="TypeId">1:办件结果 2:办件态度</param>
         /// <param name="OrgCode"></param>
         /// <returns></returns>
         [HttpGet("enforcement_visit_org_satisfaction_statistics_child")]
-        public async Task<object> GetVisitAndOrgSatisfactionStatisticsChildAsync(DateTime StartDate, DateTime EndDate, int TypeId, string OrgCode)
+        public async Task<object> GetVisitAndOrgSatisfactionStatisticsChildAsync(DateTime StartTime, DateTime EndTime, int TypeId, string OrgCode)
         {
-            EndDate = EndDate.AddDays(1).AddSeconds(-1);
+            EndTime = EndTime.AddDays(1).AddSeconds(-1);
 
             var list = await _enforcementOrdersRepository.Queryable()
                  .LeftJoin<OrderVisit>((x, o) => x.Id == o.OrderId)
                  .LeftJoin<OrderVisitDetail>((x, o, p) => o.Id == p.VisitId)
-                 .Where((x, o, p) => o.VisitTime >= StartDate && o.VisitTime <= EndDate && p.VisitTarget == EVisitTarget.Org)
+                 .Where((x, o, p) => o.VisitTime >= StartTime && o.VisitTime <= EndTime && p.VisitTarget == EVisitTarget.Org)
                  .Where((x, o, p) => o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode))
                  .WhereIF(!string.IsNullOrEmpty(OrgCode) && OrgCode == "001", (x, o, p) => p.VisitOrgCode == OrgCode)
                  .WhereIF(!string.IsNullOrEmpty(OrgCode) && OrgCode != "001", (x, o, p) => p.VisitOrgCode.StartsWith(OrgCode))
@@ -646,14 +646,14 @@ namespace Hotline.Api.Controllers
         [HttpGet("enforcement_visit_org_satisfaction_statistics_order_list")]
         public async Task<PagedDto<EnforcementOrgSatisfactionOrderListDto>> GetVisitAndOrgSatisfactionStatisticsOrderListAsync([FromQuery] QueryOrgSatisfactionStatisticsDto dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             var (total, items) = await _enforcementOrdersRepository.Queryable()
                 .Includes(x => x.Order)
                 .Where(x => x.Order.Id != null)
                 .LeftJoin<OrderVisit>((x, o) => x.Id == o.OrderId)
                 .LeftJoin<OrderVisitDetail>((x, o, p) => o.Id == p.VisitId)
-                .Where((x, o, p) => o.VisitTime >= dto.StartDate && o.VisitTime <= dto.EndDate && p.VisitTarget == EVisitTarget.Org)
+                .Where((x, o, p) => o.VisitTime >= dto.StartTime && o.VisitTime <= dto.EndTime && p.VisitTarget == EVisitTarget.Org)
                 .Where((x, o, p) => o.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(p.VisitOrgCode))
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode == "001", (x, o, p) => p.VisitOrgCode == dto.OrgCode)
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgCode) && dto.OrgCode != "001", (x, o, p) => p.VisitOrgCode.StartsWith(dto.OrgCode))

+ 98 - 94
src/Hotline.Api/Controllers/OrderController.cs

@@ -487,10 +487,11 @@ public class OrderController : BaseController
             ActualOpinion = order.ActualOpinion,
             NetizenEvaluateType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.NetizenEvaluateType).Select(x => new Kv { Key = x.DicDataValue, Value = x.DicDataName }).ToList()
         };
-        var (idName, idNames) =
-            await _workflowDomainService.GetUnvisitOrgsAsync(order.WorkflowId, HttpContext.RequestAborted);
+        var (idName, idNames) = await _workflowDomainService.GetHandleOrgsAsync(order.WorkflowId, HttpContext.RequestAborted);
         res.ActualHandleOrgName = idName;
-        res.idNames = idNames.ToList();
+        res.idNames = order.CounterSignType == null
+            ? null
+            : idNames.Where(d => d.Key != idName.Key).ToList();
         return res;
     }
 
@@ -1349,7 +1350,7 @@ public class OrderController : BaseController
             startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderDelay;
             startDto.Opinion = model.DelayReason;
             startDto.Title = "申请延期流程";
-			string workFlowId = await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, model.Id,
+            string workFlowId = await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, model.Id,
                     cancellationToken: HttpContext.RequestAborted);
             //model.WorkflowId = workFlowId;
             //await _orderDelayRepository.UpdateAsync(model, HttpContext.RequestAborted);
@@ -1580,7 +1581,7 @@ public class OrderController : BaseController
             .Includes(x => x.OrderVisit)
             .Includes(x => x.OrderVisit, y => y.Order)
             .Includes(x => x.OrderVisit, y => y.Employee)
-            .LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.Status <  EScreenStatus.End && s.IsDeleted == false)
+            .LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.Status < EScreenStatus.End && s.IsDeleted == false)
             .Where((x, s) => s.Id == null)
             .WhereIF(dto.IsHomePage.HasValue && dto.IsHomePage == true, x => x.OrderVisit.VisitTime < dto.CreationTimeEnd && x.OrderVisit.VisitTime > dto.CreationTimeStart)
             .WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order!.No!.Contains(dto.No!))
@@ -1719,8 +1720,8 @@ public class OrderController : BaseController
             startDto.DefinitionModuleCode = WorkflowModuleConsts.OrderScreen;
             startDto.Opinion = dto.Data.Content;
             startDto.Title = "申请甄别流程";
-		   workflowId = await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, model.Id,
-                    cancellationToken: HttpContext.RequestAborted);
+            workflowId = await _workflowApplication.StartWorkflowAsync(startDto, _sessionContext, model.Id,
+                     cancellationToken: HttpContext.RequestAborted);
             //var screen = await _orderScreenRepository.GetAsync(model.Id, HttpContext.RequestAborted);
             //if (screen != null)
             //{
@@ -2423,18 +2424,19 @@ public class OrderController : BaseController
                 _sessionContext.RequiredOrgId, _sessionContext.OrgName,
                 _sessionContext.OrgAreaCode, _sessionContext.OrgAreaName));
         }
-		var setting = _systemSettingCacheManager.GetSetting(SettingConstants.SeatsMonitor);
-		var settingStr = setting?.SettingValue;
-		var roles = _sessionContext.Roles;
-		foreach (var item in settingStr)
-		{
-			if (roles != null && roles.Contains(item)) dto.CanHandle = true;
-		}
+        //班长代办
+        //var setting = _systemSettingCacheManager.GetSetting(SettingConstants.SeatsMonitor);
+        //var settingStr = setting?.SettingValue;
+        //var roles = _sessionContext.Roles;
+        //foreach (var item in settingStr)
+        //{
+        //	if (roles != null && roles.Contains(item)) dto.CanHandle = true;
+        //}
 
-		//var dto = _mapper.Map<OrderDto>(order!);
-		//dto.CountersignId = countersignId;
-		//dto.CanHandle = order.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
-		dto.IsCanDelay = !order.OrderDelays.Any(x => x.DelayState == EDelayState.Examining);
+        //var dto = _mapper.Map<OrderDto>(order!);
+        //dto.CountersignId = countersignId;
+        //dto.CanHandle = order.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
+        dto.IsCanDelay = !order.OrderDelays.Any(x => x.DelayState == EDelayState.Examining);
         if (order.OrderDelays.Any(x => x.DelayState == EDelayState.Examining && x.ApplyOrgCode == _sessionContext.RequiredOrgId))
         {
             dto.CanHandle = false;
@@ -3116,16 +3118,16 @@ public class OrderController : BaseController
                 .Where(d => d.OrderSpecials.Any() == false || d.OrderSpecials.Any(s => s.State > 0))
                 .WhereIF(dto.StartTime.HasValue, d => d.StartTime >= dto.StartTime)
                 .WhereIF(dto.EndTime.HasValue, d => d.StartTime <= dto.EndTime)
-				.WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
-				.OrderByDescending(d => d.StartTime)
+                .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
+                .OrderByDescending(d => d.StartTime)
                 .ToPagedListAsync(dto, HttpContext.RequestAborted);
             return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
         }
         else
         {
             var (total, items) = await _orderRepository.Queryable()
-                .Where(d => SqlFunc.Subqueryable<WorkflowStep>()
-                    .Where(step => step.ExternalId == d.Id &&
+                .Where(d => SqlFunc.Subqueryable<WorkflowTrace>()
+                    .Where(step => step.ExternalId == d.Id && step.TraceState != EWorkflowTraceState.StepRemoveByPrevious &&
                                                                  ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
                                                                   (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
                                                                   (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId))) &&
@@ -3145,7 +3147,7 @@ public class OrderController : BaseController
                 .WhereIF(dto.StartTime.HasValue, d => d.StartTime >= dto.StartTime)
                 .WhereIF(dto.EndTime.HasValue, d => d.StartTime <= dto.EndTime)
                 .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
-				.OrderByDescending(d => d.StartTime)
+                .OrderByDescending(d => d.StartTime)
 
                 .ToPagedListAsync(dto, HttpContext.RequestAborted);
             return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
@@ -3153,6 +3155,7 @@ public class OrderController : BaseController
 
     }
 
+
     /// <summary>
     /// 查询坐席待办
     /// </summary>
@@ -3195,7 +3198,7 @@ public class OrderController : BaseController
                 ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
                  (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
                  (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId))) &&
-                 (((dto.IsHandled.HasValue && dto.IsHandled == false) && step.Status != EWorkflowStepStatus.Handled)||
+                 (((dto.IsHandled.HasValue && dto.IsHandled == false) && step.Status != EWorkflowStepStatus.Handled) ||
                 ((dto.IsHandled.HasValue && dto.IsHandled == true) && step.Status == EWorkflowStepStatus.Handled)))))
             .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
             .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
@@ -3208,7 +3211,7 @@ public class OrderController : BaseController
             .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
             .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
             .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
-			.Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
+            .Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
             .Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
             .OrderBy(d => d.Status)
             .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
@@ -3243,7 +3246,7 @@ public class OrderController : BaseController
             //  )))
             //.Where(d => d.Workflow.Steps.Any(s => s.Status < EWorkflowStepStatus.Handled && s.HandlerOrgId == OrgSeedData.CenterId))
             .LeftJoin<WorkflowStep>((d, step) => d.Id == step.ExternalId)
-            .Where((d, step) => (step.Id == null || (step.HandlerOrgId == OrgSeedData.CenterId && step.Status < EWorkflowStepStatus.Handled )))
+            .Where((d, step) => (step.Id == null || (step.HandlerOrgId == OrgSeedData.CenterId && step.Status < EWorkflowStepStatus.Handled)))
             .Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
             .Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
             .WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No!.Contains(dto.No!))
@@ -3257,8 +3260,8 @@ public class OrderController : BaseController
             .WhereIF(dto.ExpiredStatus is EExpiredStatus.Normal, d => DateTime.Now < d.NearlyExpiredTime)
             .WhereIF(dto.ExpiredStatus is EExpiredStatus.GoingToExpired, d => DateTime.Now > d.NearlyExpiredTime && DateTime.Now < d.ExpiredTime)
             .WhereIF(dto.ExpiredStatus is EExpiredStatus.Expired, d => DateTime.Now >= d.ExpiredTime)
-	        .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
-			.OrderBy(d => d.Status)
+            .WhereIF(dto.IsUrgent.HasValue, d => d.IsUrgent == dto.IsUrgent.Value)
+            .OrderBy(d => d.Status)
             .OrderBy(d => d.CreationTime, OrderByType.Desc)
             .ToPagedListAsync(dto, HttpContext.RequestAborted);
 
@@ -3322,35 +3325,35 @@ public class OrderController : BaseController
                     : d is EOrderStatus.WaitForAccept or EOrderStatus.BackToUnAccept or EOrderStatus.SpecialToUnAccept)
             .ToArray();
 
-		var (total2, items2) = await _orderRepository.Queryable()
-		.LeftJoin<WorkflowStep>((d, step) => d.Id == step.ExternalId)
-		.Where((d, step) =>
-			((string.IsNullOrEmpty(d.WorkflowId) && (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)) ||
-			(!string.IsNullOrEmpty(d.WorkflowId) &&
-			((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
-			 (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
-			 (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId))) &&
-			 (((dto.IsHandled.HasValue && dto.IsHandled == false) && step.Status != EWorkflowStepStatus.Handled) ||
-			((dto.IsHandled.HasValue && dto.IsHandled == true) && step.Status == EWorkflowStepStatus.Handled)))))
-		.WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
-		.WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
-		.WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.StartsWith(dto.Keyword!))
-		.WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No)
-		.WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
-		.WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => !d.CounterSignType.HasValue)
-		.WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true, d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) || (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
-		.WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false, d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now)//即将超期 未办
-		.WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
-		.WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
-		.Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
-		.Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
-		.OrderBy(d => d.Status)
-		.OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
-		.OrderByIF(dto.IsHandled == false, d => d.CreationTime, OrderByType.Desc)
-		.Select((d, step) => d)
-		.ToPagedListAsync(dto, HttpContext.RequestAborted);
-
-		var page2 = new PagedDto<OrderDto>(total2, _mapper.Map<IReadOnlyList<OrderDto>>(items2));
+        var (total2, items2) = await _orderRepository.Queryable()
+        .LeftJoin<WorkflowStep>((d, step) => d.Id == step.ExternalId)
+        .Where((d, step) =>
+            ((string.IsNullOrEmpty(d.WorkflowId) && (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)) ||
+            (!string.IsNullOrEmpty(d.WorkflowId) &&
+            ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
+             (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
+             (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId))) &&
+             (((dto.IsHandled.HasValue && dto.IsHandled == false) && step.Status != EWorkflowStepStatus.Handled) ||
+            ((dto.IsHandled.HasValue && dto.IsHandled == true) && step.Status == EWorkflowStepStatus.Handled)))))
+        .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
+        .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
+        .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.Title.StartsWith(dto.Keyword!))
+        .WhereIF(!string.IsNullOrEmpty(dto.No), d => d.No == dto.No)
+        .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
+        .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => !d.CounterSignType.HasValue)
+        .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true, d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) || (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
+        .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false, d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now)//即将超期 未办
+        .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
+        .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
+        .Where(d => d.Source < ESource.MLSQ || d.Source > ESource.WZSC)
+        .Where(d => d.Status != EOrderStatus.BackToProvince && d.Status < EOrderStatus.Filed)
+        .OrderBy(d => d.Status)
+        .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
+        .OrderByIF(dto.IsHandled == false, d => d.CreationTime, OrderByType.Desc)
+        .Select((d, step) => d)
+        .ToPagedListAsync(dto, HttpContext.RequestAborted);
+
+        var page2 = new PagedDto<OrderDto>(total2, _mapper.Map<IReadOnlyList<OrderDto>>(items2));
 
         return new { Waited = page1, Sign = page2 };
     }
@@ -3789,8 +3792,8 @@ public class OrderController : BaseController
             //if (dto.AlterTime)
             //{
             var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now, order.AcceptTypeCode);
-            var processType = dto.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter 
-                ? EProcessType.Zhiban 
+            var processType = dto.FlowDirection is EFlowDirection.OrgToCenter or EFlowDirection.CenterToCenter or EFlowDirection.FiledToCenter
+                ? EProcessType.Zhiban
                 : EProcessType.Jiaoban;
             //var expiredTime = _timeLimitDomainService.CalcEndTime(DateTime.Now,
             //	ETimeType.WorkDay,
@@ -5047,7 +5050,7 @@ public class OrderController : BaseController
         order.Sign(_sessionContext.RequiredUserId, _sessionContext.UserName);
         order.AutoAccept(_sessionContext.RequiredUserId, _sessionContext.UserName, _sessionContext.StaffNo);
 
-		if (!string.IsNullOrEmpty(order.WorkflowId))
+        if (!string.IsNullOrEmpty(order.WorkflowId))
         {
             var workflow = await _workflowDomainService.SignToSomebodyAsync(
                 order.WorkflowId,
@@ -5642,7 +5645,7 @@ public class OrderController : BaseController
 
                 orderData.SourceChannel = "其他";
                 orderData.SourceChannelCode = "QT";
-                await _orderRepository.UpdateAsync(orderData, HttpContext.RequestAborted);
+                // await _orderRepository.UpdateAsync(orderData, HttpContext.RequestAborted);
 
                 //向省上推送数据
                 if (dto.IsPush)
@@ -5681,19 +5684,19 @@ public class OrderController : BaseController
         var setting = _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi);
         if (!string.IsNullOrEmpty(order.WorkflowId))
         {
-	        var steps = await _workflowStepRepository.Queryable()
-		        .Where(d => d.ExternalId == orderId && d.Status != EWorkflowStepStatus.Handled)
-		        .ToListAsync(HttpContext.RequestAborted);
-			if (steps.Count > 1)
-		        throw new UserFriendlyException("多个待办理节点暂不支持平移");
-	        step = steps.First();
-	        if (step.BusinessType is not EBusinessType.Center and not EBusinessType.Send)
-		        throw UserFriendlyException.SameMessage("当前办理节点非中心暂不支持平移");
-	        setting = step.BusinessType is EBusinessType.Center
-		        ? _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi)
-		        : _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan);
-		}
-		var roles = setting?.SettingValue.ToList();
+            var steps = await _workflowStepRepository.Queryable()
+                .Where(d => d.ExternalId == orderId && d.Status != EWorkflowStepStatus.Handled)
+                .ToListAsync(HttpContext.RequestAborted);
+            if (steps.Count > 1)
+                throw new UserFriendlyException("多个待办理节点暂不支持平移");
+            step = steps.First();
+            if (step.BusinessType is not EBusinessType.Center and not EBusinessType.Send)
+                throw UserFriendlyException.SameMessage("当前办理节点非中心暂不支持平移");
+            setting = step.BusinessType is EBusinessType.Center
+                ? _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi)
+                : _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan);
+        }
+        var roles = setting?.SettingValue.ToList();
         var users = await _userRepository.Queryable()
             .Includes(d => d.Organization)
             .Includes(d => d.Roles)
@@ -5703,7 +5706,7 @@ public class OrderController : BaseController
         {
             StepId = step.Id,
             OrderId = orderId,
-			Handlers = users.Select(d => new OrderMigrationHandler
+            Handlers = users.Select(d => new OrderMigrationHandler
             {
                 UserId = d.Id,
                 Username = d.Name,
@@ -5715,28 +5718,29 @@ public class OrderController : BaseController
     }
 
 
-	/// <summary>
-	/// 工单平移
-	/// </summary>
-	[HttpPost("change-handler")]
+    /// <summary>
+    /// 工单平移
+    /// </summary>
+    [HttpPost("change-handler")]
     public async Task ChangeHandler([FromBody] ChangeHandlerDto dto)
     {
         if (string.IsNullOrEmpty(dto.StepId))
         {
-	        await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { SignerId = dto.Handler.UserId, SignerName = dto.Handler.Username })
-		        .Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
-		}
-        else {
-			var step = await _workflowStepRepository.Queryable()
-				.Includes(d => d.WorkflowTrace)
-				.FirstAsync(d => d.Id == dto.StepId, HttpContext.RequestAborted);
-			if (step is null)
-				throw new UserFriendlyException("无效节点编号");
-			await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, ICollection<WorkflowStep> steps)>
-			{
-				new(dto.Handler.UserId,dto.Handler.Username,dto.Handler.OrgId,dto.Handler.OrgName, new List<WorkflowStep>{step})
-			}, HttpContext.RequestAborted);
-		}
+            await _orderRepository.Updateable().SetColumns(o => new Orders.Order() { SignerId = dto.Handler.UserId, SignerName = dto.Handler.Username })
+                .Where(o => o.Id == dto.OrderId).ExecuteCommandAsync(HttpContext.RequestAborted);
+        }
+        else
+        {
+            var step = await _workflowStepRepository.Queryable()
+                .Includes(d => d.WorkflowTrace)
+                .FirstAsync(d => d.Id == dto.StepId, HttpContext.RequestAborted);
+            if (step is null)
+                throw new UserFriendlyException("无效节点编号");
+            await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, ICollection<WorkflowStep> steps)>
+            {
+                new(dto.Handler.UserId,dto.Handler.Username,dto.Handler.OrgId,dto.Handler.OrgName, new List<WorkflowStep>{step})
+            }, HttpContext.RequestAborted);
+        }
     }
-	#endregion
+    #endregion
 }

+ 14 - 5
src/Hotline.Api/Controllers/TestController.cs

@@ -211,8 +211,8 @@ public class TestController : BaseController
             ExternalId = "123456789",
             OrderId = "123456789",
             PushPlatform = EPushPlatform.Sms,
-            Remark =" order.Title",
-            Name ="张三",
+            Remark = " order.Title",
+            Name = "张三",
             TemplateCode = "1005",
             Params = new List<string>() { "20240610000022", "12345" },
             TelNumber = "15881689499",
@@ -579,7 +579,7 @@ public class TestController : BaseController
     public async Task TestExportExcel1()
     {
         var orders = await _orderRepository.Queryable()
-            .Includes(d=>d.OrderExtension)
+            .Includes(d => d.OrderExtension)
             .InnerJoin<Workflow>((o, w) => o.WorkflowId == w.Id)
             .Where((o, w) => o.Status < EOrderStatus.Filed && w.Status == EWorkflowStatus.Completed)
             .ToListAsync(HttpContext.RequestAborted);
@@ -587,7 +587,7 @@ public class TestController : BaseController
 
         var workflowIds = orders.Select(d => d.WorkflowId).ToList();
         var workflows = await _workflowRepository.Queryable()
-            .Includes(d=>d.Steps, x=>x.WorkflowTrace)
+            .Includes(d => d.Steps, x => x.WorkflowTrace)
             //.Includes(d=>d.Traces)
             .Where(d => workflowIds.Contains(d.Id))
             .ToListAsync(HttpContext.RequestAborted);
@@ -611,7 +611,16 @@ public class TestController : BaseController
                 ? _timeLimitDomainService.CalcWorkTime(order.StartTime.Value, now,
                 order.ProcessType is EProcessType.Zhiban)
                 : 0;
-            order.File(now, handleDuration, fileDuration, allDuration);
+            var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
+                   ? _timeLimitDomainService.CalcWorkTime(order.CreationTime, order.ActualHandleTime.Value,
+                   order.ProcessType is EProcessType.Zhiban)
+                   : 0;
+            var centerToOrgHandleDurationWorkday = order.ActualHandleTime.HasValue && order.CenterToOrgTime.HasValue
+                ? _timeLimitDomainService.CalcWorkTime(order.CenterToOrgTime.Value, order.ActualHandleTime.Value,
+                order.ProcessType is EProcessType.Zhiban)
+                : 0;
+
+            order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
 
             var endStep = workflow.Steps.FirstOrDefault(d => d.StepType == EStepType.End);
             //var endTrace = workflow.Steps.FirstOrDefault(d => d.WorkflowTrace.StepType == EStepType.End)?.WorkflowTrace;

+ 0 - 105
src/Hotline.Api/config/appsettings.Development.json

@@ -98,111 +98,6 @@
     "Password": "12345678aa",
     "Ip": "222.213.23.229"
   },
-  "ChannelConfiguration": {
-    //省12345配置
-    "Province": {
-      "HuiJu": "http://103.203.219.157/cns-sccthj-job-test/rest/",
-      "XieTong": "http://103.203.219.157/cns-scxthj-rest-test/rest/",
-      "ClientId": "6384f475-2e1e-4985-9e34-51a3379452d0",
-      "ClientSecret": "3e92b698-d640-4056-be94-128710ac1a7e"
-    },
-    //企业服务
-    "Enterprise": {
-      "AddressUrl": "http://10.12.185.227:8834/",
-      "ClientId": "1462598736",
-      "ClientSecret": "6nZtVK4rKfnsncGymUHB",
-      "TenantId": "000000"
-    },
-    //市州数据交换
-    "CityHandOver": {
-      "SecretKey": "AA9FF92A-5040-442A-BDFF-A50AD536BF3D",
-      "SendCityName": "宜宾",
-      "ReceiveCityName": "泸州",
-      "BaseUrl": "http://localhost:6028/",
-      "UrlAddress": "CityHandOver.asmx/FlowWrite"
-    },
-    //融媒体
-    "MediaCode": {
-      "MediaCode": "FWYB0828"
-    },
-    //系统市州编码
-    "CityCode": {
-      "AreaCode": "511500"
-    },
-    "WebPortal": {
-      // "SystemSettingsTheme": "class=gray2",
-      "SystemSettingsTheme": ""
-    },
-    //业务系统附件上传配置
-    "BusinessFile": {
-      "BaseUrl": "http://open.fs.12345lm.cn/",
-      "UploadUrlAddress": "file/upload",
-      "DownloadUrlAddress": "file/downloadfile",
-      "Source": "数据共享系统"
-    },
-    //110对接
-    "PoliceDS": {
-      //1、非警情分流推送服务_宜宾市
-      //   receive-工单受理
-      //   http://10.12.185.168:8001/service/api/ds/110To12345/chainAlarm
-      "token1_token": "b8aae0a998f5b79c9a35aecb888e1a58",
-      "token1_dcsm": "c9bc4e718d1917a9a68add90fecbe5bb60920e5ab85d9ecb6a6167db4352f42b8ae21ac67a6e2aab48b4c99cd9f93ec5fb017e202df969a91f74456c14e8770a",
-      "token1_sm2_public": "BS/H9JVlRdo8vbsZYQLTkeGGZBVjdkX+VJ82CX7n6i4NubmynRIaxvzoSsEAhbbvTDGm2DS96l95nK6Dkd0UZg==",
-      "token1_sm2_private": "GbjU4GFk0yaa/wTdzxeh5BOh8VNlqvnTcb7EUtDVvOY=",
-      "token1_sm4": "BKrW/v4jeRgsFg3HSbxEKnDi6rPceW0AdRiaa1rhEwAnraf8MnHdXzUQoQ7+zyjfghaK5G+zDz+wW+Ob27Jgxt91HkVmyL6+SjqV9ZnqNeGFgTBkQrHDySGz6jHKa12Sv7PZs8pjc716he3NNHZAkCI=",
-      "token1_sm4_mw": "4034d80c19bbd01d",
-
-      //4、警务警情分流推送服务_宜宾市
-      //   receive-工单办结
-      //   http://10.12.185.168:8001/service/api/ds/110To12345/chainDeal
-      "token4_token": "8806bfba29b997853bdb059a9ba9a3ae",
-      "token4_dcsm": "f5dce079e0f4acd6b6627b89fb5e72af5fa5775d3ee3b8c7876f546c5ebe723888df4a70c09f9aa5e096bb342d73e0c4793c851a7a8035e8683b07430f132bd3",
-      "token4_sm2_public": "P2IVWpFx38GQTDV3hgrxjlOdfPhLQNW2LyvAKmYqMz9UYHCtm/l3K73UIouMXs4jcmZjXyItepvKFv44g3YnXA==",
-      "token4_sm2_private": "yxIkRALHoOTxpiZ/jrvCDQatcR7k11Xhps7c92peU9w=",
-      "token4_sm4": "BCD88AXnIfMxe8PrUcubSbFRr07cOuDDEPzy754W3CzhOqjcpAcu1B9B6U46jyM4hEFPqkx+SS1PUAfRlG5tzYD1Z8SKsJTBUDGR6bTMRvCc+C/aps+IcRBfzjjRchtT1c5iok4CfiT4LoK5cmOHKKU=",
-      "token4_sm4_mw": "d731ff1282dda792",
-
-      //3、警务警情分流查询服务_宜宾市
-      //   send-工单受理
-      //   http://10.12.185.168:8001/service/api/ds/12345To110/chainAlarm
-      "token3_token": "b76ba1896c4880998a86b829cf79888a",
-      "token3_dcsm": "3cccc86e021c0ff7827537053ec1b6e4a57cbb49b77c9492257123703c5a6b711000f0842c035fe6d33eb2a947915af53a1ef501916ec7128bff9514d6184e2c",
-      "token3_sm2_public": "qaao4Xh8/eyYGeVOj1K8D7p3+OriP55azWDAbYVoZelMdluNrJuQWM2qPn+hjTHTBnIMAVK2HlHBx4oGfCxGdA==",
-      "token3_sm2_private": "8bSYM8P3b4I94qGt3XVx3bQddNCy/xVKo7o1b5LI4/M=",
-      "token3_sm4": "BIDhFaEu5NILR7byg/JfaPlJEm4dYWC+u9J1IqhtYeYY1AktOxp7cZWqfk/mWjw72pYGT7YRENCULbjZ2bxVG6UUv2pYukZWtYog34Vicu5IgC8ti4VpED9eGzGgtKJ/CT0KtAnjQPQL0PsVbCjTY5M=",
-      "token3_sm4_mw": "bbeb56d247354360",
-
-      //2、非警情分流查询服务_宜宾市
-      //   send-工单办结
-      //   http://10.12.185.168:8001/service/api/ds/12345To110/chainDeal
-      "token2_token": "1fbbac1b09b89d11bc569168aabb3c8b",
-      "token2_dcsm": "3873c1b1ff0ce3b8120d63509d3b85169cda4856b0a0d89625a4744641a343951d8ced868bd5c7fc60826403bd6314a02e5a26ba8808dae5a9d9f851555338d0",
-      "token2_sm2_public": "VgjJ7FfA23vY3Hr1pVrdbi3MZt7X0k/nMf9kwEyyC32CXgT2ccWBlxf3kGPXLO56HSBoo9IA7sSEG3eJYVQmLw==",
-      "token2_sm2_private": "QNTPy2nPBe2JY308G0LHO4r42iomDWcdedf81FapkWA=",
-      "token2_sm4": "BKNpLwBCT2MvXwhLRcZ6FoMm4GaXs6LXqVmEa5hMJ3d9G+vC/5j7xtQh9HRKIfSfXkDQI0EQS7UR4inEXks/AnKsLYGhmhRjyzM7AGpEsujr2vJTwcwIWpBmpuc7k0uBQ34bN+kopafIo5UVyk7rIek=",
-      "token2_sm4_mw": "2938d7acb2754a09",
-
-      //5、从公安网侧获取12345政务服务热线平台知识库列表
-      //   send-知识库列表
-      //   http://10.12.185.168:8001/service/api/ds/get_knowledge_info
-      "token5_token": "1fbbac1b09b89d11bc569168aabb3c8b",
-      "token5_dcsm": "3873c1b1ff0ce3b8120d63509d3b85169cda4856b0a0d89625a4744641a343951d8ced868bd5c7fc60826403bd6314a02e5a26ba8808dae5a9d9f851555338d0",
-      "token5_sm2_public": "VgjJ7FfA23vY3Hr1pVrdbi3MZt7X0k/nMf9kwEyyC32CXgT2ccWBlxf3kGPXLO56HSBoo9IA7sSEG3eJYVQmLw==",
-      "token5_sm2_private": "QNTPy2nPBe2JY308G0LHO4r42iomDWcdedf81FapkWA=",
-      "token5_sm4": "BKNpLwBCT2MvXwhLRcZ6FoMm4GaXs6LXqVmEa5hMJ3d9G+vC/5j7xtQh9HRKIfSfXkDQI0EQS7UR4inEXks/AnKsLYGhmhRjyzM7AGpEsujr2vJTwcwIWpBmpuc7k0uBQ34bN+kopafIo5UVyk7rIek=",
-      "token5_sm4_mw": "2938d7acb2754a09",
-
-      //6、从公安网侧获取12345政务服务热线平台知识内容
-      //   send-知识库内容
-      //   http://10.12.185.168:8001/service/api/ds/get_knowledge_content
-      "token6_token": "1fbbac1b09b89d11bc569168aabb3c8b",
-      "token6_dcsm": "3873c1b1ff0ce3b8120d63509d3b85169cda4856b0a0d89625a4744641a343951d8ced868bd5c7fc60826403bd6314a02e5a26ba8808dae5a9d9f851555338d0",
-      "token6_sm2_public": "VgjJ7FfA23vY3Hr1pVrdbi3MZt7X0k/nMf9kwEyyC32CXgT2ccWBlxf3kGPXLO56HSBoo9IA7sSEG3eJYVQmLw==",
-      "token6_sm2_private": "QNTPy2nPBe2JY308G0LHO4r42iomDWcdedf81FapkWA=",
-      "token6_sm4": "BKNpLwBCT2MvXwhLRcZ6FoMm4GaXs6LXqVmEa5hMJ3d9G+vC/5j7xtQh9HRKIfSfXkDQI0EQS7UR4inEXks/AnKsLYGhmhRjyzM7AGpEsujr2vJTwcwIWpBmpuc7k0uBQ34bN+kopafIo5UVyk7rIek=",
-      "token6_sm4_mw": "2938d7acb2754a09"
-    }
-  },
   //智能回访
   "AiVisit": {
     "Url": "http://118.122.73.80:19061",

+ 11 - 2
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -156,7 +156,16 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                     ? _timeLimitDomainService.CalcWorkTime(order.StartTime.Value, now,
                     order.ProcessType is EProcessType.Zhiban)
                     : 0;
-                order.File(now, handleDuration, fileDuration, allDuration);
+                var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
+                    ? _timeLimitDomainService.CalcWorkTime(order.CreationTime, order.ActualHandleTime.Value,
+                    order.ProcessType is EProcessType.Zhiban)
+                    : 0;
+                var centerToOrgHandleDurationWorkday = order.ActualHandleTime.HasValue && order.CenterToOrgTime.HasValue
+                    ? _timeLimitDomainService.CalcWorkTime(order.CenterToOrgTime.Value, order.ActualHandleTime.Value,
+                    order.ProcessType is EProcessType.Zhiban)
+                    : 0;
+
+                order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
                 order.FileUserId = notification.Trace.HandlerId;
                 order.FileUserName = notification.Trace.HandlerName;
                 order.FileUserOrgId = notification.Trace.HandlerOrgId;
@@ -201,7 +210,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                 //司法行政监督管理-工单处理
                 await _enforcementApplication.AddEnforcementOrderAsync(order, cancellationToken);
                 //推诿工单
-               // await _enforcementApplication.AddPassTheBuckOrderAsync(order, _sessionContext.OrgId, _sessionContext.OrgName, cancellationToken);
+                // await _enforcementApplication.AddPassTheBuckOrderAsync(order, _sessionContext.OrgId, _sessionContext.OrgName, cancellationToken);
                 break;
             case WorkflowModuleConsts.OrderScreen:
                 var screen = await _orderScreenRepository.GetAsync(workflow.ExternalId, cancellationToken);

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

@@ -172,7 +172,16 @@ public class OrderApplication : IOrderApplication, IScopeDependency
             ? _timeLimitDomainService.CalcWorkTime(order.StartTime.Value, now,
                 order.ProcessType is EProcessType.Zhiban)
             : 0;
-        order.File(now, handleDuration, fileDuration, allDuration);
+        var creationTimeHandleDurationWorkday = order.ActualHandleTime.HasValue
+                    ? _timeLimitDomainService.CalcWorkTime(order.CreationTime, order.ActualHandleTime.Value,
+                    order.ProcessType is EProcessType.Zhiban)
+                    : 0;
+        var centerToOrgHandleDurationWorkday = order.ActualHandleTime.HasValue && order.CenterToOrgTime.HasValue
+            ? _timeLimitDomainService.CalcWorkTime(order.CenterToOrgTime.Value, order.ActualHandleTime.Value,
+            order.ProcessType is EProcessType.Zhiban)
+            : 0;
+
+        order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
         await _orderRepository.UpdateAsync(order, cancellationToken);
     }
 
@@ -885,11 +894,11 @@ public class OrderApplication : IOrderApplication, IScopeDependency
 	/// <returns></returns>
 	public ISugarQueryable<OrderVisitDetail> VisitAndOrgSatisfactionDetail(VisitAndOrgSatisfactionDetailDto dto)
 	{
-		dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+		dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 		bool IsCenter = _sessionContext.OrgIsCenter;
         return _orderVisitDetailRepository.Queryable()
             .Includes(x => x.OrderVisit, o => o.Order, d => d.CallRecord)
-            .Where(x => x.OrderVisit.VisitTime >= dto.StartDate && x.OrderVisit.VisitTime <= dto.EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited)
+            .Where(x => x.OrderVisit.VisitTime >= dto.StartTime && x.OrderVisit.VisitTime <= dto.EndTime && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited)
             .WhereIF(dto.OrgCode == "001", x => x.VisitOrgCode == dto.OrgCode)
             //.WhereIF(dto.OrgCode != "001", x => x.VisitOrgCode == dto.OrgCode).
             .WhereIF(dto.IsOnlyMy == true, x => x.VisitOrgCode == dto.OrgCode)

+ 24 - 24
src/Hotline.Application/StatisticalReport/OrderReportApplication.cs

@@ -106,13 +106,13 @@ namespace Hotline.Application.StatisticalReport
         /// <returns></returns>
         public ISugarQueryable<DepartmentalProcessingStatisticsDataDto> DepartmentalProcessingStatistics(DepartmentalProcessingStatisticsRequest dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
             var IsCenter = _sessionContext.OrgIsCenter;
 
             //工单   已办=归完档的工单数+会签已办数量
             #region 工单
             var queryOrder = _orderRepository.Queryable()
-                         .Where(it => it.CreationTime >= dto.StartDate && it.CreationTime <= dto.EndDate && it.Status > EOrderStatus.WaitForAccept)
+                         .Where(it => it.CreationTime >= dto.StartTime && it.CreationTime <= dto.EndTime && it.Status > EOrderStatus.WaitForAccept)
                         .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, it => it.Source == ESource.ProvinceStraight)
                          .Select(it => new
                          {
@@ -163,7 +163,7 @@ namespace Hotline.Application.StatisticalReport
             //发布
             var queryPublish = _orderPublishRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .Select((x, o) => new
                 {
@@ -210,7 +210,7 @@ namespace Hotline.Application.StatisticalReport
             // .LeftJoin<WorkflowTrace>((x, o) => x.WorkflowStepId == o.StepId)
             var queryCountersign = _workflowTraceRepository.Queryable()
              .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
-             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
+             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartTime && t.CreationTime <= dto.EndTime)
              .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
              .Select((t, o) => new
              {
@@ -257,7 +257,7 @@ namespace Hotline.Application.StatisticalReport
             //延期
             var orderDelay = _orderDelayRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .Select((x, o) => new
                 {
@@ -300,7 +300,7 @@ namespace Hotline.Application.StatisticalReport
             //甄别
             var orderScreen = _orderScreenRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgName), (x, o) => x.CreatorOrgId.Contains(dto.OrgName))
                 .Select((x, o) => new
@@ -346,7 +346,7 @@ namespace Hotline.Application.StatisticalReport
             var orderVisit = _orderVisitDetailRepository.Queryable()
                 .LeftJoin<OrderVisit>((x, o) => x.VisitId == o.Id)
                 .LeftJoin<Order>((x, o, p) => o.OrderId == p.Id)
-            .Where((x, o, p) => x.OrderVisit.VisitTime >= dto.StartDate && x.OrderVisit.VisitTime <= dto.EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
+            .Where((x, o, p) => x.OrderVisit.VisitTime >= dto.StartTime && x.OrderVisit.VisitTime <= dto.EndTime && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
             .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o, p) => p.Source == ESource.ProvinceStraight)
             .Select((x, o, p) => new
             {
@@ -427,12 +427,12 @@ namespace Hotline.Application.StatisticalReport
         /// <returns></returns>
         public ISugarQueryable<DepartmentalProcessingStatisticsDataDto> DepartmentalProcessingChildStatistics(DepartmentalProcessingStatisticsRequest dto)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             #region 工单
             //工单
             var queryOrder = _orderRepository.Queryable()
-                      .Where(it => it.CreationTime >= dto.StartDate && it.CreationTime <= dto.EndDate && it.Status > EOrderStatus.WaitForAccept)
+                      .Where(it => it.CreationTime >= dto.StartTime && it.CreationTime <= dto.EndTime && it.Status > EOrderStatus.WaitForAccept)
                       .WhereIF(dto.OrgCode == "001", it => it.ActualHandleOrgCode == dto.OrgCode)
                       .WhereIF(dto.OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(dto.OrgCode))
                       .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, it => it.Source == ESource.ProvinceStraight)
@@ -484,7 +484,7 @@ namespace Hotline.Application.StatisticalReport
             //发布
             var queryPublish = _orderPublishRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(dto.OrgCode == "001", (x, o) => o.ActualHandleOrgCode == dto.OrgCode)
                 .WhereIF(dto.OrgCode != "001", (x, o) => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
@@ -532,7 +532,7 @@ namespace Hotline.Application.StatisticalReport
             // .LeftJoin<WorkflowTrace>((x, o) => x.WorkflowStepId == o.StepId)
             var queryCountersign = _workflowTraceRepository.Queryable()
              .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
-             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
+             .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartTime && t.CreationTime <= dto.EndTime)
              .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
              .WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
               .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
@@ -580,7 +580,7 @@ namespace Hotline.Application.StatisticalReport
             //延期
             var orderDelay = _orderDelayRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(dto.OrgCode == "001", (x, o) => x.ApplyOrgCode == dto.OrgCode)
                 .WhereIF(dto.OrgCode != "001", (x, o) => x.ApplyOrgCode.StartsWith(dto.OrgCode))
@@ -624,7 +624,7 @@ namespace Hotline.Application.StatisticalReport
             //甄别
             var orderScreen = _orderScreenRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(!string.IsNullOrEmpty(dto.OrgName), (x, o) => x.CreatorOrgId.Contains(dto.OrgName))
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(dto.OrgCode == "001", (x, o) => x.CreatorOrgId == dto.OrgCode)
@@ -671,7 +671,7 @@ namespace Hotline.Application.StatisticalReport
             var orderVisit = _orderVisitDetailRepository.Queryable()
                 .LeftJoin<OrderVisit>((x, o) => x.VisitId == o.Id)
                 .LeftJoin<Order>((x, o, p) => o.OrderId == p.Id)
-                .Where((x, o) => x.OrderVisit.VisitTime >= dto.StartDate && x.OrderVisit.VisitTime <= dto.EndDate && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
+                .Where((x, o) => x.OrderVisit.VisitTime >= dto.StartTime && x.OrderVisit.VisitTime <= dto.EndTime && x.VisitTarget == EVisitTarget.Org && x.OrderVisit.VisitState == EVisitState.Visited && !string.IsNullOrEmpty(x.VisitOrgCode))
                 .WhereIF(dto.OrgCode == "001", (x, o) => x.VisitOrgCode == dto.OrgCode)
                 .WhereIF(dto.OrgCode != "001", (x, o) => x.VisitOrgCode.StartsWith(dto.OrgCode))
                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o, p) => p.Source == ESource.ProvinceStraight)
@@ -753,7 +753,7 @@ namespace Hotline.Application.StatisticalReport
         /// <returns></returns>
         public ISugarQueryable<SelectOrderId> GetDepartmentalProcessingStatisticsList(DepartmentalProcessingStatisticsRequest dto, CancellationToken cancellationToken)
         {
-            dto.EndDate = dto.EndDate.AddDays(1).AddSeconds(-1);
+            dto.EndTime = dto.EndTime.AddDays(1).AddSeconds(-1);
 
             RefAsync<int> total = 0;
             string stye = "";
@@ -812,7 +812,7 @@ namespace Hotline.Application.StatisticalReport
             if (stye == "0")
             {
                 var ybQuery = _orderRepository.Queryable()
-                                  .Where(it => it.CreationTime >= dto.StartDate && it.CreationTime <= dto.EndDate && it.Status > EOrderStatus.WaitForAccept)
+                                  .Where(it => it.CreationTime >= dto.StartTime && it.CreationTime <= dto.EndTime&& it.Status > EOrderStatus.WaitForAccept)
                                   .WhereIF(dto.OrgCode == "001", it => it.ActualHandleOrgCode == dto.OrgCode)
                                   .WhereIF(dto.OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(dto.OrgCode))
                                  .WhereIF(dto.StatisticsType == EStatisticsType.YBOrderCountNum, it => it.Status >= EOrderStatus.Filed)//已办
@@ -824,7 +824,7 @@ namespace Hotline.Application.StatisticalReport
                 //  .LeftJoin<WorkflowTrace>((x, o) => x.WorkflowStepId == o.StepId)
                 var hqybquery = _workflowTraceRepository.Queryable()
                     .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
-                  .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
+                  .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartTime && t.CreationTime <= dto.EndTime)
                   .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                   .WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
                   .WhereIF(dto.StatisticsType == EStatisticsType.YBOrderCountNum, (t, o) => t.Status >= EWorkflowStepStatus.Handled && t.CountersignPosition > ECountersignPosition.None)//会签已办
@@ -843,7 +843,7 @@ namespace Hotline.Application.StatisticalReport
             {
                 //工单
                 var queryData = _orderRepository.Queryable()
-                          .Where(o => o.CreationTime >= dto.StartDate && o.CreationTime <= dto.EndDate && o.Status > EOrderStatus.WaitForAccept)
+                          .Where(o => o.CreationTime >= dto.StartTime && o.CreationTime <= dto.EndTime && o.Status > EOrderStatus.WaitForAccept)
                          .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, o => o.Source == ESource.ProvinceStraight)
                           .WhereIF(dto.OrgCode == "001", o => o.ActualHandleOrgCode == dto.OrgCode)
                           .WhereIF(dto.OrgCode != "001", o => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
@@ -864,7 +864,7 @@ namespace Hotline.Application.StatisticalReport
                 //发布
                 var queryPublish = _orderPublishRepository.Queryable()
                     .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                    .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                    .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                     .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                     .WhereIF(dto.OrgCode == "001", (x, o) => o.ActualHandleOrgCode == dto.OrgCode)
                     .WhereIF(dto.OrgCode != "001", (x, o) => o.ActualHandleOrgCode.StartsWith(dto.OrgCode))
@@ -885,7 +885,7 @@ namespace Hotline.Application.StatisticalReport
                 //延期
                 var orderDelay = _orderDelayRepository.Queryable()
                 .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(dto.OrgCode == "001", (x, o) => x.ApplyOrgCode == dto.OrgCode)
                 .WhereIF(dto.OrgCode != "001", (x, o) => x.ApplyOrgCode.StartsWith(dto.OrgCode))
@@ -904,7 +904,7 @@ namespace Hotline.Application.StatisticalReport
                 //甄别
                 var orderScreen = _orderScreenRepository.Queryable()
                  .LeftJoin<Order>((x, o) => x.OrderId == o.Id)
-                .Where((x, o) => x.CreationTime >= dto.StartDate && x.CreationTime <= dto.EndDate)
+                .Where((x, o) => x.CreationTime >= dto.StartTime && x.CreationTime <= dto.EndTime)
                 .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (x, o) => o.Source == ESource.ProvinceStraight)
                 .WhereIF(dto.OrgCode == "001", (x, o) => x.CreatorOrgId == dto.OrgCode)
                 .WhereIF(dto.OrgCode != "001", (x, o) => x.CreatorOrgId.StartsWith(dto.OrgCode))
@@ -926,7 +926,7 @@ namespace Hotline.Application.StatisticalReport
                 //会签(已办超期、待办超期)
                 var queryCountersign = _workflowTraceRepository.Queryable()
                .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
-               .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
+               .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartTime && t.CreationTime <= dto.EndTime)
                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                .WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))
@@ -952,7 +952,7 @@ namespace Hotline.Application.StatisticalReport
             if (stye == "6")
             {
                 var queryOrder = _orderRepository.Queryable()
-                         .Where(it => it.CreationTime >= dto.StartDate && it.CreationTime <= dto.EndDate && it.Status > EOrderStatus.WaitForAccept)
+                         .Where(it => it.CreationTime >= dto.StartTime && it.CreationTime <= dto.EndTime && it.Status > EOrderStatus.WaitForAccept)
                          .WhereIF(dto.OrgCode == "001", it => it.ActualHandleOrgCode == dto.OrgCode)
                          .WhereIF(dto.OrgCode != "001", it => it.ActualHandleOrgCode.StartsWith(dto.OrgCode))
                          .WhereIF(dto.StatisticsType == EStatisticsType.SubtotalOverdue, it => (it.Status >= EOrderStatus.Filed && it.ActualHandleTime > it.ExpiredTime))//已办超期
@@ -965,7 +965,7 @@ namespace Hotline.Application.StatisticalReport
                 //.LeftJoin<WorkflowTrace>((x, o) => x.WorkflowStepId == o.StepId)
                 var queryCountersign = _workflowTraceRepository.Queryable()
                .LeftJoin<Order>((t, o) => t.ExternalId == o.Id)
-               .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartDate && t.CreationTime <= dto.EndDate)
+               .Where((t, o) => t.ModuleCode == WorkflowModuleConsts.OrderHandle && t.CreationTime >= dto.StartTime && t.CreationTime <= dto.EndTime)
                .WhereIF(dto.IsProvince.HasValue && dto.IsProvince == true, (t, o) => o.Source == ESource.ProvinceStraight)
                .WhereIF(dto.OrgCode == "001", (t, o) => t.HandlerOrgId == dto.OrgCode)
                .WhereIF(dto.OrgCode != "001", (t, o) => t.HandlerOrgId.StartsWith(dto.OrgCode))

+ 11 - 11
src/Hotline.Share/Dtos/Bi/BiOrderDto.cs

@@ -4,11 +4,11 @@ namespace Hotline.Share.Dtos.Bi
 {
     public record VisitAndOrgSatisfactionDetailDto : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
-        public string? OrgCode { get; set; }
-        public int? TypeId { get; set; }
-        public string? DateValue { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
+        public string OrgCode { get; set; }
+        public int TypeId { get; set; }
+        public string DateValue { get; set; }
 
         public string? LineNum { get; set; }
 
@@ -20,16 +20,16 @@ namespace Hotline.Share.Dtos.Bi
 
     public record HighFrequencyCallStatisticsRequest : PagedRequest
     {
-        public DateTime? StartDate { get; set; }
-        public DateTime? EndDate { get; set; }
+        public DateTime? StartTime { get; set; }
+        public DateTime? EndTime { get; set; }
 
         public string? PhoneNum { get; set; }
     }
 
     public record HighMatterWarningRequest : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
 
         public List<string> HotspotIds { get; set; } = new();
 
@@ -40,8 +40,8 @@ namespace Hotline.Share.Dtos.Bi
 
     public record HighMatterWarningDetailRequest : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
 
         public string HotspotId { get; set; }
 

+ 8 - 8
src/Hotline.Share/Dtos/JudicialManagement/QueryEventClassificationStatisticsDto.cs

@@ -4,8 +4,8 @@ namespace Hotline.Share.Dtos.JudicialManagement
 {
     public record QueryEventClassificationStatisticsDto : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
         public string EventTypeId { get; set; }
 
         public string AreaCode { get; set; }
@@ -13,8 +13,8 @@ namespace Hotline.Share.Dtos.JudicialManagement
 
     public record QueryDepartmentalProcessingStatisticsDto: PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
 
         /// <summary>
         /// 部门code
@@ -42,8 +42,8 @@ namespace Hotline.Share.Dtos.JudicialManagement
     /// </summary>
     public record QueryRegionalClassificationStatisticsDto : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
 
         /// <summary>
         /// 区域code
@@ -71,8 +71,8 @@ namespace Hotline.Share.Dtos.JudicialManagement
     /// </summary>
     public record QueryOrgSatisfactionStatisticsDto : PagedRequest
     {
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
+        public DateTime StartTime { get; set; }
+        public DateTime EndTime { get; set; }
 
         /// <summary>
         /// 部门code

+ 161 - 0
src/Hotline.Share/Dtos/Order/OrderBiDto.cs

@@ -861,4 +861,165 @@ namespace Hotline.Share.Dtos.Order
 		public int? Iyb { get; set; }
 	}
 
+
+    public class QueryTempDto
+    {
+        /// <summary>
+        /// 信件状态
+        /// </summary>
+        public EOrderStatus Status { get; set; }
+
+        /// <summary>
+        /// 是否超期
+        /// </summary>
+        public string IsOverTime { get; set; }
+
+        /// <summary>
+        /// 来源
+        /// </summary>
+        public string Source { get; set; }
+
+        /// <summary>
+        /// 转接来源
+        /// </summary>
+        public string TransferPhone { get; set; }
+
+        /// <summary>
+        /// 当前节点
+        /// </summary>
+        public string ActualHandleStepName { get; set; }
+
+        /// <summary>
+        /// 重办次数
+        /// </summary>
+        public int? ReTransactNum { get; set; }
+
+        /// <summary>
+        /// 甄别状态
+        /// </summary>
+        public string? OrderScreenStatus { get; set; }
+
+        /// <summary>
+        /// 受理编号
+        /// </summary>
+        public string? No { get; set; }
+
+        /// <summary>
+        /// 省编号
+        /// </summary>
+        public string? ProvinceNo { get; set; }
+
+        /// <summary>
+        /// 受理时间
+        /// </summary>
+        public DateTime? StartTime { get; set; }
+
+        /// <summary>
+        /// 标题
+        /// </summary>
+        public string Title { get; set; }
+
+        /// <summary>
+        /// 超期时间(期满时间)
+        /// </summary>
+        public DateTime? ExpiredTime { get; set; }
+
+        /// <summary>
+        /// 一级部门
+        /// </summary>
+        public string? OrgLevelOneName { get; set; }
+
+        /// <summary>
+        /// 二级部门
+        /// </summary>
+        public string? OrgLevelTwoName { get; set; }
+
+        /// <summary>
+        /// 受理人部门名称
+        /// </summary>
+        public string? AcceptorOrgName { get; set; }
+
+        /// <summary>
+        /// 归档时间(暂为流程结束时间,因流程结束自动归档)
+        /// </summary>
+        public DateTime? FiledTime { get; set; }
+
+        /// <summary>
+        /// 受理类型
+        /// </summary>
+        public string? AcceptType { get; set; }
+
+        /// <summary>
+        /// 热点全称
+        /// </summary>
+        public string? HotspotSpliceName { get; set; }
+
+        /// <summary>
+        /// 区域全称
+        /// </summary>
+        public string? FullAddress { get; set; }
+
+        /// <summary>
+        /// 受理人名称
+        /// </summary>
+        public string? AcceptorName { get; set; }
+
+        /// <summary>
+        /// 来电/信人姓名
+        /// </summary>
+        public string? FromName { get; set; }
+
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        public string? Contact { get; set; }
+
+        /// <summary>
+        /// 来电号码
+        /// </summary>
+        public string? FromPhone { get; set; }
+
+        /// <summary>
+        /// 来电/信人身份
+        /// </summary>
+        public EIdentityType? IdentityType { get; set; }
+
+        /// <summary>
+        /// 来电/信人性别
+        /// </summary>
+        public EGender FromGender { get; set; }
+
+        /// <summary>
+        /// 第一次评价结果
+        /// </summary>
+        public string? FirstVisitResult { get; set; }
+
+        /// <summary>
+        /// 推送分类
+        /// </summary>
+        public string? PushType { get; set; }
+
+
+        /// <summary>
+        /// 诉求内容
+        /// </summary>
+        public string Content { get; set; }
+
+        /// <summary>
+        /// 实际办理意见
+        /// </summary>
+        public string ActualOpinion { get; set; }
+
+        /// <summary>
+        /// 归档意见
+        /// </summary>
+        public string? FileOpinion { get; set; }
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public DateTime CreationTime { get; set; }
+
+
+    }
 }

+ 4 - 0
src/Hotline.Share/Dtos/Realtime/SeatStateDto.cs

@@ -4,4 +4,8 @@ public class SeatStateDto
 {
     public string TelNo { get; set; }
     public string State { get; set; }
+
+    public string WorkUserId { get; set; }
+
+    public string WorkUserName { get; set; }
 }

+ 2 - 2
src/Hotline.Share/Requests/DepartmentKeyWordRequest.cs

@@ -5,12 +5,12 @@
         /// <summary>
         /// 开始时间
         /// </summary>
-        public DateTime StartDate { get; set; }
+        public DateTime StartTime { get; set; }
 
         /// <summary>
         /// 结束时间
         /// </summary>
-        public DateTime EndDate { get; set; }
+        public DateTime EndTime { get; set; }
 
         /// <summary>
         /// 部门编码

+ 2 - 2
src/Hotline.Share/Requests/DepartmentalProcessingStatisticsDto.cs

@@ -219,12 +219,12 @@ namespace Hotline.Share.Requests
         /// <summary>
         /// 开始日期
         /// </summary>
-        public DateTime StartDate { get; set; }
+        public DateTime StartTime { get; set; }
 
         /// <summary>
         /// 结束日期
         /// </summary>
-        public DateTime EndDate { get; set; }
+        public DateTime EndTime { get; set; }
 
         /// <summary>
         /// 部门Code

+ 2 - 2
src/Hotline.Share/Requests/HighFrequencyCallStatisticsListRequest.cs

@@ -7,11 +7,11 @@ namespace Hotline.Share.Requests
         /// <summary>
         /// 查询时间段--开始
         /// </summary>
-        public DateTime? StartDate { get; set; }
+        public DateTime? StartTime { get; set; }
 
         /// <summary>
         /// 查询时间段--结束
         /// </summary>
-        public DateTime? EndDate { get; set; }
+        public DateTime? EndTime { get; set; }
     }
 }

+ 2 - 2
src/Hotline/FlowEngine/Workflows/IWorkflowDomainService.cs

@@ -122,9 +122,9 @@ namespace Hotline.FlowEngine.Workflows
         Task<WorkflowStep?> FindLastStepAsync(string workflowId, CancellationToken cancellationToken);
 
         /// <summary>
-        /// 查询待回访部门
+        /// 查询所有办理部门及实际办理部门
         /// </summary>
-        Task<(Kv, IReadOnlyList<Kv>)> GetUnvisitOrgsAsync(string workflowId, CancellationToken cancellationToken);
+        Task<(Kv, IReadOnlyList<Kv>)> GetHandleOrgsAsync(string workflowId, CancellationToken cancellationToken);
 
         /// <summary>
         /// 依据配置过滤下一节点

+ 4 - 5
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -1224,15 +1224,14 @@ namespace Hotline.FlowEngine.Workflows
         }
 
         /// <summary>
-        /// 查询待回访部门
+        /// 查询所有办理部门及实际办理部门
         /// </summary>
         /// <returns></returns>
-        public async Task<(Kv, IReadOnlyList<Kv>)> GetUnvisitOrgsAsync(string workflowId,
-            CancellationToken cancellationToken)
+        public async Task<(Kv, IReadOnlyList<Kv>)> GetHandleOrgsAsync(string workflowId, CancellationToken cancellationToken)
         {
             var workflow = await GetWorkflowAsync(workflowId, withSteps: true, cancellationToken: cancellationToken);
-            if (workflow.CounterSignType is not ECounterSignType.Center)
-                return new(new Kv(workflow.ActualHandleOrgCode, workflow.ActualHandleOrgName), new List<Kv>());
+            //if (workflow.CounterSignType is not ECounterSignType.Center)
+            //    return new(new Kv(workflow.ActualHandleOrgCode, workflow.ActualHandleOrgName), new List<Kv>());
             var steps = workflow.Steps
                 .Where(d => d.StepType is EStepType.Normal)
                 .ToList();

+ 45 - 1
src/Hotline/Orders/Order.cs

@@ -340,6 +340,26 @@ namespace Hotline.Orders
         /// </summary>
         public double? HandleDurationWorkday { get; set; }
 
+        /// <summary>
+        /// 办结时长(秒) 办结时间-受理时间(工单创建时间)
+        /// </summary>
+        public double? CreationTimeHandleDuration { get; set; }
+
+        /// <summary>
+        /// 办结工作日时长(秒)办结时间-受理时间(工单创建时间)
+        /// </summary>
+        public double? CreationTimeHandleDurationWorkday { get; set; }
+
+        /// <summary>
+        /// 办结时长(秒) 办结时间-派单时间(中心到部门时间)
+        /// </summary>
+        public double? CenterToOrgHandleDuration { get; set; }
+
+        /// <summary>
+        /// 办结工作日时长(秒)办结时间-派单时间(中心到部门时间)
+        /// </summary>
+        public double? CenterToOrgHandleDurationWorkday { get; set; }
+
         /// <summary>
         /// 归档时长(秒)
         /// 归档时间-交办时间
@@ -893,7 +913,8 @@ namespace Hotline.Orders
         /// <summary>
         /// 归档
         /// </summary>
-        public void File(DateTime filedTime, double handleDurationWorkday, double fileDurationWorkday, double allDurationWorkday)
+        public void File(DateTime filedTime, double handleDurationWorkday, double fileDurationWorkday, double allDurationWorkday
+            , double creationTimeHandleDurationWorkday, double centerToOrgHandleDurationWorkday)
         {
             if (Status is EOrderStatus.Filed) return;
             Status = EOrderStatus.Filed;
@@ -901,11 +922,15 @@ namespace Hotline.Orders
             HandleDurationWorkday = handleDurationWorkday;
             FileDurationWorkday = fileDurationWorkday;
             AllDurationWorkday = allDurationWorkday;
+            CreationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday;
+            CenterToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday;
 
             //计算实际办结时长
             SetHandleDuration();
             SetFileDuration();
             SetAllDuration();
+            SetCreationTimeHandleDurationWorkday();
+            SetCenterToOrgHandleDurationWorkday();
         }
 
         /// <summary>
@@ -1002,6 +1027,25 @@ namespace Hotline.Orders
             FileDuration = Math.Round((FiledTime - CenterToOrgTime).Value.TotalSeconds);
         }
 
+        /// <summary>
+        ///  办结时长(秒) 办结时间-受理时间(工单创建时间)
+        /// </summary>
+        public void SetCreationTimeHandleDurationWorkday()
+        {
+            if (!ActualHandleTime.HasValue) return;
+            FileDuration = Math.Round((ActualHandleTime - CreationTime).Value.TotalSeconds);
+        }
+
+        /// <summary>
+        ///  办结时长(秒) 办结时间-派单时间(工单创建时间)
+        /// </summary>
+        public void SetCenterToOrgHandleDurationWorkday()
+        {
+            if (!ActualHandleTime.HasValue) return;
+            if (!CenterToOrgTime.HasValue) return;
+            FileDuration = Math.Round((ActualHandleTime - CenterToOrgTime).Value.TotalSeconds);
+        }
+
         /// <summary>
         /// 是否已签收
         /// </summary>

+ 1 - 1
src/Hotline/Settings/TimeLimits/TimeLimitDomainService.cs

@@ -273,7 +273,7 @@ namespace Hotline.Settings.TimeLimits
                         minutes = minutes - 1440;
                     }
                 }
-                return minutes;
+                return minutes==0 ? 1: minutes*60;
             }
             else
             {