瀏覽代碼

Merge branch 'master' of http://110.188.24.182:10023/Fengwo/hotline

xf 1 年之前
父節點
當前提交
7a1228c36e

+ 64 - 78
src/Hotline.Api/Controllers/DataSharing/ProvinceController.cs

@@ -1,12 +1,10 @@
 using DotNetCore.CAP;
-using Fw.Utility.UnifyResponse;
 using Hotline.DataSharing;
 using Hotline.DataSharing.Province;
 using Hotline.DataSharing.Province.Extend;
 using Hotline.DataSharing.Province.Notifications;
 using Hotline.DataSharing.Province.XieTong.Receive;
 using Hotline.DataSharing.Province.XieTong.Send;
-using Hotline.Orders.Notifications;
 using Hotline.Share.Dtos.DataSharing;
 using Hotline.Share.Dtos.DataSharing.Province;
 using Hotline.Share.Dtos.DataSharing.Province.XieTong.Receive;
@@ -16,8 +14,6 @@ using MapsterMapper;
 using MediatR;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
-using System.Net;
-using System.Text.Json.Serialization;
 using XF.Domain.Filters;
 using XF.Domain.Repository;
 
@@ -813,9 +809,8 @@ namespace Hotline.Api.Controllers.DataSharing
         [HttpPost]
         [Route("get_case_material_info")]
         [AllowAnonymous]
-        public async Task<OpenResponse> GetCaseMaterialInfo(string @params, List<IFormFile> files)
+        public async Task<OpenResponse> GetCaseMaterialInfo([FromForm] string @params, List<IFormFile> files)
         {
-            var request = Request;
             // 上传文件为必须
             if (files is null || files.Count <= 0)
             {
@@ -868,80 +863,80 @@ namespace Hotline.Api.Controllers.DataSharing
         /// <summary>
         /// 服务工单材料接口--测试
         /// </summary>
-        /// <param name="params">工单材料信息</param>
-        /// <param name="files">材料文件</param>
         /// <returns></returns>
         [HttpPost]
         [Route("get_case_material_info_test")]
         [AllowAnonymous]
-        public async Task<OpenResponse> GetCaseMaterialInfotest()
+        public async Task<OpenResponse> GetCaseMaterialInfotest([FromForm] string @params, List<IFormFile> files)
         {
-            var businessFile = _channelConfigurationManager.GetConfigurationBusinessFile();
-
-            string result = "";
-            byte[] fileContentBytes = null;
-            try
-            {
-                string url = string.Format("{0}{1}?Source={2}&Id={3}", businessFile.BaseUrl, businessFile.DownloadUrlAddress, businessFile.Source, "08dbf49c-85cd-414b-8f1d-c16a811ed96e");
-                using (var client = _httpClientFactory.CreateClient())
-                using (var response = await client.GetAsync(url))
-                {
-                    if (response.StatusCode == HttpStatusCode.OK)
-                    {
-                        using var memoryStream = new MemoryStream();
-                        //await file.CopyToAsync(memoryStream);
-                        //memoryStream.Seek(0, SeekOrigin.Begin);
-                        //byte[] fileContentBytes = memoryStream.ToArray();
-
-                        await response.Content.CopyToAsync(memoryStream);
-                        memoryStream.Seek(0, SeekOrigin.Begin);
-                        fileContentBytes = memoryStream.ToArray();
-                    }
-                }
-            }
-            catch (Exception)
-            { }
-
-            GetCaseMaterialInfoModel dto = new GetCaseMaterialInfoModel()
-            {
-                CaseSerial = "1111111111",
-                MaterialType = "10",
-                CliengGuid = "1122222",
-                AreaCode = "510000"
-            };
-
-            //组装请求参数
-            var model = new GetCaseMaterialInfoRequest
-            {
-                paras = dto,
-                token = new ClientInfo("11111", "22222")
-            };
+            return OpenResponse.Ok(Reponse.Failed("数据解析失败"));
+          //  return OpenResponse.Ok("ok");
+            //var businessFile = _channelConfigurationManager.GetConfigurationBusinessFile();
 
+            //string result = "";
+            //byte[] fileContentBytes = null;
+            //try
+            //{
+            //    string url = string.Format("{0}{1}?Source={2}&Id={3}", businessFile.BaseUrl, businessFile.DownloadUrlAddress, businessFile.Source, "08dbf49c-85cd-414b-8f1d-c16a811ed96e");
+            //    using (var client = _httpClientFactory.CreateClient())
+            //    using (var response = await client.GetAsync(url))
+            //    {
+            //        if (response.StatusCode == HttpStatusCode.OK)
+            //        {
+            //            using var memoryStream = new MemoryStream();
+            //            //await file.CopyToAsync(memoryStream);
+            //            //memoryStream.Seek(0, SeekOrigin.Begin);
+            //            //byte[] fileContentBytes = memoryStream.ToArray();
+
+            //            await response.Content.CopyToAsync(memoryStream);
+            //            memoryStream.Seek(0, SeekOrigin.Begin);
+            //            fileContentBytes = memoryStream.ToArray();
+            //        }
+            //    }
+            //}
+            //catch (Exception)
+            //{ }
 
-            Dictionary<string, object> dicParam = new Dictionary<string, object>();
+            //GetCaseMaterialInfoModel dto = new GetCaseMaterialInfoModel()
             //{
-            //    { "params", "111111" } // 第一个接口参数,json格式字符串
+            //    CaseSerial = "1111111111",
+            //    MaterialType = "10",
+            //    CliengGuid = "1122222",
+            //    AreaCode = "510000"
             //};
 
-            // 文件内容
-            //    byte[] file = Convert.FromBase64String(result);//这里需要获取附件的流
+            ////组装请求参数
+            //var model = new GetCaseMaterialInfoRequest
+            //{
+            //    paras = dto,
+            //    token = new ClientInfo("11111", "22222")
+            //};
 
-            // 构造字典文件数据
-            // 接口参数名称为files
-            CFormUpload.FileParameter fileParameter = new CFormUpload.FileParameter("files", fileContentBytes, "测试", null);
-            dicParam.Add("测试", fileParameter);
-            dicParam.Add("params", System.Text.Json.JsonSerializer.Serialize(model));
-            string strUrl = "http://localhost:7051/api/receive/get_case_material_info";
-            // 上传附件
-            string strResult = CFormUpload.MultipartFormDataPost(strUrl, null, dicParam, "");
-
-            var responseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ProvinceResponse>(strResult);
-            if (responseData != null && responseData.ReturnInfo != null)
-            {
 
-            }
+            //Dictionary<string, object> dicParam = new Dictionary<string, object>();
+            ////{
+            ////    { "params", "111111" } // 第一个接口参数,json格式字符串
+            ////};
+
+            //// 文件内容
+            ////    byte[] file = Convert.FromBase64String(result);//这里需要获取附件的流
+
+            //// 构造字典文件数据
+            //// 接口参数名称为files
+            //CFormUpload.FileParameter fileParameter = new CFormUpload.FileParameter("files", fileContentBytes, "测试", null);
+            //dicParam.Add("测试", fileParameter);
+            //dicParam.Add("params", System.Text.Json.JsonSerializer.Serialize(model));
+            //string strUrl = "http://localhost:7051/api/receive/get_case_material_info";
+            //// 上传附件
+            //string strResult = CFormUpload.MultipartFormDataPost(strUrl, null, dicParam, "");
+
+            //var responseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ProvinceResponse>(strResult);
+            //if (responseData != null && responseData.ReturnInfo != null)
+            //{
 
+            //}
 
+            //return OpenResponse.Ok(Reponse.Failed("成功"));
 
 
 
@@ -973,11 +968,10 @@ namespace Hotline.Api.Controllers.DataSharing
             //    dicParam.Add(fileName, fileParameter);
             //    var a = CFormUpload.MultipartFormDataPost("http://localhost:50100/api/v1/Province/get_case_material_info", null, dicParam, null);
             //}
-            return OpenResponse.Ok(Reponse.Failed("成功"));
-        }
-
 
+        }
 
+        #region 私有方法
         /// <summary>
         /// 将文件流上传到附件服务器
         /// </summary>
@@ -1016,15 +1010,7 @@ namespace Hotline.Api.Controllers.DataSharing
             return new BusinessFileDto();
 
         }
+        #endregion
     }
 
-
-    public class test
-    {
-
-        [JsonPropertyName("params")]
-        public string Params { get; set; }
-
-        public List<IFormFile> files { get; set; }
-    }
 }

+ 1 - 1
src/Hotline.Api/Controllers/FileController.cs

@@ -128,7 +128,7 @@ namespace Hotline.Api.Controllers
 		/// <param name="id"></param>
 		/// <returns></returns>
 		[Permission(EPermission.FileEntity)]
-		[HttpGet("/{id}")]
+		[HttpGet("{id}")]
 		public async Task<File.File> Entity(string id)
 		{
 			return await _fileRepository.Queryable()

+ 2 - 4
src/Hotline.Api/Controllers/IPPbxController.cs

@@ -157,8 +157,6 @@ namespace Hotline.Api.Controllers
         [HttpPost("receivecallrecord")]
         public async Task<OpenResponse> ReceiveCallRecord([FromBody]ReceiveCallRecordDto dto)
         {
-            var result = JsonSerializer.Serialize(dto);
-            _logger.LogInformation($"收到通话记录:{result}");
             var model = _mapper.Map<TrCallRecord>(dto);
             await _trCallRecordRepository.AddAsync(model, HttpContext.RequestAborted);
             return OpenResponse.Ok("success");
@@ -170,8 +168,8 @@ namespace Hotline.Api.Controllers
         /// <param name="dto"></param>
         /// <returns></returns>
         [AllowAnonymous]
-        [HttpGet("receivecallevaluate")]
-        public async Task<OpenResponse> ReceiveCallEvaluate([FromQuery]ReceiveCallEvaluateDto dto)
+        [HttpPost("receivecallevaluate")]
+        public async Task<OpenResponse> ReceiveCallEvaluate([FromBody]ReceiveCallEvaluateDto dto)
         {
             var model = _mapper.Map<TrCallEvaluate>(dto);
             await _trCallEvaluate.AddAsync(model, HttpContext.RequestAborted);

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

@@ -39,6 +39,7 @@ using Hotline.Share.Dtos.FlowEngine.Workflow;
 using System.Diagnostics;
 using System.Transactions;
 using System.Collections.Generic;
+using Hotline.Share.Dtos.File;
 
 namespace Hotline.Api.Controllers;
 
@@ -1099,7 +1100,7 @@ public class OrderController : BaseController
             .Includes(x => x.OrderVisit, y => y.Order)
             .Includes(x => x.OrderVisit, y => y.Employee)
             .Where(x => x.OrderVisit.VisitState != EVisitState.None && x.OrderVisit.IsCanHandle);
-        if (_sessionContext.OrgId != null && !_sessionContext.OrgId.StartsWith("001"))
+        if (_sessionContext.OrgId != null && !_sessionContext.OrgIsCenter)
         {
             query.WhereIF(!string.IsNullOrEmpty(dto.Keyword),
                     x => x.OrderVisit.Order.Title.Contains(dto.Keyword!) ||
@@ -1139,15 +1140,19 @@ public class OrderController : BaseController
     [HttpGet("screen")]
     public async Task<PagedDto<OrderScreenListDto>> ScreenList([FromQuery] ScreenListDto dto)
     {
-        var (total, items) = await _orderScreenRepository.Queryable()
+        var  query =  _orderScreenRepository.Queryable()
             .Includes(x => x.Order)
             .Includes(x => x.VisitDetail)
             .Includes(x => x.Visit, d => d.Order)
             .Includes(x => x.Workflow)
             .WhereIF(!string.IsNullOrEmpty(dto.Keyword),
-                d => d.Visit.Order.Title.Contains(dto.Keyword!) || d.Visit.Order.No.Contains(dto.Keyword!))
-            .WhereIF(dto.Status.HasValue && dto.Status != EScreenStatus.MyHandle, x => x.Status == EScreenStatus.Apply  || x.Status == EScreenStatus.Approval)
-            .WhereIF(dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle,
+                d => d.Visit.Order.Title.Contains(dto.Keyword!) || d.Visit.Order.No.Contains(dto.Keyword!));
+        if (dto.Status is EScreenStatus.Apply)
+        {
+            query.Where(x =>(x.Status == EScreenStatus.Apply || x.Status == EScreenStatus.Approval) && x.Workflow.HandlerUsers.Any(w=>w.Key == _sessionContext.UserId));
+		}
+        var  (total, items) = await query
+			.WhereIF(dto.Status.HasValue && dto.Status == EScreenStatus.MyHandle,
                 x => x.Status != EScreenStatus.Apply && x.CreatorId == _sessionContext.UserId)
             .WhereIF(dto.CreationTimeStart.HasValue, d => d.CreationTime >= dto.CreationTimeStart)
             .WhereIF(dto.CreationTimeEnd.HasValue, d => d.CreationTime <= dto.CreationTimeEnd)
@@ -1673,10 +1678,12 @@ public class OrderController : BaseController
                 _sessionContext.RequiredOrgId, _sessionContext.OrgName,
                 _sessionContext.OrgAreaCode, _sessionContext.OrgAreaName));
         }
+		var dto = _mapper.Map<OrderDto>(order!);
 
-        var dto = _mapper.Map<OrderDto>(order!);
+        var files = await _fileRepository.Queryable().Where(x => x.Key == dto.Id && x.Classify == "受理上传").ToListAsync();
+		dto.Files = _mapper.Map<List<FileDto>>(files);
 
-        if (order?.Workflow != null)
+		if (order?.Workflow != null)
             dto.Workflow.CanHandle = canHandle;
         var repeatablesMap = await _repeatableEventDetailRepository.Queryable()
             .Includes(x => x.Order)

+ 44 - 24
src/Hotline.Application/Handlers/Order/ReceiveOrderNotifyHandler.cs

@@ -5,7 +5,9 @@ using System.Text;
 using System.Threading.Tasks;
 using Hotline.Application.FlowEngine;
 using Hotline.DataSharing.Province.Notifications;
+using Hotline.File;
 using Hotline.Orders;
+using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
 using MapsterMapper;
@@ -21,18 +23,21 @@ namespace Hotline.Application.Handlers.Order
         private readonly IOrderDomainService _orderDomainService;
         private readonly IWorkflowApplication _workflowApplication;
         private readonly IMapper _mapper;
+        private readonly IFileRepository _fileRepository;
 
-        public ReceiveOrderNotifyHandler(
+		public ReceiveOrderNotifyHandler(
             IOrderRepository orderRepository,
             IOrderDomainService orderDomainService,
             IWorkflowApplication workflowApplication,
-            IMapper mapper)
+            IMapper mapper,
+            IFileRepository fileRepository)
         {
             _orderRepository = orderRepository;
             _orderDomainService = orderDomainService;
             _workflowApplication = workflowApplication;
             _mapper = mapper;
-        }
+            _fileRepository = fileRepository;
+		}
 
         /// <summary>Handles a request</summary>
         /// <param name="request">The request</param>
@@ -41,14 +46,15 @@ namespace Hotline.Application.Handlers.Order
         public Task<AddOrderResponse?> Handle(ReceiveOrderNotify request, CancellationToken cancellationToken)
         {
             var dto = request.AddOrderDto;
+            var files = request.Files;
             switch (dto.Source)
             {
                 case ESource.ProvinceStraight:
-                    return ReceiveOrderFromProvinceAsync(dto, cancellationToken);
+                    return ReceiveOrderFromProvinceAsync(dto, files, cancellationToken);
                 case ESource.Police110:
                 case ESource.CityDataExchangeLz:
                 case ESource.ConvergenceMedia:
-                    return ReceiveOrderFromOtherPlatformAsync(dto, cancellationToken);
+                    return ReceiveOrderFromOtherPlatformAsync(dto, files, cancellationToken);
                 case ESource.Hotline:
                 case ESource.HotlineImport:
                 default:
@@ -62,28 +68,39 @@ namespace Hotline.Application.Handlers.Order
         /// <param name="dto"></param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        private async Task<AddOrderResponse?> ReceiveOrderFromOtherPlatformAsync(AddOrderDto dto,
-            CancellationToken cancellationToken)
+        private async Task<AddOrderResponse?> ReceiveOrderFromOtherPlatformAsync(AddOrderDto dto, List<FileDto> files,
+
+			CancellationToken cancellationToken)
         {
             if (string.IsNullOrEmpty(dto.ExternalId))
                 throw new UserFriendlyException("工单外部编号不能为空");
 
-            var exists = await _orderRepository.AnyAsync(d => d.ExternalId == dto.ExternalId, cancellationToken);
-            if (exists) return null;
-            var order = _mapper.Map<Hotline.Orders.Order>(dto);
-            var orderId = await _orderDomainService.AddAsync(order, cancellationToken);
-            return new AddOrderResponse
+            var exists = await _orderRepository.Queryable().Where(d => d.ExternalId == dto.ExternalId).FirstAsync(cancellationToken);
+            if (exists != null)
+            {
+	            if (files != null && files.Any()) exists.FileJson = await _fileRepository.AddFileAsync(files, exists.Id, cancellationToken);
+	            await _orderRepository.FileAsync(exists, cancellationToken);
+				return null;
+            }
+            else
             {
-                Id = orderId,
-                No = order.No,
-                Password = order.Password!
-            };
+				var order = _mapper.Map<Hotline.Orders.Order>(dto);
+                order.InitId();
+				if (files != null && files.Any()) order.FileJson = await _fileRepository.AddFileAsync(files, order.Id, cancellationToken);
+				var orderId = await _orderDomainService.AddAsync(order, cancellationToken);
+				return new AddOrderResponse
+				{
+					Id = orderId,
+					No = order.No,
+					Password = order.Password!
+				};
+			}
         }
 
         /// <summary>
         /// 接受省平台工单
         /// </summary>
-        private async Task<AddOrderResponse?> ReceiveOrderFromProvinceAsync(AddOrderDto dto, CancellationToken cancellationToken)
+        private async Task<AddOrderResponse?> ReceiveOrderFromProvinceAsync(AddOrderDto dto, List<FileDto> files, CancellationToken cancellationToken)
         {
             if (string.IsNullOrEmpty(dto.ProvinceNo))
                 throw new UserFriendlyException("无效省工单编号");
@@ -92,29 +109,32 @@ namespace Hotline.Application.Handlers.Order
             if (order is null)
             {
                 order = _mapper.Map<Hotline.Orders.Order>(dto);
-                var orderId = await _orderDomainService.AddAsync(order, cancellationToken);
+                order.InitId();
+                if (files != null && files.Any()) order.FileJson = await _fileRepository.AddFileAsync(files, order.Id, cancellationToken);
+				await _orderDomainService.AddAsync(order, cancellationToken);
 
                 if (order.Source is ESource.ProvinceStraight)
                 {
                     var orderExtension = await _orderDomainService.GetOrderExtensionsAsync(dto.ProvinceNo, cancellationToken);
                     if (orderExtension is not null)
                     {
-                        orderExtension.Id = orderId;
+                        orderExtension.Id = order.Id;
                         await _orderDomainService.UpdateExtensionAsync(orderExtension, cancellationToken);
                     }
                 }
-
-                return new AddOrderResponse
+				return new AddOrderResponse
                 {
-                    Id = orderId,
+                    Id = order.Id,
                     No = order.No,
                     Password = order.Password!
                 };
             }
             else
             {
-                // 特提(撤回至发起)
-                if (!string.IsNullOrEmpty(order.WorkflowId))
+	            if (files != null && files.Any()) order.FileJson = await _fileRepository.AddFileAsync(files, order.Id, cancellationToken);
+	            await _orderRepository.FileAsync(order, cancellationToken);
+				// 特提(撤回至发起)
+				if (!string.IsNullOrEmpty(order.WorkflowId))
                     await _workflowApplication.RecallToStartAsync(order.WorkflowId, "省工单重派", cancellationToken);
                 return _mapper.Map<AddOrderResponse>(order);
             }

+ 30 - 11
src/Hotline.Application/Mappers/CallMapperConfigs.cs

@@ -24,20 +24,20 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.CPNName, x => x.caller_id_name)
                 .Map(d=>d.CDPN,x=>x.destination_number)
                 .Map(d => d.RecordingFileUrl, x => x.recording_file_url)
-                .Map(d => d.CreatedTime, x => x.created_time)
-                .Map(d=> d.AnsweredTime,x=>x.answered_time)
+                //.Map(d => d.CreatedTime, x => x.created_time)
+                //.Map(d=> d.AnsweredTime,x=>x.answered_time)
                 //.IgnoreIf((s, d) => s.answered_time == null, d => d.AnsweredTime)
-                .Map(d => d.OverTime, x => x.over_time)
+                //.Map(d => d.OverTime, x => x.over_time)
                 .Map(d => d.Gateway, x => x.gateway)
                 .Map(d => d.OtherStr, x => x.other_str)
                 .Map(d => d.OtherAccept, x => x.other_accept)
                 .Map(d => d.Status, x => x.status)
-                .Map(d=>d.BeginIvrTime,x=>x.beginIvrTime)
-                .Map(d=>d.EndIvrTime,x=>x.endIvrTime)
-                .Map(d=>d.BeginQueueTime,x=>x.beginQueueTime)
-                .Map(d=>d.EndQueueTime,x=>x.endQueueTime)
-                .Map(d=>d.BeginRingTime,x=>x.beginRingTime)
-                .Map(d=>d.EndRingTimg,x=>x.endRingTime)
+                //.Map(d=>d.BeginIvrTime,x=>x.beginIvrTime)
+                //.Map(d=>d.EndIvrTime,x=>x.endIvrTime)
+                //.Map(d=>d.BeginQueueTime,x=>x.beginQueueTime)
+                //.Map(d=>d.EndQueueTime,x=>x.endQueueTime)
+                //.Map(d=>d.BeginRingTime,x=>x.beginRingTime)
+                //.Map(d=>d.EndRingTimg,x=>x.endRingTime)
                 //.IgnoreIf((s, d) => s.beginIvrTime == null, d => d.BeginIvrTime)
                 //.IgnoreIf((s, d) => s.endIvrTime == null, d => d.EndIvrTime)
                 //.IgnoreIf((s, d) => s.beginQueueTime == null, d => d.BeginQueueTime)
@@ -47,12 +47,31 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.OlaQueue, x => x.ola_queue)
                 .Map(d => d.BatchAccept, x => x.batch_accept)
                 .Map(d => d.IvrDtmf, x => x.ivr_dtmf)
-                .Map(d => d.DtmfType, x => x.dtmf_type);
-
+                .Map(d => d.DtmfType, x => x.dtmf_type)
+                .AfterMapping((s, d) =>{d.CreatedTime = DateTime.Parse(s.created_time);})
+                .AfterMapping((s,d) =>{d.AnsweredTime = FormatDateTime(s.answered_time);})
+                .AfterMapping((s, d) => { d.OverTime = DateTime.Parse(s.over_time); })
+                .AfterMapping((s, d) => { d.BeginIvrTime = FormatDateTime(s.beginIvrTime); })
+                .AfterMapping((s, d) => { d.EndIvrTime = FormatDateTime(s.endIvrTime); })
+                .AfterMapping((s, d) => { d.BeginQueueTime = FormatDateTime(s.beginQueueTime); })
+                .AfterMapping((s, d) => { d.EndQueueTime = FormatDateTime(s.endQueueTime); })
+                .AfterMapping((s, d) => { d.BeginRingTime = FormatDateTime(s.beginRingTime); })
+                .AfterMapping((s, d) => { d.EndRingTimg = FormatDateTime(s.endRingTime); });
+            
+          
+                
             config.ForType<ReceiveCallEvaluateDto, TrCallEvaluate>()
                 .Map(d => d.Dtmf, x => x.dtmf)
                 .Map(d => d.CallAccept, x => x.call_accept)
                 .Map(d => d.Type, x => x.type);
         }
+
+        private DateTime? FormatDateTime(string? time)
+        {
+            if(string.IsNullOrEmpty(time)) return null;
+
+            return DateTime.Parse(time);
+        }
+
     }
 }

+ 5 - 0
src/Hotline.Repository.SqlSugar/Orders/OrderRepository.cs

@@ -215,5 +215,10 @@ namespace Hotline.Repository.SqlSugar.Orders
 
             await Db.Updateable<OrderVisit>().SetColumns(x => x.IsCanHandle == canHandle).Where(x=>x.Id == VisitId).ExecuteCommandAsync(cancellationToken);
         }
+
+        public async Task FileAsync(Order order, CancellationToken cancellationToken)
+        {
+			await Db.Updateable<Order>().SetColumns(x=>x.FileJson == order.FileJson).Where(x=>x.Id == order.Id).ExecuteCommandAsync(cancellationToken);
+		}
 	}
 }

+ 27 - 6
src/Hotline.Share/Dtos/DataSharing/Province/ProvinceResponse.cs

@@ -37,18 +37,23 @@
         public string caseid { get; set; }
     }
 
+    /// <summary>
+    /// 省接口调用返回数据
+    /// </summary>
     public class Reponse
     {
-        public int Code { get; set; }
-
-        public string Description { get; set; }
+        [System.Text.Json.Serialization.JsonPropertyName("ReturnInfo")]
+        public ReponseBase ReturnInfo { get; set; }
 
         public static Reponse Success(string? description = "")
         {
             return new Reponse
             {
-                Code = 1,
-                Description = (description ?? "您已成功提交数据!")
+                ReturnInfo = new ReponseBase
+                {
+                    Code = "1",
+                    Description = (description ?? "您已成功提交数据!")
+                }
             };
         }
 
@@ -56,8 +61,24 @@
         {
             return new Reponse
             {
-                Description = (description ?? "接口调用失败!")
+                ReturnInfo = new ReponseBase
+                {
+                    Code = "0",
+                    Description = (description ?? "接口调用失败!")
+                }
             };
         }
     }
+
+    /// <summary>
+    /// 省调用接口返回状态
+    /// </summary>
+    public class ReponseBase
+    {
+        [System.Text.Json.Serialization.JsonPropertyName("Code")]
+        public string Code { get; set; }
+
+        [System.Text.Json.Serialization.JsonPropertyName("Description")]
+        public string Description { get; set; }
+    }
 }

+ 7 - 0
src/Hotline.Share/Dtos/File/FileDto.cs

@@ -131,4 +131,11 @@ namespace Hotline.Share.Dtos.File
 		/// </summary>
 		public string? Path { get; set; }
 	}
+
+	public class FileJsonDto
+	{
+
+		public string Id { get; set; }
+		public string Path { get; set; }
+	}
 }

+ 2 - 1
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -412,7 +412,8 @@ namespace Hotline.Share.Dtos.Order
 
         public List<OrderVisitDto> OrderVisits { get; set; }
 
-    }
+        public List<FileJsonDto>? FileJson { get; set; }
+	}
 
     public class UpdateOrderDto : AddOrderDto
     {

+ 1 - 2
src/Hotline.Share/Dtos/Order/OrderScreenDto.cs

@@ -67,7 +67,7 @@ namespace Hotline.Share.Dtos.Order
 		/// </summary>
 		public List<FileDto> Files { get; set; } = new();
 
-		public string FileJson { get; set; }
+		public List<FileJsonDto>? FileJson { get; set; }
 	}
 
 	public class OrderScreenListDto
@@ -183,7 +183,6 @@ namespace Hotline.Share.Dtos.Order
 		/// </summary>
 		public string? WorkflowId { get; set; }
 
-		public string FileJson { get; set; }
 	}
 
 	public class PublishScreenDto {

+ 9 - 9
src/Hotline.Share/Dtos/TrCallCenter/TrTelDao.cs

@@ -128,17 +128,17 @@ namespace Hotline.Share.Dtos.TrCallCenter
         /// <summary>
         /// 通话创建时间
         /// </summary>
-        public DateTime created_time { get; set; }
+        public string created_time { get; set; }
 
         /// <summary>
         /// 接通时间
         /// </summary>
-        public DateTime? answered_time { get; set; }
+        public string? answered_time { get; set; }
 
         /// <summary>
         /// 挂机时间
         /// </summary>
-        public DateTime over_time { get; set; }
+        public string over_time { get; set; }
 
         /// <summary>
         /// 线路号
@@ -163,32 +163,32 @@ namespace Hotline.Share.Dtos.TrCallCenter
         /// <summary>
         /// IVR开始时间
         /// </summary>
-        public DateTime? beginIvrTime { get; set; }
+        public string? beginIvrTime { get; set; }
 
         /// <summary>
         /// IVR结束时间
         /// </summary>
-        public DateTime? endIvrTime { get; set; }
+        public string? endIvrTime { get; set; }
 
         /// <summary>
         /// 开始等待时间
         /// </summary>
-        public DateTime? beginQueueTime { get; set; }
+        public string? beginQueueTime { get; set; }
 
         /// <summary>
         /// 结束等待时间
         /// </summary>
-        public DateTime? endQueueTime { get; set; }
+        public string? endQueueTime { get; set; }
 
         /// <summary>
         /// 开始振铃时间
         /// </summary>
-        public DateTime? beginRingTime { get; set; }
+        public string? beginRingTime { get; set; }
 
         /// <summary>
         /// 结束振铃时间
         /// </summary>
-        public DateTime? endRingTime { get; set; }
+        public string? endRingTime { get; set; }
 
         /// <summary>
         /// 队列ID

+ 7 - 1
src/Hotline/DataSharing/Province/Notifications/ReceiveOrderNotify.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Dtos.Order;
+using Hotline.Share.Dtos.File;
+using Hotline.Share.Dtos.Order;
 using MediatR;
 
 namespace Hotline.DataSharing.Province.Notifications;
@@ -9,4 +10,9 @@ namespace Hotline.DataSharing.Province.Notifications;
 public class ReceiveOrderNotify : IRequest<AddOrderResponse>
 {
     public AddOrderDto AddOrderDto { get; set; }
+
+    /// <summary>
+    /// 附件列表
+    /// </summary>
+    public List<FileDto>? Files { get; set; }
 }

+ 2 - 1
src/Hotline/Orders/IOrderRepository.cs

@@ -22,5 +22,6 @@ namespace Hotline.Orders
         //Task<PagedDto<WorkflowOrderDto>> GetAboutToExpireNodeAsync(AboutToExpireListDto dto, CancellationToken cancellationToken);
         Task OrderParticiple(string inputStr, string orderId, CancellationToken cancellationToken);
         Task OrderScreenRevisionVisit(string VisitId, bool canHandle, CancellationToken cancellationToken);
-    }
+        Task FileAsync(Order order, CancellationToken cancellationToken);
+	}
 }