Ver Fonte

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

xf há 1 mês atrás
pai
commit
8503f603b1

+ 23 - 3
src/Hotline.Api/Controllers/OrderController.cs

@@ -2972,11 +2972,31 @@ public class OrderController : BaseController
     }
 
     /// <summary>
-    /// 获取工单甄别所有文件
+    /// 更新甄别信息
     /// </summary>
-    /// <param name="id"></param>
+    /// <param name="dto"></param>
     /// <returns></returns>
-    [HttpGet("screen/all_file/{id}")]
+	[HttpPut("order_screen_alter")]
+	[LogFilter("更新甄别信息")]
+	public async Task Update([FromBody] OrderScreenAlterDto dto)
+	{
+        var screen = await _orderScreenRepository.GetAsync(dto.ScreenId);
+		var FileJson = new List<Share.Dtos.File.FileJson>();
+        if (dto.Files.Any())
+            FileJson = await _fileRepository.AddFileAsync(dto.Files, dto.ScreenId, "", HttpContext.RequestAborted);
+        else
+            FileJson = screen.FileJson;
+        dto.Content = string.IsNullOrEmpty(dto.Content) ? screen.Content : dto.Content;
+		await _orderScreenRepository.Updateable().SetColumns(x => new OrderScreen { Content = dto.Content,FileJson = FileJson })
+			.Where(x => x.Id == dto.ScreenId).ExecuteCommandAsync();
+	}
+
+	/// <summary>
+	/// 获取工单甄别所有文件
+	/// </summary>
+	/// <param name="id"></param>
+	/// <returns></returns>
+	[HttpGet("screen/all_file/{id}")]
     public async Task<List<FileDto>> GetOrderScreenAllFile(string id)
     {
         var screen = await _orderScreenRepository.GetAsync(id);

+ 76 - 31
src/Hotline.Api/Controllers/TestController.cs

@@ -51,6 +51,7 @@ using Microsoft.Extensions.Options;
 using MiniExcelLibs;
 using NETCore.Encrypt;
 using SqlSugar;
+using System.Threading;
 using XC.RSAUtil;
 using XF.Domain.Authentications;
 using XF.Domain.Cache;
@@ -70,11 +71,9 @@ namespace Hotline.Api.Controllers;
 public class TestController : BaseController
 {
     private readonly ILogger<TestController> _logger;
-    //private readonly IAuthorizeGenerator _authorizeGenerator;
     private readonly IOptionsSnapshot<CallCenterConfiguration> _options;
     private readonly ISessionContext _sessionContext;
     private readonly IRepository<User> _userRepository;
-
     private readonly ITypedCache<User> _cache;
     private readonly IRealtimeService _realtimeService;
     private readonly IBlacklistDomainService _blacklistDomainService;
@@ -82,25 +81,18 @@ public class TestController : BaseController
     private readonly ISugarUnitOfWork<HotlineDbContext> _uow;
     private readonly IRepository<Identity.Roles.Role> _roleRepository;
     private readonly IMediator _mediator;
-
     private readonly IDistributedLock _distributedLock;
     private readonly IRepository<OrderUrge> _orderUrgeRepository;
     private readonly IRepositoryTextSearch<OrderTs> _repositoryts;
-
     private readonly ITimeLimitDomainService _timeLimitDomainService;
     private readonly IWfModuleDomainService _wfModuleDomainService;
     private readonly IDaySettingRepository _daySettingRepository;
-    //private readonly ITrClient _trClient;
     private readonly ICapPublisher _capPublisher;
     private readonly IQueue _queue;
     private readonly IExportApplication _exportApplication;
     private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
-
     private readonly IRepository<WorkflowStep> _workflowStepRepository;
-
     private readonly IWorkflowRepository _workflowRepository;
-    //private readonly IRepository<WorkflowStepHandler> _workflowStepHandleRepository;
-
     private readonly IRepository<SystemOrganize> _systemOrganizeRepository;
     private readonly IOrderRepository _orderRepository;
     private readonly IRepository<TrCallRecord> _trCallRecordRepository;
@@ -113,7 +105,6 @@ public class TestController : BaseController
     private readonly IRepository<JudicialManagementOrders> _judicialManagementOrdersRepository;
     private readonly IRepository<EnforcementOrdersHandler> _enforcementOrdersHandlerRepository;
     private readonly IWorkflowApplication _workflowApplication;
-
     private readonly IRepository<ContingencyManagementHotspot> _contingencyManagementHotspotRepository;
     private readonly IRepository<Hotspot> _hotspotRepository;
     private readonly IOrderApplication _orderApplication;
@@ -121,10 +112,7 @@ public class TestController : BaseController
     private readonly IOrderDomainService _orderDomainService;
     private readonly ICallApplication _callApplication;
     private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
-
     private readonly ISystemSettingCacheManager _systemSettingCacheManager;
-    //private readonly ITypedCache<List<User>> _cache;
-    //private readonly ICacheManager<User> _cache;
     private readonly ICalcExpireTime _expireTime;
     private readonly ICallNativeRepository _callNativeRepository;
     private readonly IRepository<OldSendProData> _oldSendProDataRepository;
@@ -133,6 +121,7 @@ public class TestController : BaseController
     private readonly IThirdIdentiyService _thirdIdentiyService;
     private readonly IServiceProvider _serviceProvider;
     private readonly IRepository<OrderDelay> _orderDelayRepository;
+    private readonly IRepository<OrderSecondaryHandling> _orderSecondaryHandlingRepository;
 
 
     public TestController(
@@ -157,14 +146,12 @@ public class TestController : BaseController
         ITimeLimitDomainService timeLimitDomainService,
         IWfModuleDomainService wfModuleDomainService,
         IDaySettingRepository daySettingRepository,
-        //ITrClient trClient,
         ICapPublisher capPublisher,
         IQueue queue,
         IExportApplication exportApplication,
         IRepository<WorkflowTrace> workflowTraceRepository,
         IRepository<WorkflowStep> workflowStepRepository,
         IWorkflowRepository workflowRepository,
-        //IRepository<WorkflowStepHandler> workflowStepHandleRepository,
         IRepository<SystemOrganize> systemOrganizeRepository,
         IOrderRepository orderRepository,
         IRepository<TrCallRecord> trCallRecordRepository,
@@ -174,14 +161,14 @@ public class TestController : BaseController
         IMapper mapper,
         IOrderApplication orderApplication,
         IRepository<Tel> telRepository,
-   IOrderReportApplication orderReportApplication,
-IRepository<EnforcementOrders> enforcementOrdersRepository,
-IRepository<JudicialManagementOrders> judicialManagementOrdersRepository,
-IRepository<EnforcementOrdersHandler> enforcementOrdersHandlerRepository,
-IRepository<ContingencyManagementHotspot> contingencyManagementHotspotRepository,
-IRepository<Hotspot> hotspotRepository,
-IOrderDomainService orderDomainService,
-ICallApplication callApplication,
+        IOrderReportApplication orderReportApplication,
+        IRepository<EnforcementOrders> enforcementOrdersRepository,
+        IRepository<JudicialManagementOrders> judicialManagementOrdersRepository,
+        IRepository<EnforcementOrdersHandler> enforcementOrdersHandlerRepository,
+        IRepository<ContingencyManagementHotspot> contingencyManagementHotspotRepository,
+        IRepository<Hotspot> hotspotRepository,
+        IOrderDomainService orderDomainService,
+        ICallApplication callApplication,
         IOptionsSnapshot<AppConfiguration> appOptions,
         ISystemSettingCacheManager systemSettingCacheManager,
         ICalcExpireTime expireTime,
@@ -191,11 +178,11 @@ ICallApplication callApplication,
         IThirdIdentiyService thirdIdentiyService,
         IOrderScreenRepository orderScreenRepository,
         IRepository<OrderVisit> orderVisitRepository,
-        IServiceProvider serviceProvider
+        IServiceProvider serviceProvider,
+        IRepository<OrderSecondaryHandling> orderSecondaryHandlingRepository
         )
     {
         _logger = logger;
-        //_authorizeGenerator = authorizeGenerator;
         _options = options;
         _sessionContext = sessionContext;
         _userRepository = userRepository;
@@ -212,14 +199,12 @@ ICallApplication callApplication,
         _timeLimitDomainService = timeLimitDomainService;
         _wfModuleDomainService = wfModuleDomainService;
         _daySettingRepository = daySettingRepository;
-        //_trClient = trClient;
         _capPublisher = capPublisher;
         _queue = queue;
         _exportApplication = exportApplication;
         _workflowTraceRepository = workflowTraceRepository;
         _workflowStepRepository = workflowStepRepository;
         _workflowRepository = workflowRepository;
-        //_workflowStepHandleRepository = workflowStepHandleRepository;
         _systemOrganizeRepository = systemOrganizeRepository;
         _orderRepository = orderRepository;
         _trCallRecordRepository = trCallRecordRepository;
@@ -247,6 +232,7 @@ ICallApplication callApplication,
         _orderVisitRepository = orderVisitRepository;
         _serviceProvider = serviceProvider;
         _orderDelayRepository = orderDelayRepository;
+        _orderSecondaryHandlingRepository = orderSecondaryHandlingRepository;
     }
 
     /// <summary>
@@ -259,7 +245,7 @@ ICallApplication callApplication,
     {
         var order = await _orderRepository.Queryable().Includes(d => d.Workflow).FirstAsync(d => d.ReceiveProvinceNo == "");
 
-        var order1 = await _orderRepository.Queryable().Includes(d => d.Workflow).FirstAsync(d => d.ReceiveProvinceNo =="20202020202020");
+        var order1 = await _orderRepository.Queryable().Includes(d => d.Workflow).FirstAsync(d => d.ReceiveProvinceNo == "20202020202020");
         var order2 = await _orderRepository.Queryable().Includes(d => d.Workflow).FirstAsync(d => d.ReceiveProvinceNo == "ZMHD995100002024111101317");
 
         var inDto = new ThirdTokenDto
@@ -550,7 +536,7 @@ ICallApplication callApplication,
         //var query = _userRepository.Queryable().Where(x => false);
         //await _capPublisher.PublishDelay(EventNames.OrderRelateCall, "123", cancellationToken: HttpContext.RequestAborted);
         var times = await _expireTime.CalcWorkTimeEx(
-                       DateTime.Parse("2025-02-21 16:00:11.154098"),DateTime.Parse("2025-02-28 11:27:11.441577"),false);
+                       DateTime.Parse("2025-02-21 16:00:11.154098"), DateTime.Parse("2025-02-28 11:27:11.441577"), false);
         return OpenResponse.Ok(times);
     }
 
@@ -1250,7 +1236,38 @@ ICallApplication callApplication,
             creationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday <= 0 ? 10 : creationTimeHandleDurationWorkday;
             centerToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday <= 0 ? 10 : centerToOrgHandleDurationWorkday;
 
-            order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
+            double? secondaryHandlingDurationWorkday = null;
+            DateTime? secondaryHandlingAuditTime = null;
+
+            //计算二次办理时长
+            if (_appOptions.Value.IsZiGong)
+            {
+
+                //查询是否有二次办理申请通过的
+                var orderSecondaryData = await _orderSecondaryHandlingRepository.GetAsync(p => p.OrderId == order.Id &&
+                  p.IsHandel == false && p.State == ESecondaryHandlingState.End, HttpContext.RequestAborted);
+                if (orderSecondaryData != null)
+                {
+                    orderSecondaryData.IsHandel = true;
+                    await _orderSecondaryHandlingRepository.UpdateAsync(orderSecondaryData, HttpContext.RequestAborted);
+                    if (orderSecondaryData.AuditTime.HasValue)
+                    {
+                        secondaryHandlingAuditTime = orderSecondaryData.AuditTime;
+                        secondaryHandlingDurationWorkday = orderSecondaryData.AuditTime.HasValue
+                            ?
+                            await _expireTime.CalcWorkTimeEx(
+                                orderSecondaryData.AuditTime.Value, now,
+                            false)
+                            : null;
+                    }
+                }
+                //处理办理时长
+            }
+
+            order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday,
+                secondaryHandlingDurationWorkday, secondaryHandlingAuditTime);
+
+            // order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday, null, null);
 
         }
 
@@ -1336,8 +1353,36 @@ ICallApplication callApplication,
                 : 0;
             creationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday <= 0 ? 10 : creationTimeHandleDurationWorkday;
             centerToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday <= 0 ? 10 : centerToOrgHandleDurationWorkday;
+            double? secondaryHandlingDurationWorkday = null;
+            DateTime? secondaryHandlingAuditTime = null;
+
+            //计算二次办理时长
+            if (_appOptions.Value.IsZiGong)
+            {
+
+                //查询是否有二次办理申请通过的
+                var orderSecondaryData = await _orderSecondaryHandlingRepository.GetAsync(p => p.OrderId == order.Id &&
+                  p.IsHandel == false && p.State == ESecondaryHandlingState.End, HttpContext.RequestAborted);
+                if (orderSecondaryData != null)
+                {
+                    orderSecondaryData.IsHandel = true;
+                    await _orderSecondaryHandlingRepository.UpdateAsync(orderSecondaryData, HttpContext.RequestAborted);
+                    if (orderSecondaryData.AuditTime.HasValue)
+                    {
+                        secondaryHandlingAuditTime = orderSecondaryData.AuditTime;
+                        secondaryHandlingDurationWorkday = orderSecondaryData.AuditTime.HasValue
+                            ?
+                            await _expireTime.CalcWorkTimeEx(
+                                orderSecondaryData.AuditTime.Value, now,
+                            false)
+                            : null;
+                    }
+                }
+                //处理办理时长
+            }
 
-            order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
+            order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday,
+                secondaryHandlingDurationWorkday, secondaryHandlingAuditTime);
             order.FileUserId = notification.HandlerId;
             order.FileUserName = notification.HandlerName;
             order.FileUserOrgId = notification.HandlerOrgId;

+ 34 - 8
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -1,6 +1,5 @@
 using DotNetCore.CAP;
 using Hotline.Application.CallCenter;
-using Hotline.Application.JudicialManagement;
 using Hotline.Application.Orders;
 using Hotline.Caching.Interfaces;
 using Hotline.CallCenter.Tels;
@@ -11,10 +10,8 @@ using Hotline.FlowEngine.WorkflowModules;
 using Hotline.JudicialManagement.Notifies;
 using Hotline.KnowledgeBase;
 using Hotline.Orders;
-using Hotline.SeedData;
 using Hotline.Settings;
 using Hotline.Settings.TimeLimitDomain;
-using Hotline.Settings.TimeLimits;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.TrCallCenter;
@@ -42,7 +39,6 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
     private readonly ICapPublisher _capPublisher;
     private readonly IMapper _mapper;
     private readonly IRepository<OrderDelay> _orderDelayRepository;
-    // private readonly ITimeLimitDomainService _timeLimitDomainService;
     private readonly ILogger<WorkflowEndHandler> _logger;
     private readonly IKnowledgeRepository _knowledgeRepository;
     private readonly ICallApplication _callApplication;
@@ -51,6 +47,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
     private readonly Publisher _publisher;
     private readonly ICalcExpireTime _expireTime;
     private readonly IRepository<OrderTerminate> _orderTerminateRepository;
+    private readonly IRepository<OrderSecondaryHandling> _orderSecondaryHandlingRepository;
 
     public WorkflowEndHandler(
         IMapper mapper,
@@ -62,14 +59,14 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
         IKnowledgeRepository knowledgeRepository,
         IRepository<OrderDelay> orderDelayRepository,
         ICapPublisher capPublisher,
-        // ITimeLimitDomainService timeLimitDomainService,
         ICallApplication callApplication,
         IOptionsSnapshot<AppConfiguration> appOptions,
         ISystemSettingCacheManager systemSettingCacheManager,
         Publisher publisher,
         ILogger<WorkflowEndHandler> logger,
         ICalcExpireTime expireTime,
-        IRepository<OrderTerminate> orderTerminateRepository)
+        IRepository<OrderTerminate> orderTerminateRepository,
+        IRepository<OrderSecondaryHandling> orderSecondaryHandlingRepository)
     {
         _mapper = mapper;
         _knowledgeDomainService = knowledgeDomainService;
@@ -80,7 +77,6 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
         _knowledgeRepository = knowledgeRepository;
         _orderDelayRepository = orderDelayRepository;
         _capPublisher = capPublisher;
-        //_timeLimitDomainService = timeLimitDomainService;
         _callApplication = callApplication;
         _appOptions = appOptions;
         _systemSettingCacheManager = systemSettingCacheManager;
@@ -88,6 +84,7 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
         _logger = logger;
         _expireTime = expireTime;
         _orderTerminateRepository = orderTerminateRepository;
+        _orderSecondaryHandlingRepository = orderSecondaryHandlingRepository;
     }
 
     /// <summary>Handles a notification</summary>
@@ -164,7 +161,36 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                     creationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday <= 0 ? 10 : creationTimeHandleDurationWorkday;
                     centerToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday <= 0 ? 10 : centerToOrgHandleDurationWorkday;
 
-                    order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
+                    double? secondaryHandlingDurationWorkday = null;
+                    DateTime? secondaryHandlingAuditTime = null;
+
+                    //计算二次办理时长
+                    if (_appOptions.Value.IsZiGong)
+                    {
+
+                        //查询是否有二次办理申请通过的
+                        var orderSecondaryData = await _orderSecondaryHandlingRepository.GetAsync(p => p.OrderId == order.Id &&
+                          p.IsHandel == false && p.State == ESecondaryHandlingState.End, cancellationToken);
+                        if (orderSecondaryData != null)
+                        {
+                            //处理办理时长
+                            orderSecondaryData.IsHandel = true;
+                            await _orderSecondaryHandlingRepository.UpdateAsync(orderSecondaryData, cancellationToken);
+                            if (orderSecondaryData.AuditTime.HasValue)
+                            {
+                                secondaryHandlingAuditTime = orderSecondaryData.AuditTime;
+                                secondaryHandlingDurationWorkday = orderSecondaryData.AuditTime.HasValue
+                                    ?
+                                    await _expireTime.CalcWorkTimeEx(
+                                        orderSecondaryData.AuditTime.Value, now,
+                                    false)
+                                    : null;
+                            }
+                        }
+                    }
+
+                    order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday,
+                        secondaryHandlingDurationWorkday, secondaryHandlingAuditTime);
                     order.FileUserId = notification.Trace.HandlerId;
                     order.FileUserName = notification.Trace.HandlerName;
                     order.FileUserOrgId = notification.Trace.HandlerOrgId;

+ 1 - 1
src/Hotline.Application/Orders/OrderApplication.cs

@@ -350,7 +350,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
         creationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday <= 0 ? 10 : creationTimeHandleDurationWorkday;
         centerToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday <= 0 ? 10 : centerToOrgHandleDurationWorkday;
 
-        order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday);
+        order.File(now, handleDuration, fileDuration, allDuration, creationTimeHandleDurationWorkday, centerToOrgHandleDurationWorkday, null, null);
         await _orderRepository.UpdateAsync(order, cancellationToken);
     }
 

+ 1 - 0
src/Hotline.Application/Orders/OrderSecondaryHandlingApplication.cs

@@ -168,6 +168,7 @@ namespace Hotline.Application.Orders
             model.AuditId = _sessionContext.UserId;
             model.AuditUser = _sessionContext.UserName;
             model.AuditTime = DateTime.Now;
+            model.IsHandel = false;
             var visit = await _orderVisitRepository.GetAsync(x => x.OrderId == model.OrderId && x.VisitState == EVisitState.Visited, cancellationToken);
             if (model.State == ESecondaryHandlingState.End)
             {

+ 20 - 0
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -1051,6 +1051,26 @@ namespace Hotline.Share.Dtos.Order
         #endregion
 
         public bool? IsReTransact { get; set; }
+
+        /// <summary>
+        /// 重办时长,最新二次办理审批通过后的归档时间-最新二次办理审批通过时间(秒)
+        /// </summary>
+        public double? SecondaryHandlingDuration { get; set; }
+
+        public double? SecondaryHandlingDurationWorkday { get; set; }
+        public string? SecondaryHandlingDurationWorkdayDayText => SecondaryHandlingDurationDay();
+
+        public string SecondaryHandlingDurationDay()
+        {
+            var overDays = "";
+            if (SecondaryHandlingDurationWorkday.HasValue && SecondaryHandlingDurationWorkday.Value > 0)
+            {
+                var totalDays = Math.Round(((double)SecondaryHandlingDurationWorkday / 3600 / 8), 2);
+                overDays = totalDays > 0 ? totalDays + "" : "0.01";
+            }
+
+            return overDays;
+        }
     }
 
 

+ 19 - 0
src/Hotline.Share/Dtos/Order/OrderScreenDto.cs

@@ -370,6 +370,25 @@ namespace Hotline.Share.Dtos.Order
         public DateTime ScreenByEndTime { get; set; }
     }
 
+    public class OrderScreenAlterDto { 
+    
+        /// <summary>
+        /// 甄别Id
+        /// </summary>
+        public string ScreenId { get; set; }
+
+
+		/// <summary>
+		/// 甄别申请原因
+		/// </summary>
+		public string? Content { get; set; }
+
+        /// <summary>
+        /// 附件
+        /// </summary>
+		public List<FileDto> Files { get; set; }
+	}
+
     public enum EOrderScreenType
     {
         /// <summary>

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

@@ -464,6 +464,15 @@ namespace Hotline.Orders
         [SugarColumn(ColumnDescription = "归档工作时长")]
         public double? FileDurationWorkday { get; set; }
 
+        /// <summary>
+        /// 重办时长,最新二次办理审批通过后的归档时间-最新二次办理审批通过时间(秒)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "重办时长,最新二次办理审批通过后的归档时间-最新二次办理审批通过时间(秒)")]
+        public double? SecondaryHandlingDuration { get; set; }
+
+        [SugarColumn(ColumnDescription = "重办时长工作日时长")]
+        public double? SecondaryHandlingDurationWorkday { get; set; }
+
         /// <summary>
         /// 全流程时长(秒)
         /// </summary>
@@ -1261,7 +1270,8 @@ namespace Hotline.Orders
         /// 归档
         /// </summary>
         public void File(DateTime filedTime, double handleDurationWorkday, double fileDurationWorkday, double allDurationWorkday
-            , double creationTimeHandleDurationWorkday, double centerToOrgHandleDurationWorkday)
+            , double creationTimeHandleDurationWorkday, double centerToOrgHandleDurationWorkday, double? secondaryHandlingDurationWorkday,
+            DateTime? secondaryHandlingAuditTime)
         {
             if (Status is EOrderStatus.Filed) return;
             Status = EOrderStatus.Filed;
@@ -1271,6 +1281,7 @@ namespace Hotline.Orders
             AllDurationWorkday = allDurationWorkday;
             CreationTimeHandleDurationWorkday = creationTimeHandleDurationWorkday;
             CenterToOrgHandleDurationWorkday = centerToOrgHandleDurationWorkday;
+            SecondaryHandlingDurationWorkday = secondaryHandlingDurationWorkday;
 
             //计算实际办结时长
             SetHandleDuration();
@@ -1278,6 +1289,7 @@ namespace Hotline.Orders
             SetAllDuration();
             SetCreationTimeHandleDurationWorkday();
             SetCenterToOrgHandleDurationWorkday();
+            SetSecondaryHandlingDuration(secondaryHandlingAuditTime);
         }
 
         /// <summary>
@@ -1396,6 +1408,18 @@ namespace Hotline.Orders
             FileDuration = Math.Round((FiledTime - CenterToOrgTime).Value.TotalSeconds);
         }
 
+        /// <summary>
+        /// 自贡 任务 390【标】综合查询增加“重办时长”数据列
+        /// </summary>
+        /// <param name="SecondaryHandlingAuditTime"></param>
+        public void SetSecondaryHandlingDuration(DateTime? SecondaryHandlingAuditTime)
+        {
+            if (!FiledTime.HasValue || !SecondaryHandlingAuditTime.HasValue)
+                SecondaryHandlingDuration = null;
+            else
+                SecondaryHandlingDuration = Math.Round((FiledTime - SecondaryHandlingAuditTime).Value.TotalSeconds);
+        }
+
         /// <summary>
         /// 办结时长(秒) 归档时间-受理时间(工单创建时间)
         /// </summary>

+ 109 - 104
src/Hotline/Orders/OrderSecondaryHandling.cs

@@ -11,108 +11,113 @@ using XF.Domain.Repository;
 
 namespace Hotline.Orders
 {
-	[Description("二次办理")]
-	public class OrderSecondaryHandling : FullStateEntity
-	{
-		/// <summary>
-		/// 工单ID
-		/// </summary>
-		[SugarColumn(ColumnDescription = "工单ID")]
-		public string OrderId { get; set; }
-
-
-		/// <summary>
-		/// 回访id
-		/// </summary>
-		[SugarColumn(ColumnDescription = "回访id")]
-		public string VisitId { get; set; }
-
-		/// <summary>
-		/// 回访明细id
-		/// </summary>
-		[SugarColumn(ColumnDescription = "回访明细id")]
-		public string VisitDetailId { get; set; }
-
-		/// <summary>
-		/// 状态
-		/// </summary>
-		[SugarColumn(ColumnDescription = "状态")]
-		public ESecondaryHandlingState? State { get; set; }
-
-		/// <summary>
-		/// 重提办理
-		/// </summary>
-		public int? SendBackNum { get; set; }
-
-		/// <summary>
-		/// 申请理由
-		/// </summary>
-		[SugarColumn(ColumnDescription = "申请理由", ColumnDataType = "text")]
-		public string? Content { get; set; }
-
-		/// <summary>
-		/// 退回意见
-		/// </summary>
-		[SugarColumn(ColumnDescription = "退回意见", ColumnDataType = "text")]
-		public string? SendBackContent { get; set; }
-
-		/// <summary>
-		/// 审批意见
-		/// </summary>
-		[SugarColumn(ColumnDescription = "审批意见", ColumnDataType = "text")]
-		public string? AuditContent { get; set; }
-
-		/// <summary>
-		/// 工单
-		/// </summary>
-		[Navigate(NavigateType.OneToOne, nameof(OrderId))]
-		public Order Order { get; set; }
-
-
-		/// <summary>
-		/// 回访
-		/// </summary>
-		[Navigate(NavigateType.OneToOne, nameof(VisitDetailId))]
-		public OrderVisitDetail VisitDetail { get; set; }
-
-		/// <summary>
-		/// 回访
-		/// </summary>
-		[Navigate(NavigateType.OneToOne, nameof(VisitId))]
-		public OrderVisit Visit { get; set; }
-
-		/// <summary>
-		/// 审批人ID
-		/// </summary>
-		[SugarColumn(ColumnDescription = "审批人ID")]
-		public string? AuditId { get; set; }
-
-		[SugarColumn(ColumnDescription = "审批人")]
-		public string? AuditUser { get; set; }
-
-		/// <summary>
-		/// 审批时间
-		/// </summary>
-		public DateTime? AuditTime { get; set; }
-
-		/// <summary>
-		/// 申请部门ID
-		/// </summary>
-		[SugarColumn(ColumnDescription = "申请部门ID")]
-		public string ApplyOrgId { get; set; }
-
-		/// <summary>
-		/// 申请部门名称
-		/// </summary>
-		[SugarColumn(ColumnDescription = "申请部门名称")]
-		public string ApplyOrgName { get; set; }
-
-		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
-		public List<FileJson>? FileJson { get; set; }
-
-		/// <summary>
-		/// 回访状态
-		/// </summary>
-		public EVisitState VisitState { get; set; }
-	}
+    [Description("二次办理")]
+    public class OrderSecondaryHandling : FullStateEntity
+    {
+        /// <summary>
+        /// 工单ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "工单ID")]
+        public string OrderId { get; set; }
+
+
+        /// <summary>
+        /// 回访id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "回访id")]
+        public string VisitId { get; set; }
+
+        /// <summary>
+        /// 回访明细id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "回访明细id")]
+        public string VisitDetailId { get; set; }
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        [SugarColumn(ColumnDescription = "状态")]
+        public ESecondaryHandlingState? State { get; set; }
+
+        /// <summary>
+        /// 重提办理
+        /// </summary>
+        public int? SendBackNum { get; set; }
+
+        /// <summary>
+        /// 申请理由
+        /// </summary>
+        [SugarColumn(ColumnDescription = "申请理由", ColumnDataType = "text")]
+        public string? Content { get; set; }
+
+        /// <summary>
+        /// 退回意见
+        /// </summary>
+        [SugarColumn(ColumnDescription = "退回意见", ColumnDataType = "text")]
+        public string? SendBackContent { get; set; }
+
+        /// <summary>
+        /// 审批意见
+        /// </summary>
+        [SugarColumn(ColumnDescription = "审批意见", ColumnDataType = "text")]
+        public string? AuditContent { get; set; }
+
+        /// <summary>
+        /// 工单
+        /// </summary>
+        [Navigate(NavigateType.OneToOne, nameof(OrderId))]
+        public Order Order { get; set; }
+
+
+        /// <summary>
+        /// 回访
+        /// </summary>
+        [Navigate(NavigateType.OneToOne, nameof(VisitDetailId))]
+        public OrderVisitDetail VisitDetail { get; set; }
+
+        /// <summary>
+        /// 回访
+        /// </summary>
+        [Navigate(NavigateType.OneToOne, nameof(VisitId))]
+        public OrderVisit Visit { get; set; }
+
+        /// <summary>
+        /// 审批人ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "审批人ID")]
+        public string? AuditId { get; set; }
+
+        [SugarColumn(ColumnDescription = "审批人")]
+        public string? AuditUser { get; set; }
+
+        /// <summary>
+        /// 审批时间
+        /// </summary>
+        public DateTime? AuditTime { get; set; }
+
+        /// <summary>
+        /// 申请部门ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "申请部门ID")]
+        public string ApplyOrgId { get; set; }
+
+        /// <summary>
+        /// 申请部门名称
+        /// </summary>
+        [SugarColumn(ColumnDescription = "申请部门名称")]
+        public string ApplyOrgName { get; set; }
+
+        [SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
+        public List<FileJson>? FileJson { get; set; }
+
+        /// <summary>
+        /// 回访状态
+        /// </summary>
+        public EVisitState VisitState { get; set; }
+
+        /// <summary>
+        /// 是否办理完成
+        /// </summary>
+        public bool? IsHandel { get; set; }
+    }
 }