lihao 4 years ago
parent
commit
f1dc7aafaf

+ 4 - 3
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminMeetingController.cs

@@ -69,7 +69,7 @@ namespace GxPress.Api.AdminControllers
         /// </summary>
         /// <returns></returns>
         [HttpDelete("location/{id}")]
-        public async Task<bool> LocationRemove([FromRoute]int id)
+        public async Task<bool> LocationRemove([FromRoute] int id)
         {
             return await _meetingLocationRepository.DeleteAsync(id);
         }
@@ -104,7 +104,8 @@ namespace GxPress.Api.AdminControllers
         [HttpGet("room")]
         public async Task<IEnumerable<MeetingRoom>> RoomList([FromQuery] MeetingRoomRequest request)
         {
-            return await _meetingRoomRepository.GetListAsync(request.LocationId);
+            var appRequest = new GxPress.Request.App.WorkMeeting.MeetingRoomRequest() { LocationId = request.LocationId,KeyWord=request.KeyWord };
+            return await _meetingRoomRepository.GetListAsync(appRequest);
         }
 
         /// <summary>
@@ -112,7 +113,7 @@ namespace GxPress.Api.AdminControllers
         /// </summary>
         /// <returns></returns>
         [HttpDelete("room/{id}")]
-        public async Task<bool> RoomRemove([FromRoute]int id)
+        public async Task<bool> RoomRemove([FromRoute] int id)
         {
             return await _meetingRoomRepository.DeleteAsync(id);
         }

+ 14 - 14
gx_api/GxPress/Api/GxPress.Api/AppControllers/AppMeetingController.cs

@@ -42,18 +42,18 @@ namespace GxPress.Api.AppControllers
         private readonly IUserMiddleService _userMiddleService;
         private readonly IAnalyzeService _analyzeService;
         private readonly ICommentRepository _commentRepository;
-        public AppMeetingController(ILoginContext loginContext, 
-        IMeetingLocationRepository meetingLocationRepository, 
-        IMeetingOrderRepository meetingOrderRepository, 
-        IMeetingRepository meetingRepository, 
-        IMeetingRoomRepository meetingRoomRepository, 
-        IMeetingSummaryRepository meetingSummaryRepository, 
-        IUserRepository userRepository, 
-        IMeetingService meetingService, 
-        IMeetingSummaryTodoRepository meetingSummaryTodoRepository, 
-        IFlowAttachmentRepository flowAttachmentRepository, 
-        IUserMiddleService userMiddleService, 
-        IAnalyzeService analyzeService, 
+        public AppMeetingController(ILoginContext loginContext,
+        IMeetingLocationRepository meetingLocationRepository,
+        IMeetingOrderRepository meetingOrderRepository,
+        IMeetingRepository meetingRepository,
+        IMeetingRoomRepository meetingRoomRepository,
+        IMeetingSummaryRepository meetingSummaryRepository,
+        IUserRepository userRepository,
+        IMeetingService meetingService,
+        IMeetingSummaryTodoRepository meetingSummaryTodoRepository,
+        IFlowAttachmentRepository flowAttachmentRepository,
+        IUserMiddleService userMiddleService,
+        IAnalyzeService analyzeService,
         ICommentRepository commentRepository)
         {
             _loginContext = loginContext;
@@ -80,7 +80,7 @@ namespace GxPress.Api.AppControllers
         public async Task<MeetingRoomsResult> ListRoom([FromQuery] MeetingRoomRequest request)
         {
             var locations = await _meetingLocationRepository.GetListAsync();
-            var rooms = await _meetingRoomRepository.GetListAsync(request.LocationId);
+            var rooms = await _meetingRoomRepository.GetListAsync(request);
             foreach (var room in rooms)
             {
                 room.Address = await _meetingLocationRepository.GetAddress(room.LocationId);
@@ -184,7 +184,7 @@ namespace GxPress.Api.AppControllers
                     meeting.Description = request.Description;
                 //删除参会人员
                 var query = Q.NewQuery();
-                query.Where(nameof(Entity.WorkMeeting.MeetingSummaryTodo.TypeId), 1); 
+                query.Where(nameof(Entity.WorkMeeting.MeetingSummaryTodo.TypeId), 1);
                 query.Where(nameof(Entity.WorkMeeting.MeetingSummaryTodo.MeetingSummaryId), request.MeetingId);
                 await meetingSummaryTodoRepository.DeleteAsync(query);
                 //删除附件

+ 1 - 1
gx_api/GxPress/Api/GxPress.Api/WebControllers/WebMeetingController.cs

@@ -69,7 +69,7 @@ namespace GxPress.Api.WebControllers
         public async Task<MeetingRoomsResult> ListRoom([FromQuery] MeetingRoomRequest request)
         {
             var locations = await _meetingLocationRepository.GetListAsync();
-            var rooms = await _meetingRoomRepository.GetListAsync(request.LocationId);
+            var rooms = await _meetingRoomRepository.GetListAsync(request);
             foreach (var room in rooms)
             {
                 room.Address = await _meetingLocationRepository.GetAddress(room.LocationId);

+ 5 - 0
gx_api/GxPress/Model/GxPress.Request/Admin/WorkMeeting/MeetingRoomRequest.cs

@@ -7,5 +7,10 @@ namespace GxPress.Request.Admin.WorkMeeting
     public class MeetingRoomRequest
     {
         public int LocationId { get; set; }
+        /// <summary>
+        /// 搜索字段
+        /// </summary>
+        /// <value></value>
+        public string KeyWord { get; set; }
     }
 }

+ 1 - 5
gx_api/GxPress/Model/GxPress.Request/App/User/FindUserByGuidRequest.cs

@@ -1,13 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
 namespace GxPress.Request.App.User
 {
     /// <summary>
     /// 
     /// </summary>
-   public class FindUserByGuidRequest
+    public class FindUserByGuidRequest
     {
         /// <summary>
         /// 

+ 5 - 0
gx_api/GxPress/Model/GxPress.Request/App/WorkMeeting/MeetingRoomRequest.cs

@@ -3,5 +3,10 @@
     public class MeetingRoomRequest
     {
         public int LocationId { get; set; }
+        /// <summary>
+        /// 搜索字段
+        /// </summary>
+        /// <value></value>
+        public string KeyWord { get; set; }
     }
 }

+ 3 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/WorkMeeting/MeetingLocationRepository.cs

@@ -5,6 +5,7 @@ using GxPress.Common.AppOptions;
 using GxPress.Common.Tools;
 using GxPress.Entity.WorkMeeting;
 using GxPress.Repository.Interface.WorkMeeting;
+using GxPress.Request.App.WorkMeeting;
 using Microsoft.Extensions.Caching.Distributed;
 using Microsoft.Extensions.Options;
 
@@ -44,7 +45,8 @@ namespace GxPress.Repository.Implement.WorkMeeting
 
         public async Task<bool> DeleteAsync(int locationId)
         {
-            var meetingRooms = await _meetingRoomRepository.GetListAsync(locationId);
+            var request = new MeetingRoomRequest() { LocationId = locationId };
+            var meetingRooms = await _meetingRoomRepository.GetListAsync(request);
             if (meetingRooms != null)
             {
                 foreach (var meetingRoom in meetingRooms)

+ 8 - 6
gx_api/GxPress/Repository/GxPress.Repository.Implement/WorkMeeting/MeetingRoomRepository.cs

@@ -5,6 +5,7 @@ using GxPress.Common.AppOptions;
 using GxPress.Common.Tools;
 using GxPress.Entity.WorkMeeting;
 using GxPress.Repository.Interface.WorkMeeting;
+using GxPress.Request.App.WorkMeeting;
 using Microsoft.Extensions.Caching.Distributed;
 using Microsoft.Extensions.Options;
 
@@ -46,13 +47,14 @@ namespace GxPress.Repository.Implement.WorkMeeting
             return await _repository.GetAsync(meetingId);
         }
 
-        public async Task<IEnumerable<MeetingRoom>> GetListAsync(int locationId)
+        public async Task<IEnumerable<MeetingRoom>> GetListAsync(MeetingRoomRequest request)
         {
-            if (locationId > 0)
-            {
-                return await _repository.GetAllAsync(Q.Where(nameof(MeetingRoom.LocationId), locationId).OrderByDesc(nameof(MeetingRoom.Taxis)));
-            }
-            return await _repository.GetAllAsync(Q.OrderByDesc(nameof(MeetingRoom.Taxis)));
+            var query = Q.NewQuery();
+            if (request.LocationId > 0)
+                query.Where(nameof(MeetingRoom.LocationId), request.LocationId);
+            if (!string.IsNullOrEmpty(request.KeyWord))
+                query.WhereLike(nameof(MeetingRoom.Name), $"%{request.KeyWord}%");
+            return await _repository.GetAllAsync(query.OrderByDesc(nameof(MeetingRoom.Taxis)));
         }
 
         public async Task<bool> DeleteAsync(int roomId)

+ 2 - 1
gx_api/GxPress/Repository/GxPress.Repository.Interface/WorkMeeting/IMeetingRoomRepository.cs

@@ -4,6 +4,7 @@ using GxPress.Entity.WorkFlow;
 using GxPress.Request.App.Flow;
 using Datory;
 using GxPress.Entity.WorkMeeting;
+using GxPress.Request.App.WorkMeeting;
 
 namespace GxPress.Repository.Interface.WorkMeeting
 {
@@ -15,7 +16,7 @@ namespace GxPress.Repository.Interface.WorkMeeting
 
         Task<MeetingRoom> GetAsync(int meetingId);
 
-        Task<IEnumerable<MeetingRoom>> GetListAsync(int locationId);
+        Task<IEnumerable<MeetingRoom>> GetListAsync(MeetingRoomRequest request);
 
         Task<bool> DeleteAsync(int roomId);
     }