Selaa lähdekoodia

取消查询历史数据

tangjiang 5 kuukautta sitten
vanhempi
commit
f4af7273d0
1 muutettua tiedostoa jossa 52 lisäystä ja 50 poistoa
  1. 52 50
      src/Hotline.Api/Controllers/DataSharingController.cs

+ 52 - 50
src/Hotline.Api/Controllers/DataSharingController.cs

@@ -208,7 +208,7 @@ namespace Hotline.Api.Controllers
         [AllowAnonymous]
         public async Task<PagedDto<PublishOrderAllDto>> GetOrderByListAllOpen([FromBody] GetOrderList dto)
         {
-            var queryNew = _orderRepository.Queryable()
+            var (total, items) = await _orderRepository.Queryable()
                 .Where(p => p.IsPublicity == true)
                 .WhereIF(!string.IsNullOrEmpty(dto.No), p => p.No == dto.No)
                 .WhereIF(!string.IsNullOrEmpty(dto.Title), p => p.Title.Contains(dto.Title))
@@ -217,56 +217,58 @@ namespace Hotline.Api.Controllers
                 .WhereIF(dto.StartTime.HasValue, p => p.CreationTime >= dto.StartTime)
                 .WhereIF(dto.EndTime.HasValue, p => p.CreationTime < dto.EndTime)
                 .WhereIF(!string.IsNullOrEmpty(dto.AreaCode), p => p.AreaCode == dto.AreaCode)
+               .OrderByDescending(p => p.CreationTime)
                 .Select(p => new PublishOrderAllDto
-               {
-                   OrderId = p.Id,
-                   FromName = p.FromName,
-                   Contact = p.Contact,
-                   OrderNo = p.No,
-                   Title = p.Title,
-                   SourceChannel = p.SourceChannel,
-                   SourceChannelCode = p.SourceChannelCode,
-                   AcceptType = p.AcceptType,
-                   AcceptTypeCode = p.AcceptTypeCode,
-                   HotspotName = p.HotspotName,
-                   Content = p.Content,
-                   State = p.Status >= EOrderStatus.Filed ? "办理完成" : "办理中",
-                   ActualOpinion = p.ActualOpinion,
-                   AcceptTime = p.CreationTime,
-                   PubDate = p.OrderPublish.CreationTime,
-                   FiledTime = p.FiledTime
-               });
-
-            var queryold = _oldPublicDataRepository.Queryable()
-                      .WhereIF(!string.IsNullOrEmpty(dto.No), p => p.OrderNo == dto.No)
-                      .WhereIF(!string.IsNullOrEmpty(dto.Title), p => p.Title.Contains(dto.Title))
-                      .WhereIF(!string.IsNullOrEmpty(dto.Mobile), p => p.Contact.Contains(dto.Mobile))
-                      .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), p => p.AcceptTypeCode == dto.AcceptTypeCode)
-                      .WhereIF(dto.StartTime.HasValue, p => p.PubDate >= dto.StartTime)
-                      .WhereIF(dto.EndTime.HasValue, p => p.PubDate < dto.EndTime)
-                       .Select(p => new PublishOrderAllDto
-                       {
-                           OrderId = p.OrderId,
-                           FromName = p.FromName,
-                           Contact = p.Contact,
-                           OrderNo = p.OrderNo,
-                           Title = p.Title,
-                           SourceChannel = p.SourceChannel,
-                           SourceChannelCode = p.SourceChannelCode,
-                           AcceptType = p.AcceptType,
-                           AcceptTypeCode = p.AcceptTypeCode,
-                           HotspotName = p.HotspotName,
-                           Content = p.Content,
-                           State = p.State == "1" ? "办理完成" : "办理中",
-                           ActualOpinion = p.ActualOpinion,
-                           AcceptTime = p.CreationTime,
-                           PubDate = p.PubDate,
-                           FiledTime = p.FiledTime
-                       });
-
-            var (total, items) = await _orderRepository.UnionAll(queryNew, queryold)
-                .OrderByDescending(p => p.PubDate)
-                 .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
+                {
+                    OrderId = p.Id,
+                    FromName = p.FromName,
+                    Contact = p.Contact,
+                    OrderNo = p.No,
+                    Title = p.Title,
+                    SourceChannel = p.SourceChannel,
+                    SourceChannelCode = p.SourceChannelCode,
+                    AcceptType = p.AcceptType,
+                    AcceptTypeCode = p.AcceptTypeCode,
+                    HotspotName = p.HotspotName,
+                    Content = p.Content,
+                    State = p.Status >= EOrderStatus.Filed ? "办理完成" : "办理中",
+                    ActualOpinion = p.ActualOpinion,
+                    AcceptTime = p.CreationTime,
+                    PubDate = p.OrderPublish.CreationTime,
+                    FiledTime = p.FiledTime
+                })
+                .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
+
+            //var queryold = _oldPublicDataRepository.Queryable()
+            //          .WhereIF(!string.IsNullOrEmpty(dto.No), p => p.OrderNo == dto.No)
+            //          .WhereIF(!string.IsNullOrEmpty(dto.Title), p => p.Title.Contains(dto.Title))
+            //          .WhereIF(!string.IsNullOrEmpty(dto.Mobile), p => p.Contact.Contains(dto.Mobile))
+            //          .WhereIF(!string.IsNullOrEmpty(dto.AcceptTypeCode), p => p.AcceptTypeCode == dto.AcceptTypeCode)
+            //          .WhereIF(dto.StartTime.HasValue, p => p.PubDate >= dto.StartTime)
+            //          .WhereIF(dto.EndTime.HasValue, p => p.PubDate < dto.EndTime)
+            //           .Select(p => new PublishOrderAllDto
+            //           {
+            //               OrderId = p.OrderId,
+            //               FromName = p.FromName,
+            //               Contact = p.Contact,
+            //               OrderNo = p.OrderNo,
+            //               Title = p.Title,
+            //               SourceChannel = p.SourceChannel,
+            //               SourceChannelCode = p.SourceChannelCode,
+            //               AcceptType = p.AcceptType,
+            //               AcceptTypeCode = p.AcceptTypeCode,
+            //               HotspotName = p.HotspotName,
+            //               Content = p.Content,
+            //               State = p.State == "1" ? "办理完成" : "办理中",
+            //               ActualOpinion = p.ActualOpinion,
+            //               AcceptTime = p.CreationTime,
+            //               PubDate = p.PubDate,
+            //               FiledTime = p.FiledTime
+            //           });
+
+            //var (total, items) = await _orderRepository.UnionAll(queryNew, queryold)
+            //    .OrderByDescending(p => p.PubDate)
+            //     .ToPagedListAsync(dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
 
             return new PagedDto<PublishOrderAllDto>(total, items);
         }