Browse Source

Merge branch 'master' of http://git.12345lm.cn/Fengwo/data-sharing

xf 1 year ago
parent
commit
d38f670713

+ 1 - 1
src/DataSharing.Application/DataSharing.Application.csproj

@@ -8,7 +8,7 @@
 
   <ItemGroup>
     <PackageReference Include="Hotline.Api.Sdk" Version="1.0.7" />
-    <PackageReference Include="Hotline.Share" Version="1.0.62" />
+    <PackageReference Include="Hotline.Share" Version="1.0.63" />
     <PackageReference Include="Polly.Core" Version="8.2.0" />
     <PackageReference Include="FluentValidation" Version="11.6.0" />
   </ItemGroup>

+ 25 - 24
src/DataSharing.Application/Mappers/MapperConfigs.cs

@@ -36,7 +36,7 @@ namespace DataSharing.Application.Mappers
                .Map(d => d.CaseIsVisit, x => x.ProcessType == Hotline.Share.Enums.Order.EProcessType.Zhiban ? "0" : "1")
                .Map(d => d.EventDate, x => x.IncidentTime.HasValue ? x.IncidentTime : DateTime.Now)
                .Map(d => d.PushType, x => x.PushTypeCode)
-               .Map(d => d.AreaCode, x => x.AreaCode)
+               .Map(d => d.AreaCode, x => x.AreaCode.Length > 6 ? x.AreaCode.Substring(0, 6) : x.AreaCode)
                .Map(d => d.CaseSerial, x => x.ProvinceNo)
                .Map(d => d.CaseSource, x => x.SourceChannelCode)
                .Map(d => d.CaseAddress, x => x.Province + x.City + x.County + x.Street)
@@ -60,7 +60,7 @@ namespace DataSharing.Application.Mappers
                .Map(d => d.CaseIsSecrect, x => x.IsSecret ? "1" : "0")
                .Map(d => d.CaseIsVisit, x => x.ProcessType == Hotline.Share.Enums.Order.EProcessType.Zhiban ? "0" : "1")
                 .Map(d => d.EventDate, x => x.IncidentTime.HasValue ? x.IncidentTime : DateTime.Now)
-               .Map(d => d.AreaCode, x => x.AreaCode)
+               .Map(d => d.AreaCode, x => x.AreaCode.Length > 6 ? x.AreaCode.Substring(0, 6) : x.AreaCode)
                .Map(d => d.CaseSerial, x => x.ProvinceNo)
                .Map(d => d.CaseSource, x => x.SourceChannelCode)
                .Map(d => d.CaseAddress, x => x.Province + x.City + x.County + x.Street)
@@ -76,11 +76,10 @@ namespace DataSharing.Application.Mappers
             .Map(d => d.ProcessTime, x => x.WorkflowTrace.HandleTime)
             .Map(d => d.ProcessName, x => x.WorkflowTrace.HandlerName)
             .Map(d => d.ProcessNote, x => string.IsNullOrEmpty(x.WorkflowTrace.Opinion) == false ? x.WorkflowTrace.Opinion : x.Order.ActualOpinion)
-            .Map(d => d.EndAreaCode, x => string.IsNullOrEmpty(x.WorkflowTrace.HandlerOrgAreaCode) == false ? x.WorkflowTrace.HandlerOrgAreaCode : x.Order.AreaCode)
-            .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.Order.County) == false ? x.Order.County : x.Order.City)// x.WorkflowTrace.HandlerOrgAreaName
-
+            .Map(d => d.EndAreaCode, x => x.WorkflowTrace.HandlerOrgAreaCode)
+            .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.WorkflowTrace.HandlerOrgAreaName) == false ? x.WorkflowTrace.HandlerOrgAreaName : "宜宾市")// x.WorkflowTrace.HandlerOrgAreaName
             .Map(d => d.CaseId, x => x.WorkflowTrace.Id)
-            .Map(d => d.AreaCode, x => x.Order.AreaCode)
+            .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
             .Map(d => d.CliengGuid, x => x.WorkflowTrace.Id)
             ;
 
@@ -91,10 +90,10 @@ namespace DataSharing.Application.Mappers
             .Map(d => d.ProcessTime, x => x.WorkflowTrace.HandleTime)
             .Map(d => d.ProcessName, x => x.WorkflowTrace.HandlerName)
             .Map(d => d.ProcessNote, x => string.IsNullOrEmpty(x.WorkflowTrace.Opinion) == false ? x.WorkflowTrace.Opinion : x.Order.ActualOpinion)
-            .Map(d => d.EndAreaCode, x => string.IsNullOrEmpty(x.WorkflowTrace.HandlerOrgAreaCode) == false ? x.WorkflowTrace.HandlerOrgAreaCode : x.Order.AreaCode)
-            .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.Order.County) == false ? x.Order.County : x.Order.City)// x.WorkflowTrace.HandlerOrgAreaName
+            .Map(d => d.EndAreaCode, x => x.WorkflowTrace.HandlerOrgAreaCode)
+            .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.WorkflowTrace.HandlerOrgAreaName) == false ? x.WorkflowTrace.HandlerOrgAreaName : "宜宾市")// x.WorkflowTrace.HandlerOrgAreaName
            .Map(d => d.TrowGuid, x => x.WorkflowTrace.Id)
-           .Map(d => d.AreaCode, x => x.Order.AreaCode)
+           .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
             .Map(d => d.CliengGuid, x => x.WorkflowTrace.Id)
            ;
 
@@ -120,7 +119,7 @@ namespace DataSharing.Application.Mappers
             .Map(d => d.ApplyOuname, x => x.ApplyOrgName)
             .Map(d => d.ApplyReason, x => x.DelayReason)
             .Map(d => d.CaseSerial, x => x.Order.ProvinceNo)
-            .Map(d => d.AreaCode, x => x.Order.AreaCode)
+            .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
             ;
 
             //接收
@@ -141,7 +140,7 @@ namespace DataSharing.Application.Mappers
            .Map(d => d.IsSecret, x => x.CaseIsSecrect == "1" ? true : false)
            //  .Map(d => d.IsPublicity, x => x.CaseIsPublic == "1" ? true : false)
            .Map(d => d.ExpiredTimeProvince, x => x.TfdBackTimeBf)
-           .Map(d => d.AreaCode, x => x.AreaCode)
+           .Map(d => d.AreaCode, x => x.AreaCode.Length > 6 ? x.AreaCode.Substring(0, 6) : x.AreaCode)
            .Map(d => d.Street, x => x.CaseAddress)
            .Map(d => d.IncidentTime, x => x.EventDate)
            .Map(d => d.SourceChannelCode, x => x.CaseSource)
@@ -158,9 +157,9 @@ namespace DataSharing.Application.Mappers
            .Map(d => d.EndName, x => x.Order.ActualHandlerName)
            .Map(d => d.SendTime, x => x.Order.ActualHandleStepCreateTime)
            .Map(d => d.FdBack, x => x.Order.ActualOpinion)
-           .Map(d => d.AreaCode, x => x.Order.AreaCode)
-           .Map(d => d.EndAreaCode, x => string.IsNullOrEmpty(x.Order.ActualHandleOrgAreaCode) == false ? x.Order.ActualHandleOrgAreaCode : x.Order.AreaCode)
-           .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.Order.County) == false ? x.Order.County : x.Order.City)
+           .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
+           .Map(d => d.EndAreaCode, x => x.Order.ActualHandleOrgAreaCode)
+           .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.Order.ActualHandleOrgAreaName) == false ? x.Order.ActualHandleOrgAreaName : "宜宾市")
            .Map(d => d.SignTimeBf, x => x.Order.ExpiredTime)
            .Map(d => d.SignTime, x => x.Order.ActualHandleStepAcceptTime)
            .Map(d => d.FdBackTimeBf, x => x.Order.ExpiredTime)
@@ -179,9 +178,9 @@ namespace DataSharing.Application.Mappers
            .Map(d => d.EndName, x => x.ActualHandlerName)
            .Map(d => d.SendTime, x => x.ActualHandleStepCreateTime)//CenterToOrgTime
            .Map(d => d.FdBack, x => x.ActualOpinion)
-           .Map(d => d.AreaCode, x => x.AreaCode)
-           .Map(d => d.EndAreaCode, x => string.IsNullOrEmpty(x.ActualHandleOrgAreaCode) == false ? x.ActualHandleOrgAreaCode : x.AreaCode)
-           .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.County) == false ? x.County : x.City)
+           .Map(d => d.AreaCode, x => x.AreaCode.Length > 6 ? x.AreaCode.Substring(0, 6) : x.AreaCode)
+           .Map(d => d.EndAreaCode, x => x.ActualHandleOrgAreaCode)
+           .Map(d => d.EndAreaName, x => string.IsNullOrEmpty(x.ActualHandleOrgAreaName) == false ? x.ActualHandleOrgAreaName : "宜宾市")
            .Map(d => d.SignTime, x => x.ActualHandleStepAcceptTime)
            .Map(d => d.FdBackTime, x => x.ActualHandleTime)
            .Map(d => d.HandleTimeLong, x => x.HandleDurationWorkday)
@@ -198,7 +197,7 @@ namespace DataSharing.Application.Mappers
            .Map(d => d.AuditSecondName, x => x.CreatorName)
            .Map(d => d.PublishDate, x => x.CreationTime)
            .Map(d => d.PublicOpinion, x => x.ArrangeOpinion)
-           .Map(d => d.AreaCode, x => x.Order.AreaCode)
+           .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
             ;
 
             //通话记录
@@ -219,7 +218,7 @@ namespace DataSharing.Application.Mappers
             //发起甄别
             config.ForType<PublishScreenDto, ScreenCaseInfoSendInfo>()
             .Map(d => d.CaseSerial, x => x.Order.ProvinceNo)
-            .Map(d => d.AreaCode, x => x.Order.AreaCode)
+            .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
            .Map(d => d.ApplyName, x => x.Screen.CreatorName)
            .Map(d => d.ApplyTime, x => x.Screen.CreationTime)
            .Map(d => d.ApplyOuName, x => x.Screen.CreatorOrgName)
@@ -229,7 +228,7 @@ namespace DataSharing.Application.Mappers
             //服务工单督办过程
             config.ForType<PublishSuperviseDto, SendSuperviseProcessInfo>()
              .Map(d => d.SuperviseSerial, x => x.Supervise.SuperviseSerial)
-             .Map(d => d.AreaCode, x => x.Order.AreaCode)
+             .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
              .Map(d => d.ReplyName, x => x.Supervise.SignUser)
             .Map(d => d.ReplyTime, x => x.Supervise.SignTime)
             //.Map(d => d.ReplyOpinion, x => x.Supervise.ReplyContent)
@@ -238,7 +237,7 @@ namespace DataSharing.Application.Mappers
             //服务工单督办结果
             config.ForType<PublishSuperviseDto, SendSuperviseResultInfo>()
             .Map(d => d.SuperviseSerial, x => x.Supervise.SuperviseSerial)
-            .Map(d => d.AreaCode, x => x.Order.AreaCode)
+            .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
             .Map(d => d.EndName, x => x.Supervise.ReUser)
            .Map(d => d.EndDate, x => x.Supervise.ReplyTime)
            .Map(d => d.EndOpinion, x => x.Supervise.ReplyContent)
@@ -249,7 +248,7 @@ namespace DataSharing.Application.Mappers
             .Map(d => d.RemindTime, x => x.Urge.CreationTime)
             .Map(d => d.RemindName, x => x.Urge.CrUser)
             .Map(d => d.RemindReasion, x => x.Urge.ApplyContent)
-           .Map(d => d.AreaCode, x => x.Order.AreaCode)
+           .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
            .Map(d => d.CaseSerial, x => x.Order.ProvinceNo)
            ;
 
@@ -260,7 +259,7 @@ namespace DataSharing.Application.Mappers
             .Map(d => d.DealDept, x => x.SendBack.CreatorOrgName)
            .Map(d => d.DealName, x => x.SendBack.CreatorName)
            .Map(d => d.CaseSerial, x => x.Order.ProvinceNo)
-           .Map(d => d.AreaCode, x => x.Order.AreaCode)
+           .Map(d => d.AreaCode, x => x.Order.AreaCode.Length > 6 ? x.Order.AreaCode.Substring(0, 6) : x.Order.AreaCode)
            .Map(d => d.ApplyTime, x => x.SendBack.CreationTime)
            .Map(d => d.BackReason, x => string.IsNullOrEmpty(x.SendBack.AuditOpinion) ? x.SendBack.Content : x.SendBack.AuditOpinion)
            ;
@@ -590,6 +589,8 @@ namespace DataSharing.Application.Mappers
             #region 企业服务
             //企业数据推送
             config.ForType<OrderDto, PushWorkOrder>()
+                .Map(d => d.EnterpriseCode, x => x.EnterpriseCode)
+                .Map(d => d.SpecialTeamCode, x => x.ZhuanBanCode)
                .Map(d => d.WorkOrderTitle, x => x.Title)
                .Map(d => d.WorkOrderNo, x => x.No)
                .Map(d => d.AcceptTime, x => x.CreationTime)
@@ -600,7 +601,7 @@ namespace DataSharing.Application.Mappers
                .Map(d => d.HotspotType, x => x.HotspotSpliceName)
                .Map(d => d.AppealContent, x => x.Content)
                .Map(d => d.UrgencyDegree, x => x.EmergencyLevel.ToString())
-               .Map(d => d.RegionCode, x => x.AreaCode)
+               .Map(d => d.RegionCode, x => x.AreaCode.Length > 6 ? x.AreaCode.Substring(0, 6) : x.AreaCode)
                .Map(d => d.ExpirationTime, x => x.ExpiredTime)
                .Map(d => d.IncidentTime, x => x.IncidentTime)
               ;

+ 79 - 8
src/DataSharing.Application/Receivers/ProvinceReceiver.cs

@@ -126,6 +126,9 @@ namespace DataSharing.Application.Receivers
 
                 foreach (var dto in dtos.SendDatas)
                 {
+                    if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                        dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                     //处理110退回事件
                     if (dto.Order.Source == ESource.Police110)
                     {
@@ -202,6 +205,9 @@ namespace DataSharing.Application.Receivers
             //工单是省上派下来的,才能进行督办回复
             if (dto.Order.Source == ESource.ProvinceStraight)
             {
+                if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                    dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                 var validator = new SendSuperviseProcessInfoValidator();
                 var validResult = await validator.ValidateAsync(dto, cancellationToken);
                 if (!validResult.IsValid)
@@ -235,6 +241,10 @@ namespace DataSharing.Application.Receivers
             //工单是省上派下来的,才能进行督办回复
             if (dto.Order.Source == ESource.ProvinceStraight)
             {
+
+                if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                    dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                 var validator = new SendSuperviseResultInfoValidator();
                 var validResult = await validator.ValidateAsync(dto, cancellationToken);
                 if (!validResult.IsValid)
@@ -267,6 +277,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderScreenApply)]
         public async Task ScreenCaseInfoSendAsync(PublishScreenDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             //如果是省上派下来的工单,才能调发起甄别的接口
             if (dto.Order.Source == ESource.ProvinceStraight && dto.Order.IsProvince)
             {
@@ -307,6 +320,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderApplyDelay)]
         public async Task DelayCaseInfoSendAsync(PublishOrderDelayDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             var validator = new DelayCaseInfoSendInfoValidator();
             var validResult = await validator.ValidateAsync(dto, cancellationToken);
             if (!validResult.IsValid)
@@ -343,6 +359,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderFlowStarted)]
         public async Task OrderFlowStartedAsync(PublishCallRecrodDto pushdto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(pushdto.Order.AreaCode) || pushdto.Order.AreaCode.Contains("519"))
+                pushdto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             var dto = pushdto.Order;
 
             var configProvince = _channelConfigurationManager.GetConfigurationProvince();
@@ -372,7 +391,7 @@ namespace DataSharing.Application.Receivers
             if (pushdto.TrCallRecordDto is not null)
             {
                 var dataCall = _mapper.Map<SubmitCaseRecordInfo>(pushdto.TrCallRecordDto);
-                dataCall.AreaCode = dto.AreaCode;
+                dataCall.AreaCode = dto.AreaCode.Length > 6 ? dto.AreaCode.Substring(0, 6) : dto.AreaCode;
                 dataCall.CaseSerial = dto.ProvinceNo;
 
                 //处理通话记录时间
@@ -442,6 +461,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderExpiredTimeUpdate)]
         public async Task HotlineOrderFlowRecalledAsync(OrderDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.AreaCode) || dto.AreaCode.Contains("519"))
+                dto.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             //如果不是省上派下来的工单,需要汇聚到省上
             if (!dto.IsProvince)
             {
@@ -471,9 +493,19 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderFlowHandled)]
         public async Task SubmitCaseProcessAsync(OrderFlowDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
+            if (string.IsNullOrEmpty(dto.WorkflowTrace.HandlerOrgAreaCode))
+            {
+                dto.WorkflowTrace.HandlerOrgAreaCode = dto.Order.AreaCode;
+                if (dto.WorkflowTrace.HandlerOrgAreaCode.Length > 6)
+                    dto.WorkflowTrace.HandlerOrgAreaCode = dto.WorkflowTrace.HandlerOrgAreaCode.Substring(0, 6);
+            }
+
             await SubmitCaseProcessFlowAsync(dto, cancellationToken);
             //期满时间变更或者办理节点为话务部,重新推送数据
-            if (dto.ExpiredTimeChanged || dto.Order.ActualHandleStepName == "话务部")
+            if ((dto.ExpiredTimeChanged || dto.Order.ActualHandleStepName == "话务部") && !dto.Order.IsProvince)
             {
                 var submitCaseInfo = InitDataAsync(dto.Order);
                 var validator = new SubmitCaseInfoValidator();
@@ -529,6 +561,16 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderFiled)]
         public async Task OrderFiledAsync(OrderFlowDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
+            if (string.IsNullOrEmpty(dto.Order.ActualHandleOrgAreaCode))
+            {
+                dto.Order.ActualHandleOrgAreaCode = dto.Order.AreaCode;
+                if (dto.Order.ActualHandleOrgAreaCode.Length > 6)
+                    dto.Order.ActualHandleOrgAreaCode = dto.Order.ActualHandleOrgAreaCode.Substring(0, 6);
+            }
+
             //先看看需要处理工单数据不
             SubmitCaseInfo data = new();
             if (dto != null && dto.Order != null && !dto.Order.IsProvince)
@@ -571,7 +613,7 @@ namespace DataSharing.Application.Receivers
             if (dto.TrCallRecordDto is not null)
             {
                 var dataCall = _mapper.Map<SubmitCaseRecordInfo>(dto.TrCallRecordDto);
-                dataCall.AreaCode = dto.Order.AreaCode;
+                dataCall.AreaCode = dto.Order.AreaCode.Length > 6 ? dto.Order.AreaCode.Substring(0, 6) : dto.Order.AreaCode;
                 dataCall.CaseSerial = dto.Order.ProvinceNo;
 
                 //处理通话记录时间
@@ -663,13 +705,21 @@ namespace DataSharing.Application.Receivers
             var data = _mapper.Map<SubmitCaseRecordInfo>(dto.TrCallRecordDto);
             if (dto.Order != null)
             {
-                data.AreaCode = dto.Order.AreaCode;
+                if (string.IsNullOrEmpty(dto.Order.AreaCode))
+                    data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                 if (!string.IsNullOrEmpty(dto.Order.ProvinceNo))
                     data.CaseSerial = dto.Order.ProvinceNo;
             }
             else
                 data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
 
+            if (data.AreaCode.Contains("519"))
+                data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
+            if (data.AreaCode.Length > 6)
+                data.AreaCode = data.AreaCode.Substring(0, 6);
+
             if (string.IsNullOrEmpty(data.CaseSerial))
                 data.CaseSerial = "";
 
@@ -706,13 +756,21 @@ namespace DataSharing.Application.Receivers
             var data = _mapper.Map<SubmitCaseRecordInfo>(dto.TrCallRecordDto);
             if (dto.Order != null)
             {
-                data.AreaCode = dto.Order.AreaCode;
+                if (string.IsNullOrEmpty(dto.Order.AreaCode))
+                    data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                 if (!string.IsNullOrEmpty(dto.Order.ProvinceNo))
                     data.CaseSerial = dto.Order.ProvinceNo;
             }
             else
                 data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
 
+            if (data.AreaCode.Contains("519"))
+                data.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
+            if (data.AreaCode.Length > 6)
+                data.AreaCode = data.AreaCode.Substring(0, 6);
+
             if (string.IsNullOrEmpty(data.CaseSerial))
                 data.CaseSerial = "";
 
@@ -795,6 +853,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderFlowRecalled)]
         public async Task RevokeOrderAsync(PublishSpecialDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             //企业服务
             if (dto.Special.OrgId == "001181")
             {
@@ -806,7 +867,7 @@ namespace DataSharing.Application.Receivers
 
                 var configEnterprise = _channelConfigurationManager.GetConfigurationEnterprise();
                 //将待推送数据写入待推送表configEnterprise.AddressUrl +
-                await InitPushDataAsync("EnterpriseCancelWorkOrder", "platform/12345/cancelWorkOrder", System.Text.Json.JsonSerializer.Serialize(dsDataWork), platformSource: EPlatformSource.Enterprise, cancellationToken: cancellationToken);
+                await InitPushDataAsync("EnterpriseCancelWorkOrder", YbEnterpriseDefaults.PathEnterprisesCancelWorkOrder, System.Text.Json.JsonSerializer.Serialize(dsDataWork), platformSource: EPlatformSource.Enterprise, cancellationToken: cancellationToken);
             }
 
             //省12345
@@ -862,6 +923,9 @@ namespace DataSharing.Application.Receivers
             //被催办部门为省上,才能调用接口
             if (dto.Urge.OrgId == "001171" || dto.Urge.OrgId == "001178")
             {
+                if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.AreaCode.Contains("519"))
+                    dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
                 var validator = new RemindCaseInfoValidator();
                 var validResult = await validator.ValidateAsync(dto, cancellationToken);
                 if (!validResult.IsValid)
@@ -895,6 +959,9 @@ namespace DataSharing.Application.Receivers
         [CapSubscribe(Hotline.Share.Mq.EventNames.HotlineOrderPublishOrder)]
         public async Task PublishOrderAsync(PublishPublishOrderDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.Source == ESource.ProvinceStraight || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             //政民互动提交公开数据验证
             if (dto.Order.SourceChannelCode == "SZMHD" && dto.ProPublishState == true)
             {
@@ -1355,6 +1422,9 @@ namespace DataSharing.Application.Receivers
         /// <returns></returns>
         private async Task SubmitVisitInfoDataAsync(PublishVisitDto dto, CancellationToken cancellationToken)
         {
+            if (string.IsNullOrEmpty(dto.Order.AreaCode) || dto.Order.AreaCode.Contains("519"))
+                dto.Order.AreaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
+
             #region 修改工单基础数据为已评价
             ////修改工单基础数据为已评价
             //var dataOrder = await _dsOrderRepository.GetAsync(p => p.OrderId == dto.Order.Id, cancellationToken);
@@ -1833,7 +1903,7 @@ namespace DataSharing.Application.Receivers
                 {
                     CaseSerial = caseSerial,
                     CliengGuid = cliengGuid,
-                    AreaCode = areaCode,
+                    AreaCode = areaCode.Length > 6 ? areaCode.Substring(0, 6) : areaCode,
                     MaterialType = materialType switch
                     {
                         EMaterialType.Acceptance => "10",
@@ -2152,7 +2222,8 @@ namespace DataSharing.Application.Receivers
             var fileJson = _mapper.Map<List<FileJson>>(dto.FileJson);
             var configEnterprise = _channelConfigurationManager.GetConfigurationEnterprise();
             //将待推送数据写入待推送表
-            await InitPushDataAsync("EnterprisePushWorkOrder", "platform/12345/pushWorkOrder", System.Text.Json.JsonSerializer.Serialize(enterpriseData), platformSource: EPlatformSource.Enterprise, fileJson: fileJson, cancellationToken: cancellationToken);
+            await InitPushDataAsync("EnterprisePushWorkOrder", YbEnterpriseDefaults.PathEnterprisesWorkOrder, System.Text.Json.JsonSerializer.Serialize(enterpriseData),
+                platformSource: EPlatformSource.Enterprise, fileJson: fileJson, cancellationToken: cancellationToken);
 
         }
         #endregion

+ 5 - 1
src/DataSharing.Host/Controllers/EnterpriseController.cs

@@ -16,6 +16,7 @@ using Microsoft.Extensions.Options;
 using XF.Domain.Filters;
 using XF.Domain.Options;
 using XF.Domain.Repository;
+using static Org.BouncyCastle.Math.EC.ECCurve;
 
 namespace DataSharing.Host.Controllers
 {
@@ -100,7 +101,10 @@ namespace DataSharing.Host.Controllers
             var enterpriseList = _mapper.Map<SelectEnterpriseList>(dto);
 
             var configEnterprise = _channelConfigurationManager.GetConfigurationEnterprise();
-            var response = await _enterpriseClient.RequestAsync<EnterpriseResponse>(configEnterprise.AddressUrl + "platform/12345/selectEnterpriseList", "Post", System.Text.Json.JsonSerializer.Serialize(enterpriseList), HttpContext.RequestAborted);
+            string baseAddress = configEnterprise.AddressUrl;
+            if (!baseAddress.EndsWith('/'))
+                baseAddress += "/";
+            var response = await _enterpriseClient.RequestAsync<EnterpriseResponse>(baseAddress + YbEnterpriseDefaults.PathEnterprisesList, "Post", System.Text.Json.JsonSerializer.Serialize(enterpriseList), HttpContext.RequestAborted);
 
             if (response != null)
             {

+ 13 - 1
src/DataSharing.Share/Dtos/Enterprise/TokenEnterprise.cs

@@ -8,6 +8,12 @@ namespace DataSharing.Share.Dtos.Enterprise
     [Serializable]
     public class TokenEnterprise
     {
+        /// <summary>
+        /// 状态
+        /// </summary>
+        [JsonPropertyName("code")]
+        public int Code { get; set; }
+
         /// <summary>
         /// 
         /// </summary>
@@ -19,6 +25,12 @@ namespace DataSharing.Share.Dtos.Enterprise
         /// </summary>
         [JsonPropertyName("data")]
         public TokenTokenEnterpriseInfo TokenInfo { get; set; }
+
+        /// <summary>
+        /// 消息
+        /// </summary>
+        [JsonPropertyName("msg")]
+        public string Message { get; set; }
     }
 
     /// <summary>
@@ -48,6 +60,6 @@ namespace DataSharing.Share.Dtos.Enterprise
         /// token有效期,单位秒
         /// </summary>
         [JsonPropertyName("expires_in")]
-        public string ExpiresIn { get; set; }
+        public int ExpiresIn { get; set; }
     }
 }

+ 25 - 0
src/DataSharing.Share/Dtos/Enterprise/YbEnterpriseDefaults.cs

@@ -0,0 +1,25 @@
+namespace DataSharing.Share.Dtos.Enterprise
+{
+    public class YbEnterpriseDefaults
+    {
+        /// <summary>
+        /// token
+        /// </summary>
+        public const string PathToken = "blade-auth/oauth/getAccessToken";
+
+        /// <summary>
+        /// 企业列表
+        /// </summary>
+        public const string PathEnterprisesList = "platform/12345/selectEnterpriseList";
+
+        /// <summary>
+        /// 工单推送
+        /// </summary>
+        public const string PathEnterprisesWorkOrder = "platform/12345/pushWorkOrder";
+
+        /// <summary>
+        /// 撤单
+        /// </summary>
+        public const string PathEnterprisesCancelWorkOrder = "platform/12345/cancelWorkOrder";
+    }
+}

+ 4 - 4
src/DataSharing/Enterprise/EnterpriseClient.cs

@@ -6,6 +6,7 @@ using System.Net.Http.Headers;
 using XF.Domain.Cache;
 using XF.Domain.Dependency;
 using XF.Domain.Exceptions;
+using static IdentityModel.OidcConstants;
 
 namespace DataSharing.Enterprise
 {
@@ -40,8 +41,8 @@ namespace DataSharing.Enterprise
 
             var token = cacheToken.GetOrSet(KeyToken,
                    d => GetTokenAsync(cancellationToken).GetAwaiter().GetResult(),
-                   TimeSpan.FromMinutes(28));
-
+                   TimeSpan.FromMinutes(118));
+            _logger.LogWarning("请求接口地址:--------------" + url);
             var configEnterprise = channelconfigManager.GetConfigurationEnterprise();
             return await httpInvoker.RequestStringContentAsync<TResponse>(url, httpMethod, stringContent,
                 d => d.SetHttpClient(configEnterprise.AddressUrl, token), cancellationToken);
@@ -71,7 +72,7 @@ namespace DataSharing.Enterprise
 
             var request = new ClientCredentialsTokenRequest
             {
-                Address = $"{baseAddress}blade-auth/oauth/getAccessToken",
+                Address = $"{baseAddress}{YbEnterpriseDefaults.PathToken}",
                 Headers =
                 {
                     Accept =
@@ -89,7 +90,6 @@ 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)

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

@@ -66,11 +66,11 @@ namespace DataSharing.Enterprise
                     try
                     {
                         #region 读取数据
-                        var baseAddress = businessFile.BaseUrl;
-                        if (!baseAddress.EndsWith('/'))
-                            baseAddress += "/";
+                        var baseAddressFile = businessFile.BaseUrl;
+                        if (!baseAddressFile.EndsWith('/'))
+                            baseAddressFile += "/";
 
-                        string url = string.Format("{0}{1}?Source={2}&Id={3}", baseAddress, businessFile.DownloadUrlAddress, businessFile.Source, item.FileId);
+                        string url = string.Format("{0}{1}?Source={2}&Id={3}", baseAddressFile, businessFile.DownloadUrlAddress, businessFile.Source, item.FileId);
                         using (var client = _httpClientFactory.CreateClient())
                         using (var response = await client.GetAsync(url))
                         {
@@ -110,7 +110,11 @@ namespace DataSharing.Enterprise
                 request = System.Text.Json.JsonSerializer.Serialize(data);
             }
             var config = _channelConfigurationManager.GetConfigurationEnterprise();
-            var enterprise = await _enterpriseClient.RequestAsync<EnterpriseResponse>(config.AddressUrl + dto.Path, dto.HttpMethod, request, cancellationToken);
+            string baseAddress = config.AddressUrl;
+            if (!baseAddress.EndsWith('/'))
+                baseAddress += "/";
+
+            var enterprise = await _enterpriseClient.RequestAsync<EnterpriseResponse>(baseAddress + dto.Path, dto.HttpMethod, request, cancellationToken);
             //如果推送成功修改数据状态
             if (enterprise != null)
             {