tangjiang 10 months ago
parent
commit
22b618035c

+ 17 - 17
src/DataSharing.Application/Receivers/ProvinceReceiver.cs

@@ -2370,6 +2370,8 @@ namespace DataSharing.Application.Receivers
         /// 泸州市州数据提交
         /// </summary>
         /// <param name="dto"></param>
+        /// <param name="platformSource"></param>
+        /// <param name="cancellationToken"></param>
         /// <returns></returns>
         private async Task InitCityDataAsync(OrderDto dto, string platformSource, CancellationToken cancellationToken)
         {
@@ -2380,15 +2382,16 @@ namespace DataSharing.Application.Receivers
             string source = userInfo.PlatformSourceName;
             string secretKey = GetMD5(source + userInfo.AccountSecret);
 
+            var serverName = dto.IdentityType == EIdentityType.Enterprise ? "企业" : "市民";
             Dictionary<string, string> dicParam = new()
             {
                 { "Code", secretKey },
                 { "FSHCode", dto.No },
-                { "ServerName", dto.IdentityType == EIdentityType.Enterprise ? "1" : "0"},
-                { "PurTypeName",dto.AcceptType },
-                { "ConTypeName", dto.HotspotSpliceName},
-                { "Title", dto.Title},
-                { "LinkName", dto.FromName},
+                { "ServerName", HttpUtility.UrlEncode(serverName)},
+                { "PurTypeName",HttpUtility.UrlEncode(dto.AcceptType) },
+                { "ConTypeName",HttpUtility.UrlEncode( dto.HotspotSpliceName)},
+                { "Title", HttpUtility.UrlEncode(dto.Title)},
+                { "LinkName", HttpUtility.UrlEncode(dto.FromName)},
                 { "Gender",dto.FromGender switch
                     {
                         EGender.Female => "2",
@@ -2398,9 +2401,9 @@ namespace DataSharing.Application.Receivers
                 },
                 { "Mobile", dto.Contact},
                 { "Mail","" },
-                { "Address", dto.FullAddress },
-                { "Content", dto.Content},
-                { "Source",source }
+                { "Address", HttpUtility.UrlEncode( dto.FullAddress )},
+                { "Content", HttpUtility.UrlEncode(dto.Content)},
+                { "Source",HttpUtility.UrlEncode( source )}
             };
 
             var config = _channelConfigurationManager.GetConfigurationCityHandOver();
@@ -2421,33 +2424,32 @@ namespace DataSharing.Application.Receivers
         /// 办理意见推送
         /// </summary>
         /// <param name="dto"></param>
-        /// <param name="platformSource"></param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
         private async Task UndertakAdviceAsync(OrderDto dto, CancellationToken cancellationToken)
         {
             string areaCode = _channelConfigurationManager.GetConfigurationCityCode().AreaCode;
             //判断推送市州
-            string PlatformSource = "";
+            string platformSource = "";
             switch (areaCode)
             {
                 case "510500":  //转泸州12345
-                    PlatformSource = "CityDataExchangeLz";
+                    platformSource = "CityDataExchangeLz";
                     break;
                 case "510300"://转自贡12345
-                    PlatformSource = "CityDataExchangeZG";
+                    platformSource = "CityDataExchangeZG";
                     break;
                 case "511500"://转宜宾12345
-                    PlatformSource = "CityDataExchangeYB";
+                    platformSource = "CityDataExchangeYB";
                     break;
                 case "511000"://转内江12345
-                    PlatformSource = "CityDataExchangeNJ";
+                    platformSource = "CityDataExchangeNJ";
                     break;
 
                 default:
                     break;
             }
-            var userInfoSend = await _dsUserTokenInfoRepository.GetAsync(p => p.PlatformSource == dto.Source.ToString() && p.State == "1", cancellationToken);
+            var userInfoSend = await _dsUserTokenInfoRepository.GetAsync(p => p.PlatformSource == platformSource && p.State == "1", cancellationToken);
             if (userInfoSend is null)
                 return;
             string source = userInfoSend.PlatformSourceName;
@@ -2457,8 +2459,6 @@ namespace DataSharing.Application.Receivers
             if (userInfo is null)
                 return;
 
-
-
             Dictionary<string, object> dic = new()
             {
                 { "Code", secretKey }, //请求Code

+ 19 - 2
src/DataSharing.Host/Controllers/CityDataExchangeController.cs

@@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using System.Security.Cryptography;
 using System.Text;
+using System.Web;
 using XF.Domain.Filters;
 using XF.Domain.Repository;
 
@@ -56,7 +57,7 @@ namespace DataSharing.Host.Controllers
             _fwClient = fwClient;
             _dsUserTokenInfoRepository = dsUserTokenInfoRepository;
         }
-         
+
         /// <summary>
         /// 市州互转---工单推送业务
         /// </summary>
@@ -70,6 +71,15 @@ namespace DataSharing.Host.Controllers
             if (dto is null)
                 return OpenResponse.Ok(DataExchangeDeReponse.Failed(description: "数据解析失败"));
 
+            dto.ServerName = HttpUtility.UrlDecode(dto.ServerName);
+            dto.PurTypeName = HttpUtility.UrlDecode(dto.PurTypeName);
+            dto.ConTypeName = HttpUtility.UrlDecode(dto.ConTypeName);
+            dto.Title = HttpUtility.UrlDecode(dto.Title);
+            dto.LinkName = HttpUtility.UrlDecode(dto.LinkName);
+            dto.Address = HttpUtility.UrlDecode(dto.Address);
+            dto.Content = HttpUtility.UrlDecode(dto.Content);
+            dto.Source = HttpUtility.UrlDecode(dto.Source);
+
             //验证数据
             string strResult = dto.Validate();
             if (!string.IsNullOrEmpty(strResult))
@@ -153,6 +163,9 @@ namespace DataSharing.Host.Controllers
             if (dto is null)
                 return OpenResponse.Ok(DataExchangeDeReponse.Failed(description: "数据解析失败"));
 
+            dto.UndertakAdvice = HttpUtility.UrlDecode(dto.UndertakAdvice);
+            dto.Source = HttpUtility.UrlDecode(dto.Source);
+
             //验证数据
             string strResult = dto.Validate();
             if (!string.IsNullOrEmpty(strResult))
@@ -176,7 +189,11 @@ namespace DataSharing.Host.Controllers
             };
             await _dsReceiveDataExchangeDataRepository.AddAsync(data, HttpContext.RequestAborted);
 
-            TranspondCityOrderResultDto transpondCityOrderResultDto = new() { No = dto.SCDRCode, Opinion = dto.UndertakAdvice };
+            TranspondCityOrderResultDto transpondCityOrderResultDto = new()
+            {
+                No = dto.SCDRCode,
+                Opinion = dto.UndertakAdvice
+            };
             await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.SharingOrderReceiveHandleOpinionTranspondCity, transpondCityOrderResultDto, cancellationToken: HttpContext.RequestAborted);
 
             return OpenResponse.Ok(DataExchangeDeReponse.Success("", "", "您已成功提交数据!"));