xf 1 year ago
parent
commit
2e65f2a39b

+ 91 - 38
src/DataSharing.Application/Receivers/ProvinceReceiver.cs

@@ -23,7 +23,6 @@ using Hotline.Share.Enums.FlowEngine;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
 using Microsoft.Extensions.Logging;
-using StackExchange.Redis;
 using System.Security.Cryptography;
 using System.Text;
 using XF.Domain.Cache;
@@ -51,6 +50,7 @@ namespace DataSharing.Application.Receivers
         private readonly IRepository<DsOrderVisit> _dsOrderVisitRepository;
         private readonly IRepository<DsGetCaseBackApply> _getCaseBackApplyRepository;
         private readonly ICapPublisher _capPublisher;
+        private readonly IRepository<DsTelCall> _dsTelCallRepository;
 
         /// <summary>
         /// 
@@ -69,6 +69,7 @@ namespace DataSharing.Application.Receivers
         /// <param name="dsOrderVisitRepository"></param>
         /// <param name="getCaseBackApplyRepository"></param>
         /// <param name="capPublisher"></param>
+        /// <param name="dsTelCallRepository"></param>
         public ProvinceReceiver(IMapper mapper, ILogger<ProvinceReceiver> logger,
              IRepository<DsPoliceSendChainAlarmDs> policeSendChainAlarmDsRepository,
              IRepository<DsPoliceSendChainDealDs> policeSendChainDealDsRepository,
@@ -81,7 +82,8 @@ namespace DataSharing.Application.Receivers
              ITypedCache<MissedCallModelDto> missedCallModelCache,
              IRepository<DsOrderVisit> dsOrderVisitRepository,
              IRepository<DsGetCaseBackApply> getCaseBackApplyRepository,
-             ICapPublisher capPublisher)
+             ICapPublisher capPublisher,
+             IRepository<DsTelCall> dsTelCallRepository)
         {
             _mapper = mapper;
             _logger = logger;
@@ -97,6 +99,7 @@ namespace DataSharing.Application.Receivers
             _dsOrderVisitRepository = dsOrderVisitRepository;
             _getCaseBackApplyRepository = getCaseBackApplyRepository;
             _capPublisher = capPublisher;
+            _dsTelCallRepository = dsTelCallRepository;
         }
         #endregion
 
@@ -178,7 +181,7 @@ namespace DataSharing.Application.Receivers
                             #endregion
 
                             //将待推送数据写入待推送表
-                            await InitPushDataAsync("GetCaseBackApply", "get_case_back_apply", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                            await InitPushDataAsync("GetCaseBackApply", "get_case_back_apply", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                             //处理附件
                             await FileDataAsync(dto.SendBack.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken: cancellationToken);
@@ -217,7 +220,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SendSuperviseProcessInfo", "send_supervise_process_info", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SendSuperviseProcessInfo", "send_supervise_process_info", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
             }
         }
 
@@ -249,7 +252,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SendSuperviseResultInfo", "send_supervise_result_info", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SendSuperviseResultInfo", "send_supervise_result_info", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
                 //处理附件
                 await FileDataAsync(dto.Supervise.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Supervise, dto.Order.AreaCode, cancellationToken);
 
@@ -290,7 +293,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("ScreenCaseInfoSend", "screen_case_info_send", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("ScreenCaseInfoSend", "screen_case_info_send", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
                 //处理附件
                 await FileDataAsync(dto.Screen.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken: cancellationToken);
             }
@@ -322,7 +325,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("DelayCaseInfoSend", "delay_case_info_send", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+            await InitPushDataAsync("DelayCaseInfoSend", "delay_case_info_send", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
             //处理附件
             await FileDataAsync(dto.FileJson, data.CaseSerial, data.CliengGuid, EMaterialType.Process, data.AreaCode, cancellationToken);
@@ -343,11 +346,10 @@ namespace DataSharing.Application.Receivers
             var dto = pushdto.Order;
 
             var configProvince = _channelConfigurationManager.GetConfigurationProvince();
-
             //如果不是省上派下来的工单,需要汇聚到省上
             if (dto is not null && !dto.IsProvince)
             {
-                var data = await InitDataAsync(dto, cancellationToken);
+                var data = InitDataAsync(dto);
                 var validator = new SubmitCaseInfoValidator();
                 var validResult = await validator.ValidateAsync(data, cancellationToken);
                 if (!validResult.IsValid)
@@ -361,7 +363,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, GenerationTime: pushdto.Order.StartTime, cancellationToken: cancellationToken);
                 //处理附件
                 await FileDataAsync(dto.FileJson, dto.ProvinceNo, data.CliengGuid, EMaterialType.Acceptance, data.AreaCode, cancellationToken);
             }
@@ -386,7 +388,10 @@ namespace DataSharing.Application.Receivers
                 var jsonDataCall = requestCall.ToString();
                 var urlCall = configProvince.HuiJu + "submit_case_record";
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonDataCall, pathType: EPathType.HuiJu, taskPriority: 20, cancellationToken: cancellationToken);
+                var taskId = await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonDataCall, pathType: EPathType.HuiJu, taskPriority: 20, GenerationTime: pushdto.Order.StartTime, cancellationToken: cancellationToken);
+
+                //本地保存通话记录数据
+                await InitTelCallData(pushdto.TrCallRecordDto, dto.ProvinceNo, taskId, cancellationToken);
                 #endregion
             }
 
@@ -420,6 +425,8 @@ namespace DataSharing.Application.Receivers
                     AllDuration = 0,
                     IsProvince = dto.IsProvince,
                     HandleState = "办理中",
+                    StartTime = dto.StartTime,
+                    CallId = dto.CallId,
                     FileJson = _mapper.Map<List<FileJson>>(dto.FileJson)
                 };
 
@@ -438,7 +445,7 @@ namespace DataSharing.Application.Receivers
             //如果不是省上派下来的工单,需要汇聚到省上
             if (!dto.IsProvince)
             {
-                var data = await InitDataAsync(dto, cancellationToken);
+                var data = InitDataAsync(dto);
                 var validator = new SubmitCaseInfoValidator();
                 var validResult = await validator.ValidateAsync(data, cancellationToken);
                 if (!validResult.IsValid)
@@ -452,7 +459,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, GenerationTime: dto.StartTime, cancellationToken: cancellationToken);
             }
         }
 
@@ -468,7 +475,7 @@ namespace DataSharing.Application.Receivers
             //期满时间变更或者办理节点为话务部,重新推送数据
             if (dto.ExpiredTimeChanged || dto.Order.ActualHandleStepName == "话务部")
             {
-                var submitCaseInfo = await InitDataAsync(dto.Order, cancellationToken);
+                var submitCaseInfo = InitDataAsync(dto.Order);
                 var validator = new SubmitCaseInfoValidator();
                 var validResult = await validator.ValidateAsync(submitCaseInfo, cancellationToken);
                 if (!validResult.IsValid)
@@ -482,7 +489,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonDataSubmitCaseInfo, pathType: EPathType.HuiJu, taskPriority: 10, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonDataSubmitCaseInfo, pathType: EPathType.HuiJu, taskPriority: 10, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
                 //如果话务部派出去,再次上传附件
                 if (dto.Order.ActualHandleStepName == "话务部")
                 {
@@ -526,7 +533,7 @@ namespace DataSharing.Application.Receivers
             SubmitCaseInfo data = new();
             if (dto != null && dto.Order != null && !dto.Order.IsProvince)
             {
-                data = await InitDataAsync(dto.Order, cancellationToken);
+                data = InitDataAsync(dto.Order);
                 var validator = new SubmitCaseInfoValidator();
                 var validResult = await validator.ValidateAsync(data, cancellationToken);
                 if (!validResult.IsValid)
@@ -554,7 +561,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitCaseInfo", "submit_case_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 10, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //推送服务工单结果信息-组装110数据
                 await SubmitCaseResultAsync(dto, cancellationToken);
@@ -580,7 +587,10 @@ namespace DataSharing.Application.Receivers
                 var jsonDataCall = requestCall.ToString();
                 var urlCall = configProvince.HuiJu + "submit_case_record";
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonDataCall, pathType: EPathType.HuiJu, taskPriority: 20, cancellationToken: cancellationToken);
+                var taskId = await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonDataCall, pathType: EPathType.HuiJu, taskPriority: 20, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
+
+                //本地保存通话记录数据
+                await InitTelCallData(dto.TrCallRecordDto, dto.Order.ProvinceNo, taskId, cancellationToken);
                 #endregion
             }
 
@@ -626,6 +636,8 @@ namespace DataSharing.Application.Receivers
                     ActualHandleOrgCode = dto.WorkflowTrace.HandlerOrgAreaCode,
                     ActualOpinion = string.IsNullOrEmpty(dto.WorkflowTrace.Opinion) == true ? order.ActualOpinion : dto.WorkflowTrace.Opinion,
                     ActualHandleTime = dto.WorkflowTrace.HandleTime,
+                    StartTime = order.StartTime,
+                    CallId = order.CallId,
                     FileJson = _mapper.Map<List<FileJson>>(order.FileJson)
                 };
 
@@ -642,7 +654,7 @@ namespace DataSharing.Application.Receivers
         public async Task SubmitCaseRecordAsync(PublishCallRecrodDto dto, CancellationToken cancellationToken)
         {
             //验证是否需要推送未接数据
-            if (dto != null && dto.TrCallRecordDto != null && dto.TrCallRecordDto.OnState == EOnState.NoOn)
+            if (dto != null && dto.TrCallRecordDto != null && dto.TrCallRecordDto.OnState == EOnState.NoOn && dto.Order == null)
             {
                 if (!await IsPublishMissedCall(dto.TrCallRecordDto, cancellationToken))
                     return;
@@ -675,9 +687,12 @@ namespace DataSharing.Application.Receivers
             var url = configProvince.HuiJu + "submit_case_record";
             #endregion
 
+            var startTime = dto.Order == null ? dto.TrCallRecordDto.BeginIvrTime : dto.Order.StartTime;
             //将待推送数据写入待推送表
-            await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonData, pathType: EPathType.HuiJu, taskPriority: 20, cancellationToken: cancellationToken);
+            var taskId = await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonData, pathType: EPathType.HuiJu, taskPriority: 20, GenerationTime: startTime, cancellationToken: cancellationToken);
 
+            //本地保存通话记录数据
+            await InitTelCallData(dto.TrCallRecordDto, data.CaseSerial, taskId, cancellationToken);
         }
 
         /// <summary>
@@ -715,8 +730,12 @@ namespace DataSharing.Application.Receivers
             var url = configProvince.HuiJu + "submit_case_record";
             #endregion
 
+            var startTime = dto.Order == null ? dto.TrCallRecordDto.BeginIvrTime : dto.Order.StartTime;
             //将待推送数据写入待推送表
-            await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonData, pathType: EPathType.HuiJu, taskPriority: 20, cancellationToken: cancellationToken);
+            var taskId = await InitPushDataAsync("SubmitCaseRecord", "submit_case_record", jsonData, pathType: EPathType.HuiJu, taskPriority: 20, GenerationTime: startTime, cancellationToken: cancellationToken);
+
+            //本地保存通话记录数据
+            await InitTelCallData(dto.TrCallRecordDto, data.CaseSerial, taskId, cancellationToken);
         }
 
         /// <summary>
@@ -826,7 +845,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SendRevokeCaseInfo", "revoke_case_info", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SendRevokeCaseInfo", "revoke_case_info", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 await FileDataAsync(dto.Special.FileJson, dto.Order.ProvinceNo, dsRevoke.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken);
             }
@@ -860,7 +879,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SendRemindCaseInfo", "remind_case_info", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SendRemindCaseInfo", "remind_case_info", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //处理附件
                 await FileDataAsync(dto.Urge.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken);
@@ -940,7 +959,7 @@ namespace DataSharing.Application.Receivers
                 var url = configProvince.XieTong + "get_case_result_receive";
                 #endregion
 
-                await InitPushDataAsync("GetCaseResultReceive", "get_case_result_receive", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("GetCaseResultReceive", "get_case_result_receive", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //处理附件
                 await FileDataAsync(null, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Result, dto.Order.AreaCode, cancellationToken);
@@ -961,7 +980,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("ZmhdCaseInfoPublic", "zmhd_case_info_public", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("ZmhdCaseInfoPublic", "zmhd_case_info_public", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
             }
 
         }
@@ -1087,7 +1106,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("GetKnowledgeInfoSend", "get_knowledge_info_send", jsonData, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+            await InitPushDataAsync("GetKnowledgeInfoSend", "get_knowledge_info_send", jsonData, pathType: EPathType.HuiJu, GenerationTime: dto.CreatDate, cancellationToken: cancellationToken);
 
             #region 处理知识库原始数据
             //查询原有数据,如果有修改原始数据,没有直接新增
@@ -1137,7 +1156,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("GetKnowledgeInfoUpdate", "get_knowledge_info_update", jsonData, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+            await InitPushDataAsync("GetKnowledgeInfoUpdate", "get_knowledge_info_update", jsonData, pathType: EPathType.HuiJu, GenerationTime: dto.CreatDate, cancellationToken: cancellationToken);
 
             #region 处理知识库原始数据
             //查询原有数据,如果有修改原始数据,没有直接新增
@@ -1182,7 +1201,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("GetKnowledgeInfoAbandon", "get_knowledge_info_abandon", jsonData, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+            await InitPushDataAsync("GetKnowledgeInfoAbandon", "get_knowledge_info_abandon", jsonData, pathType: EPathType.HuiJu, GenerationTime: dto.CreatDate, cancellationToken: cancellationToken);
 
             //知识下架删除原有原始数据
             await _knowledgeRawDataRepository.RemoveAsync(p => p.UID == data.UID, cancellationToken: cancellationToken);
@@ -1258,7 +1277,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("GetCaseProcessReceive", "get_case_process_receive", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+                await InitPushDataAsync("GetCaseProcessReceive", "get_case_process_receive", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //处理附件
                 await FileDataAsync(dto.WorkflowTrace.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken);
@@ -1282,7 +1301,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitCaseProcess", "submit_case_process", jsonDataSubmitCaseProcessInfo, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitCaseProcess", "submit_case_process", jsonDataSubmitCaseProcessInfo, pathType: EPathType.HuiJu, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //处理附件
                 await FileDataAsync(dto.WorkflowTrace.FileJson, dto.Order.ProvinceNo, data.CliengGuid, EMaterialType.Process, dto.Order.AreaCode, cancellationToken);
@@ -1404,7 +1423,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("GetVisitInfoReceive", "get_visit_info_receive", jsonData, pathType: EPathType.XieTong, taskPriority: 5, cancellationToken: cancellationToken);
+                await InitPushDataAsync("GetVisitInfoReceive", "get_visit_info_receive", jsonData, pathType: EPathType.XieTong, taskPriority: 5, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
                 //处理附件
                 await FileDataAsync(null, data.CaseSerial, data.CliengGuid, EMaterialType.Visit, data.AreaCode, cancellationToken);
             }
@@ -1426,7 +1445,7 @@ namespace DataSharing.Application.Receivers
                 #endregion
 
                 //将待推送数据写入待推送表
-                await InitPushDataAsync("SubmitVisitInfo", "submit_visit_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 5, cancellationToken: cancellationToken);
+                await InitPushDataAsync("SubmitVisitInfo", "submit_visit_info", jsonData, pathType: EPathType.HuiJu, taskPriority: 5, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
                 //处理附件
                 await FileDataAsync(null, data.CaseSerial, data.CliengGuid, EMaterialType.Visit, data.AreaCode, cancellationToken);
@@ -1499,7 +1518,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("SubmitCaseResult", "submit_case_result", jsonData, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+            await InitPushDataAsync("SubmitCaseResult", "submit_case_result", jsonData, pathType: EPathType.HuiJu, GenerationTime: dto.Order.StartTime, cancellationToken: cancellationToken);
 
             //处理附件
             if (dto.WorkflowTrace != null && dto.WorkflowTrace.FileJson != null && dto.WorkflowTrace.FileJson.Count > 0)
@@ -1517,7 +1536,7 @@ namespace DataSharing.Application.Receivers
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        private async Task<SubmitCaseInfo> InitDataAsync(OrderDto dto, CancellationToken cancellationToken)
+        private SubmitCaseInfo InitDataAsync(OrderDto dto)
         {
             var submitCaseInfo = _mapper.Map<SubmitCaseInfo>(dto);
 
@@ -1685,7 +1704,7 @@ namespace DataSharing.Application.Receivers
             #endregion
 
             //将待推送数据写入待推送表
-            await InitPushDataAsync("SubmitCaseExtends", "submit_case_extends", jsonData, pathType: EPathType.HuiJu, cancellationToken: cancellationToken);
+            await InitPushDataAsync("SubmitCaseExtends", "submit_case_extends", jsonData, pathType: EPathType.HuiJu, GenerationTime: dto.StartTime, cancellationToken: cancellationToken);
         }
 
         /// <summary>
@@ -1788,7 +1807,7 @@ namespace DataSharing.Application.Receivers
             var url = configProvince.HuiJu + "send_case_info";
             #endregion
             //将待推送数据写入待推送表
-            await InitPushDataAsync("SendCaseInfo", "send_case_info", jsonData, pathType: EPathType.XieTong, cancellationToken: cancellationToken);
+            await InitPushDataAsync("SendCaseInfo", "send_case_info", jsonData, pathType: EPathType.XieTong, GenerationTime: dto.StartTime, cancellationToken: cancellationToken);
 
             //处理附件
             await FileDataAsync(dto.FileJson, dto.ProvinceNo, sendCaseInfoData.CliengGuid, EMaterialType.Acceptance, sendCaseInfoData.AreaCode, cancellationToken);
@@ -1835,6 +1854,7 @@ namespace DataSharing.Application.Receivers
                 foreach (var item in fileJson)
                 {
                     List<FileJson> fileJsons = new() { _mapper.Map<FileJson>(item) };
+
                     //待推送数据写入待推送表
                     await InitPushDataAsync("GetCaseMaterialInfo", "get_case_material_info", jsonData, pathType: EPathType.File, fileJson: fileJsons, cancellationToken: cancellationToken);
                 }
@@ -1950,6 +1970,37 @@ namespace DataSharing.Application.Receivers
             }
             return false;
         }
+
+        /// <summary>
+        /// 初始化上传通话记录
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <param name="ProvinceNo"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        private async Task InitTelCallData(TrCallDto dto, string ProvinceNo, string taskId, CancellationToken cancellationToken)
+        {
+            var tellCall = await _dsTelCallRepository.GetAsync(p => p.CallId == dto.CallAccept, cancellationToken);
+            if (tellCall != null)
+            {
+                //修改
+                _mapper.Map(dto, tellCall);
+                tellCall.ProvinceNo = ProvinceNo;
+                tellCall.CallId = dto.CallAccept;
+                tellCall.TaskId = taskId;
+                await _dsTelCallRepository.UpdateAsync(tellCall, cancellationToken);
+            }
+            else
+            {
+                //新增
+                tellCall = new DsTelCall();
+                tellCall = _mapper.Map<DsTelCall>(dto);
+                tellCall.ProvinceNo = ProvinceNo;
+                tellCall.CallId = dto.CallAccept;
+                tellCall.TaskId = taskId;
+                await _dsTelCallRepository.AddAsync(tellCall, cancellationToken);
+            }
+        }
         #endregion
 
         #region 组装110数据
@@ -2119,11 +2170,12 @@ namespace DataSharing.Application.Receivers
         /// <param name="taskPriority">任务优先级(0:最低级别)</param>
         /// <param name="fileJson">附件</param>
         /// <returns></returns>
-        private async Task InitPushDataAsync(string taskType, string path, string request,
+        private async Task<string> InitPushDataAsync(string taskType, string path, string request,
             string httpMethod = "Post",
             EPlatformSource platformSource = EPlatformSource.Province,
             EPathType pathType = EPathType.Other,
             int taskPriority = 0,
+            DateTime? GenerationTime = null,
             List<FileJson>? fileJson = null,
             CancellationToken cancellationToken = default)
         {
@@ -2137,9 +2189,10 @@ namespace DataSharing.Application.Receivers
                 PlatformSource = platformSource,
                 FileJson = fileJson,
                 Request = request,
+                GenerationTime = GenerationTime,
                 PathType = pathType
             };
-            await _dsSendTaskRepository.AddAsync(dsSendTask, cancellationToken);
+            return await _dsSendTaskRepository.AddAsync(dsSendTask, cancellationToken);
         }
         #endregion
 

+ 2 - 1
src/DataSharing.Host/config/appsettings.Development.json

@@ -76,7 +76,8 @@
       "XieTong": "http://59.225.208.26:8001/cns-scxthj-rest-test/rest/",
       "ClientId": "dc218a8e-94a3-4cf2-a846-9952b65a40b4",
       "ClientSecret": "8838050f-529c-4887-ab6c-e4c3b3209813",
-      "MissedCallCount": 6 //未接通通话记录最多上传条数
+      "MissedCallCount": 6, //未接通通话记录最多上传条数
+      "SendTaskStartTime": "2024-03-31"
     },
     //企业服务
     "Enterprise": {

+ 2 - 0
src/DataSharing.Host/config/appsettings.json

@@ -90,6 +90,8 @@
       //"ClientId": "c2f51943-20cd-4253-82f6-7ef6b5cef025",
       //"ClientSecret": "0352e2c0-05f1-44df-9ab3-c0dd02a0735f",
       //"MissedCallCount": 6
+      "MissedCallCount": 6, //未接通通话记录最多上传条数
+      "SendTaskStartTime": "2024-03-31"
     },
     //企业服务
     "Enterprise": {

+ 3 - 1
src/DataSharing.Share/DataSharing.Share.csproj

@@ -7,7 +7,9 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <Folder Include="Dtos\HotlineClient\" />
+    <Compile Remove="Dtos\HotlineClient\**" />
+    <EmbeddedResource Remove="Dtos\HotlineClient\**" />
+    <None Remove="Dtos\HotlineClient\**" />
   </ItemGroup>
 
 </Project>

+ 2 - 0
src/DataSharing/ChannelConfiguration.cs

@@ -64,6 +64,8 @@
         public string ClientSecret { get; set; } = string.Empty;
         public string Scheme { get; set; } = string.Empty;
         public int MissedCallCount { get; set; }
+
+        public DateTime? SendTaskStartTime { get; set; }
     }
 
     /// <summary>

+ 5 - 1
src/DataSharing/DataExchange/DataExchangePusherProviderService.cs

@@ -43,7 +43,11 @@ namespace DataSharing.DataExchange
 
             var config = _channelConfigurationManager.GetConfigurationCityHandOver();
 
-            var response = await _dataExchangeClient.ExecuteAsync<DataExchangeResponseDto>(config.BaseUrl + dto.Path, dto.HttpMethod, dto.Request, cancellationToken);
+            var baseAddress = config.BaseUrl;
+            if (!baseAddress.EndsWith('/'))
+                baseAddress += "/";
+
+            var response = await _dataExchangeClient.ExecuteAsync<DataExchangeResponseDto>(baseAddress + dto.Path, dto.HttpMethod, dto.Request, cancellationToken);
 
             //如果推送成功修改数据状态
             if (response != null)

+ 6 - 1
src/DataSharing/Enterprise/EnterpriseClient.cs

@@ -1,6 +1,7 @@
 using DataSharing.Share.Dtos.Enterprise;
 using IdentityModel.Client;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
 using System.Net.Http.Headers;
 using XF.Domain.Cache;
 using XF.Domain.Dependency;
@@ -13,9 +14,11 @@ namespace DataSharing.Enterprise
 
         private static readonly string KeyToken = "EnterpriseKeyToken";
         private readonly IServiceScopeFactory _scopeFactory;
-        public EnterpriseClient(IServiceScopeFactory scopeFactory)
+        private readonly ILogger<EnterpriseClient> _logger;
+        public EnterpriseClient(IServiceScopeFactory scopeFactory, ILogger<EnterpriseClient> logger)
         {
             _scopeFactory = scopeFactory;
+            _logger = logger;
         }
 
         /// <summary>
@@ -86,6 +89,8 @@ namespace DataSharing.Enterprise
             if (tokenResponse.IsError)
                 throw new UserFriendlyException("获取token请求失败");
 
+            _logger.LogWarning("接口返回:--------------" + Newtonsoft.Json.JsonConvert.SerializeObject(tokenResponse));
+            _logger.LogWarning("接口返回,数据解析:--------------" + tokenResponse.Raw);
             var tokenInfo = System.Text.Json.JsonSerializer.Deserialize<TokenEnterprise>(tokenResponse.Raw);
             if (tokenInfo is null || !tokenInfo.Success || tokenInfo?.TokenInfo is null)
                 throw new UserFriendlyException("token解析失败");

+ 5 - 1
src/DataSharing/Enterprise/EnterprisePusherProviderService.cs

@@ -66,7 +66,11 @@ namespace DataSharing.Enterprise
                     try
                     {
                         #region 读取数据
-                        string url = string.Format("{0}{1}?Source={2}&Id={3}", businessFile.BaseUrl, businessFile.DownloadUrlAddress, businessFile.Source, item.FileId);
+                        var baseAddress = businessFile.BaseUrl;
+                        if (!baseAddress.EndsWith('/'))
+                            baseAddress += "/";
+
+                        string url = string.Format("{0}{1}?Source={2}&Id={3}", baseAddress, businessFile.DownloadUrlAddress, businessFile.Source, item.FileId);
                         using (var client = _httpClientFactory.CreateClient())
                         using (var response = await client.GetAsync(url))
                         {

+ 15 - 11
src/DataSharing/FwDataExchange/FwClient.cs

@@ -81,7 +81,11 @@ namespace DataSharing.FwDataExchange
             var configSendDataOld = channelconfigManager.GetConfigurationSendDataOld();
             string url = $"api/token?ClientID={configSendDataOld.ClientID}&Secret={configSendDataOld.Secret}";
 
-            var toke = await httpInvoker.RequestStringContentAsync<FwToken>(configSendDataOld.AddressUrl + url, "Get",
+            var baseAddress = configSendDataOld.AddressUrl;
+            if (!baseAddress.EndsWith('/'))
+                baseAddress += "/";
+
+            var toke = await httpInvoker.RequestStringContentAsync<FwToken>(baseAddress + url, "Get",
                     null, d => d.SetHttpClient(configSendDataOld.AddressUrl), cancellationToken);
 
             if (toke is null || toke.data is null)
@@ -93,22 +97,22 @@ namespace DataSharing.FwDataExchange
             return dataToken;
         }
 
-       /// <summary>
-       /// 请求,不带token
-       /// </summary>
-       /// <typeparam name="TResponse"></typeparam>
-       /// <param name="url"></param>
-       /// <param name="httpMethod"></param>
-       /// <param name="stringContent"></param>
-       /// <param name="cancellationToken"></param>
-       /// <returns></returns>
+        /// <summary>
+        /// 请求,不带token
+        /// </summary>
+        /// <typeparam name="TResponse"></typeparam>
+        /// <param name="url"></param>
+        /// <param name="httpMethod"></param>
+        /// <param name="stringContent"></param>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
         public async Task<TResponse?> RequestNoTokenAsync<TResponse>(string url, string httpMethod, string? stringContent = null, CancellationToken cancellationToken = default)
         {
             using var scope = _scopeFactory.CreateScope();
             var provider = scope.ServiceProvider;
             var channelconfigManager = provider.GetRequiredService<IChannelConfigurationManager>();
             var httpInvoker = provider.GetRequiredService<IHttpInvoker>();
-         
+
             var configHotlineClient = channelconfigManager.GetConfigurationHotlineClient();
             var postUrl = configHotlineClient.AddressUrl + url;
             return await httpInvoker.RequestStringContentAsync<TResponse>(postUrl, httpMethod, stringContent,

+ 106 - 40
src/DataSharing/Province/PusherProviderService.cs

@@ -1,6 +1,7 @@
-using DataSharing.SendTask;
-using DataSharing.Share.Dtos.FwDataExchange;
+using DataSharing.RawData;
+using DataSharing.SendTask;
 using DataSharing.Share.Dtos.Province;
+using DataSharing.Share.Dtos.Province.HuiJu;
 using DataSharing.Share.Dtos.Province.XieTong;
 using DataSharing.Share.Dtos.Province.XieTong.Receive;
 using DataSharing.Share.Enums;
@@ -9,7 +10,6 @@ using MapsterMapper;
 using Microsoft.Extensions.Logging;
 using Newtonsoft.Json;
 using System.Net;
-using System.Xml.Linq;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
 
@@ -17,6 +17,7 @@ namespace DataSharing.Province
 {
     public class PusherProviderService : IPusherProviderService, IScopeDependency
     {
+        #region 注入
         private readonly IMapper _mapper;
         private readonly ILogger<PusherProviderService> _logger;
         private readonly IChannelConfigurationManager _channelConfigurationManager;
@@ -28,6 +29,8 @@ namespace DataSharing.Province
         private readonly IRepository<DsGetCaseDistrecordSend> _getCaseDistrecordSendRepository;
         private readonly ICapPublisher _capPublisher;
         private readonly IRepository<DsSendTaskInfo> _dsSendTaskInfoRepository;
+        private readonly IRepository<DsOrder> _dataOrderRepository;
+        private readonly IRepository<DsTelCall> _dsTelCallRepository;
 
         /// <summary>
         /// 
@@ -43,6 +46,7 @@ namespace DataSharing.Province
         /// <param name="getCaseDistrecordSendRepository"></param>
         /// <param name="capPublisher"></param>
         /// <param name="dsSendTaskInfoRepository"></param>
+        /// <param name="dataOrderRepository"></param>
         public PusherProviderService(IMapper mapper, ILogger<PusherProviderService> logger,
             IChannelConfigurationManager channelConfigurationManager,
             IHttpClientFactory httpClientFactory,
@@ -52,7 +56,9 @@ namespace DataSharing.Province
             IRepository<DsSendCaseInfo> sendCaseInfoRepository,
             IRepository<DsGetCaseDistrecordSend> getCaseDistrecordSendRepository,
             ICapPublisher capPublisher,
-            IRepository<DsSendTaskInfo> dsSendTaskInfoRepository)
+            IRepository<DsSendTaskInfo> dsSendTaskInfoRepository,
+            IRepository<DsOrder> dataOrderRepository,
+            IRepository<DsTelCall> dsTelCallRepository)
         {
             _mapper = mapper;
             _logger = logger;
@@ -65,7 +71,10 @@ namespace DataSharing.Province
             _getCaseDistrecordSendRepository = getCaseDistrecordSendRepository;
             _capPublisher = capPublisher;
             _dsSendTaskInfoRepository = dsSendTaskInfoRepository;
+            _dataOrderRepository = dataOrderRepository;
+            _dsTelCallRepository = dsTelCallRepository;
         }
+        #endregion
 
         /// <summary>
         /// 省平台推送数据
@@ -78,11 +87,16 @@ namespace DataSharing.Province
             if (dto is null)
                 return;
 
+            var configProvince = _channelConfigurationManager.GetConfigurationProvince();
+            if (configProvince.SendTaskStartTime != null && configProvince.SendTaskStartTime > dto.GenerationTime)
+            {
+                dto.IsSuccess = true;
+                await _dsSendTaskRepository.UpdateAsync(dto, cancellationToken);
+            }
             var name = GetName(dto.Path);
 
             _logger.LogWarning("省请求参数:" + "--------------" + dto.Request);
             ProvinceResponse result = new();
-            var configProvince = _channelConfigurationManager.GetConfigurationProvince();
             if (dto.PathType == EPathType.HuiJu) //汇聚推送
                 result = await _huiJuClient.RequestAsync<ProvinceResponse>(configProvince.HuiJu + dto.Path, dto.HttpMethod, dto.Request, cancellationToken);
 
@@ -102,6 +116,7 @@ namespace DataSharing.Province
 
             if (result is not null)
             {
+                #region 处理推送任务表,推送明细表
                 //写入明细表
                 DsSendTaskInfo dsSendTaskInfo = new() { TaskId = dto.Id, Result = result };
 
@@ -119,6 +134,45 @@ namespace DataSharing.Province
                 }
                 await _dsSendTaskInfoRepository.AddAsync(dsSendTaskInfo, cancellationToken);
                 await _dsSendTaskRepository.UpdateAsync(dto, cancellationToken);
+                #endregion
+
+                #region 处理工单的推送时间,用于后面计算及时率
+                if (dto.TaskType == "SubmitCaseInfo")
+                {
+                    var dataOrder = System.Text.Json.JsonSerializer.Deserialize<ProvinceListRequest<SubmitCaseInfo>>(dto.Request);
+                    if (dataOrder != null && dataOrder.Data != null)
+                    {
+                        var orderItems = dataOrder.Data.Items;
+                        foreach (var item in orderItems)
+                        {
+                            var dsOrder = await _dataOrderRepository.GetAsync(p => p.ProvinceNo == item.CaseSerial, cancellationToken);
+                            if (dsOrder != null)
+                            {
+                                if (dsOrder.FirstSendProvinceTime is null)
+                                    dsOrder.FirstSendProvinceTime = DateTime.Now;
+
+                                dsOrder.LastSendProvinceTime = DateTime.Now;
+                                await _dataOrderRepository.UpdateAsync(dsOrder);
+                            }
+                        }
+                    }
+                }
+                #endregion
+
+                #region 处理通话记录推送时间
+                if (dto.TaskType == "SubmitCaseRecord")
+                {
+                    var telCall = await _dsTelCallRepository.GetAsync(p => p.TaskId == dto.Id, cancellationToken);
+                    if (telCall != null)
+                    {
+                        if (telCall.FirstSendProvinceTime is null)
+                            telCall.FirstSendProvinceTime = DateTime.Now;
+
+                        telCall.LastSendProvinceTime = DateTime.Now;
+                        await _dsTelCallRepository.UpdateAsync(telCall, cancellationToken);
+                    }
+                }
+                #endregion
             }
         }
 
@@ -148,7 +202,12 @@ namespace DataSharing.Province
                     var request = new ProvinceRequest<GetCaseDistrecordSendInfo>(configProvince.ClientId, configProvince.ClientSecret);
                     request.SetData(distrecordSendInfo);
                     var jsonData = request.ToString();
-                    var url = configProvince.XieTong + "rest/market/get_case_distrecord_send";
+
+                    var baseAddress = configProvince.XieTong;
+                    if (!baseAddress.EndsWith('/'))
+                        baseAddress += "/";
+
+                    var url = baseAddress + "rest/market/get_case_distrecord_send";
                     #endregion
 
                     var response = await _xieTongClient.RequestAsync<ProvinceDistrecordResponse>(url, "Post", jsonData, cancellationToken);
@@ -207,52 +266,59 @@ namespace DataSharing.Province
             var configProvince = _channelConfigurationManager.GetConfigurationProvince();
             var businessFile = _channelConfigurationManager.GetConfigurationBusinessFile();
             byte[] fileContentBytes = null;
-            //try
-            //{
-            string url = string.Format("{0}{1}?Source={2}&Id={3}", businessFile.BaseUrl, businessFile.DownloadUrlAddress, "hotline", fileId);
-            using (var client = _httpClientFactory.CreateClient())
-            using (var response = await client.GetAsync(url))
+            try
             {
-
-                if (response.StatusCode == HttpStatusCode.OK)
+                var baseAddress = businessFile.BaseUrl;
+                if (!baseAddress.EndsWith('/'))
+                    baseAddress += "/";
+                string url = string.Format("{0}{1}?Source={2}&Id={3}", baseAddress, businessFile.DownloadUrlAddress, "hotline", fileId);
+                using (var client = _httpClientFactory.CreateClient())
+                using (var response = await client.GetAsync(url))
                 {
-                    fileName = response.Content.Headers.ContentDisposition.FileNameStar;
-                    using var memoryStream = new MemoryStream();
-                    await response.Content.CopyToAsync(memoryStream);
-                    memoryStream.Seek(0, SeekOrigin.Begin);
 
-                    fileContentBytes = memoryStream.ToArray();
+                    if (response.StatusCode == HttpStatusCode.OK)
+                    {
+                        fileName = response.Content.Headers.ContentDisposition.FileNameStar;
+                        using var memoryStream = new MemoryStream();
+                        await response.Content.CopyToAsync(memoryStream);
+                        memoryStream.Seek(0, SeekOrigin.Begin);
+
+                        fileContentBytes = memoryStream.ToArray();
+                    }
                 }
-            }
-            if (fileContentBytes != null)
-            {
-                //获取附件上传Token
-                string strToken = await _xieTongClient.GetTokenAsync(cancellationToken);
-                Dictionary<string, object> dicParam = new()
+                if (fileContentBytes != null)
+                {
+                    //获取附件上传Token
+                    string strToken = await _xieTongClient.GetTokenAsync(cancellationToken);
+                    Dictionary<string, object> dicParam = new()
                     {
                         { "params",  request } // 第一个接口参数,json格式字符串
                     };
 
-                // 构造字典文件数据
-                // 接口参数名称为files
-                CFormUpload.FileParameter fileParameter = new CFormUpload.FileParameter("files", fileContentBytes, fileName, null);
-                dicParam.Add(fileName, fileParameter);
+                    // 构造字典文件数据
+                    // 接口参数名称为files
+                    CFormUpload.FileParameter fileParameter = new CFormUpload.FileParameter("files", fileContentBytes, fileName, null);
+                    dicParam.Add(fileName, fileParameter);
 
-                string strUrl = configProvince.HuiJu + "get_case_material_info";
-                // 上传附件
-                string strResult = CFormUpload.MultipartFormDataPost(strUrl, null, dicParam, strToken);
+                    var baseAddressHuiJu = configProvince.HuiJu;
+                    if (!baseAddressHuiJu.EndsWith('/'))
+                        baseAddressHuiJu += "/";
 
-                _logger.LogWarning("省接口上传附件返回:--------------" + strResult);
+                    string strUrl = baseAddressHuiJu + "get_case_material_info";
+                    // 上传附件
+                    string strResult = CFormUpload.MultipartFormDataPost(strUrl, null, dicParam, strToken);
 
-                if (!string.IsNullOrEmpty(strResult))
-                    return JsonConvert.DeserializeObject<ProvinceResponse>(strResult);
+                    _logger.LogWarning("省接口上传附件返回:--------------" + strResult);
+
+                    if (!string.IsNullOrEmpty(strResult))
+                        return JsonConvert.DeserializeObject<ProvinceResponse>(strResult);
+                }
+                return new ProvinceResponse();
+            }
+            catch (Exception ex)
+            {
+                return new ProvinceResponse();
             }
-            return new ProvinceResponse();
-            //}
-            //catch (Exception ex)
-            //{
-            //    return new ProvinceResponse();
-            //}
         }
 
         /// <summary>

+ 24 - 0
src/DataSharing/RawData/DsOrder.cs

@@ -78,6 +78,30 @@ namespace DataSharing.RawData
         [SugarColumn(ColumnDescription = "受理时间", IsNullable = true)]
         public DateTime? CaseDate { get; set; }
 
+        /// <summary>
+        /// 流程开启时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "流程开启时间", IsNullable = true)]
+        public DateTime? StartTime { get; set; }
+
+        /// <summary>
+        /// 通话记录ID(来源为电话的有值)
+        /// </summary>
+        [SugarColumn(ColumnDescription = " 通话记录ID(来源为电话的有值)", IsNullable = true)]
+        public string? CallId { get; set; }
+
+        /// <summary>
+        /// 第一次上传省上的时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "第一次上传省上的时间", IsNullable = true)]
+        public DateTime? FirstSendProvinceTime { get; set; }
+
+        /// <summary>
+        /// 最近一次推送时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "最近一次推送时间", IsNullable = true)]
+        public DateTime? LastSendProvinceTime { get; set; }
+
         /// <summary>
         ///   来源,区分省平台或110等其他平台同步过来的工单
         /// </summary>

+ 145 - 0
src/DataSharing/RawData/DsTelCall.cs

@@ -0,0 +1,145 @@
+using SqlSugar;
+using System.ComponentModel;
+using XF.Domain.Repository;
+
+namespace DataSharing.RawData
+{
+    /// <summary>
+    /// 上传的通话记录数据
+    /// </summary>
+    [Description("上传的通话记录数据")]
+    public class DsTelCall : CreationEntity
+    {
+        /// <summary>
+        /// 通话记录ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = " 通话记录ID", IsNullable = true)]
+        public string? CallId { get; set; }
+
+        /// <summary>
+        /// 主叫
+        /// </summary>
+        [SugarColumn(ColumnDescription = "主叫", IsNullable = true)]
+        public string? CPN { get; set; }
+
+        /// <summary>
+        /// 被叫
+        /// </summary>
+        [SugarColumn(ColumnDescription = "被叫", IsNullable = true)]
+        public string? CDPN { get; set; }
+
+        /// <summary>
+        /// 呼叫方向 0:呼入;1:呼出
+        /// </summary>
+        [SugarColumn(ColumnDescription = "呼叫方向", IsNullable = true)]
+        public string? CallDirection { get; set; }
+
+        /// <summary>
+        /// 分机号
+        /// </summary>
+        [SugarColumn(ColumnDescription = "分机号", IsNullable = true)]
+        public string? TelNo { get; set; }
+
+        /// <summary>
+        /// 用户ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "用户ID", IsNullable = true)]
+        public string? UserId { get; set; }
+
+        /// <summary>
+        /// 用户名
+        /// </summary>
+        [SugarColumn(ColumnDescription = "用户名", IsNullable = true)]
+        public string? UserName { get; set; }
+
+        /// <summary>
+        /// IVR开始时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "IVR开始时间", IsNullable = true)]
+        public DateTime? BeginIvrTime { get; set; }
+
+        /// <summary>
+        /// IVR结束时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "IVR结束时间", IsNullable = true)]
+        public DateTime? EndIvrTime { get; set; }
+
+        /// <summary>
+        /// 开始等待时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "开始等待时间", IsNullable = true)]
+        public DateTime? BeginQueueTime { get; set; }
+
+        /// <summary>
+        /// 结束等待时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "结束等待时间", IsNullable = true)]
+        public DateTime? EndQueueTime { get; set; }
+
+        /// <summary>
+        /// 开始振铃时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "开始振铃时间", IsNullable = true)]
+        public DateTime? BeginRingTime { get; set; }
+
+        /// <summary>
+        /// 结束振铃时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "结束振铃时间", IsNullable = true)]
+        public DateTime? EndRingTimg { get; set; }
+
+        /// <summary>
+        /// 通话时长(挂机时间-接通时间)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "通话时长(挂机时间-接通时间)", IsNullable = true)]
+        public int Duration { get; set; }
+
+        /// <summary>
+        /// 振铃时长(振铃结束时间-振铃开始时间)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "振铃时长(振铃结束时间-振铃开始时间)", IsNullable = true)]
+        public int RingTimes { get; set; }
+
+        /// <summary>
+        ///  排队时长(排队结束时间-排队开始时间)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "排队时长(排队结束时间-排队开始时间)", IsNullable = true)]
+        public int QueueTims { get; set; }
+
+        /// <summary>
+        /// 通话状态 1:接通;2:未接通
+        /// </summary>
+        [SugarColumn(ColumnDescription = "通话状态 1:接通;2:未接通", IsNullable = true)]
+        public string? OnState { get; set; }
+
+        /// <summary>
+        /// 可直接访问的通话录音地址
+        /// </summary>
+        [SugarColumn(ColumnDescription = "可直接访问的通话录音地址", IsNullable = true)]
+        public string? RecordingFileUrl { get; set; }
+
+        /// <summary>
+        /// 上传省工单编号
+        /// </summary>
+        [SugarColumn(ColumnDescription = "上传省工单编号", ColumnDataType = "varchar(50)", IsNullable = true)]
+        public string? ProvinceNo { get; set; }
+
+        /// <summary>
+        /// 第一次上传省上的时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "第一次上传省上的时间", IsNullable = true)]
+        public DateTime? FirstSendProvinceTime { get; set; }
+
+        /// <summary>
+        /// 最近一次推送时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "最近一次推送时间", IsNullable = true)]
+        public DateTime? LastSendProvinceTime { get; set; }
+
+        /// <summary>
+        /// 任务Id
+        /// </summary>
+        [SugarColumn(ColumnDescription = "任务Id", IsNullable = true)]
+        public string? TaskId { get; set; }
+    }
+}

+ 6 - 0
src/DataSharing/SendTask/DsSendTask.cs

@@ -79,6 +79,12 @@ namespace DataSharing.SendTask
         [SugarColumn(ColumnDescription = "请求端口,省推送必填,协同或者汇聚")]
         public EPathType? PathType { get; set; } = EPathType.Other;
 
+        /// <summary>
+        /// 生成时间(保存工单创建时间或者通话记录生成时间)
+        /// </summary>
+        [SugarColumn(ColumnDescription = "生成时间(保存工单创建时间或者通话记录生成时间)",  IsNullable = true)]
+        public DateTime? GenerationTime { get; set; }
+
         /// <summary>
         /// 附件
         /// </summary>