tangjiang před 7 měsíci
rodič
revize
a9c0d7e9c8

+ 27 - 23
src/DataSharing.Host/Controllers/YiBin/ConvergenceMediaController.cs

@@ -16,6 +16,7 @@ using MapsterMapper;
 using MediatR;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
+using System.Drawing.Printing;
 using XF.Domain.Filters;
 using XF.Domain.Repository;
 
@@ -459,25 +460,26 @@ namespace DataSharing.Host.Controllers.YiBin
             }
 
             //数据处理
-            string acceptTypeCode = (object)dto.PurTypeID switch
+            string acceptTypeCode = dto.PurTypeID switch
             {
-                17 => "10",
-                18 => "30",
-                19 => "35",
-                20 => "20",
-                21 => "15",
-                25 => "40",
+                "17" => "10",
+                "18" => "30",
+                "19" => "35",
+                "20" => "20",
+                "21" => "15",
+                "25" => "40",
                 _ => "",
             };
-
+            int pageIndex = string.IsNullOrEmpty(dto.CurrentPage) == true ? 1 : Convert.ToInt32(dto.CurrentPage);
+            int pageSize = string.IsNullOrEmpty(dto.PageSize) == true ? 1 : Convert.ToInt32(dto.PageSize);
             GetOrderList getOrder = new GetOrderList()
             {
                 Title = dto.Title,
                 AcceptTypeCode = acceptTypeCode,
                 StartTime = string.IsNullOrEmpty(dto.StartDate) == true ? null : Convert.ToDateTime(dto.StartDate),
                 EndTime = string.IsNullOrEmpty(dto.EndDate) == true ? null : Convert.ToDateTime(dto.EndDate).AddDays(1),
-                PageIndex = dto.CurrentPage,
-                PageSize = dto.PageSize
+                PageIndex = pageIndex,
+                PageSize = pageSize,
             };
 
             var result = await _fwClient.RequestNoTokenAsync<HotlineClientDataSharingResponse<PagedDto<PublishDto>>>("api/v1/DataSharing/get_order_list_publish",
@@ -489,14 +491,14 @@ namespace DataSharing.Host.Controllers.YiBin
                 if (result.result.Items != null && result.result.Items.Count > 0)
                 {
                     //计算总页数
-                    nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(result.result.Total) / dto.PageSize));
+                    nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(result.result.Total) / pageSize));
                     int rowID = 0;
                     foreach (var item in result.result.Items)
                     {
                         rowID++;
                         listData.Add(new GetOrderMediaDataListDto()
                         {
-                            RowID = ((dto.CurrentPage - 1) * dto.PageSize) + rowID + "",
+                            RowID = ((pageIndex - 1) * pageSize) + rowID + "",
                             FlowID = item.Id,
                             Code = item.No,
                             Title = item.Title,
@@ -971,14 +973,14 @@ namespace DataSharing.Host.Controllers.YiBin
 
             //数据处理
             string acceptTypeCode = "";
-            acceptTypeCode = (object)dto.PurTypeID switch
+            acceptTypeCode = dto.PurTypeID switch
             {
-                17 => "10",
-                18 => "30",
-                19 => "35",
-                20 => "20",
-                21 => "15",
-                25 => "40",
+                "17" => "10",
+                "18" => "30",
+                "19" => "35",
+                "20" => "20",
+                "21" => "15",
+                "25" => "40",
                 _ => "",
             };
             string areaCode = "";
@@ -1021,14 +1023,16 @@ namespace DataSharing.Host.Controllers.YiBin
                     break;
             }
 
+            int pageIndex = string.IsNullOrEmpty(dto.CurrentPage) == true ? 1 : Convert.ToInt32(dto.CurrentPage);
+            int pageSize = string.IsNullOrEmpty(dto.PageSize) == true ? 1 : Convert.ToInt32(dto.PageSize);
             GetOrderList getOrder = new GetOrderList()
             {
                 Title = dto.Title,
                 AcceptTypeCode = acceptTypeCode,
                 StartTime = string.IsNullOrEmpty(dto.StartDate) == true ? null : Convert.ToDateTime(dto.StartDate),
                 EndTime = string.IsNullOrEmpty(dto.EndDate) == true ? null : Convert.ToDateTime(dto.EndDate).AddDays(1),
-                PageIndex = dto.CurrentPage,
-                PageSize = dto.PageSize,
+                PageIndex = pageIndex,
+                PageSize = pageSize,
                 AreaCode = areaCode
             };
 
@@ -1041,14 +1045,14 @@ namespace DataSharing.Host.Controllers.YiBin
                 if (result.result.Items != null && result.result.Items.Count > 0)
                 {
                     //计算总页数
-                    nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(result.result.Total) / dto.PageSize));
+                    nPageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(result.result.Total) /pageSize));
                     int rowID = 0;
                     foreach (var item in result.result.Items)
                     {
                         rowID++;
                         listData.Add(new GetOrderMediaDataListDto()
                         {
-                            RowID = ((dto.CurrentPage - 1) * dto.PageSize) + rowID + "",
+                            RowID = ((pageIndex - 1) * pageSize) + rowID + "",
                             FlowID = item.Id,
                             Code = item.No,
                             Title = item.Title,

+ 6 - 6
src/DataSharing.Share/Dtos/YiBin/ConvergenceMedia/GetOrderMediaReceiveOpenDto.cs

@@ -13,32 +13,32 @@
         /// <summary>
         /// 标题
         /// </summary>
-        public string Title { get; set; }
+        public string? Title { get; set; }
 
         /// <summary>
         /// 受理类型编码
         /// </summary>
-        public int PurTypeID { get; set; }
+        public string? PurTypeID { get; set; }
 
         /// <summary>
         /// 开始时间(格式:2020-01-01)
         /// </summary>
-        public string StartDate { get; set; }
+        public string? StartDate { get; set; }
 
         /// <summary>
         /// 结束时间(格式:2020-01-01)
         /// </summary>
-        public string EndDate { get; set; }
+        public string? EndDate { get; set; }
 
         /// <summary>
         /// 当前页
         /// </summary>
-        public int CurrentPage { get; set; } = 1;
+        public string? CurrentPage { get; set; } = "1";
 
         /// <summary>
         /// 查询每页大小(每页最大20条)
         /// </summary>
-        public int PageSize { get; set; } = 10;
+        public string? PageSize { get; set; } = "10";
     }
 
     /// <summary>