|
@@ -86,7 +86,7 @@ namespace GxPress.Api.AppControllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("rooms/{id}")]
|
|
|
- public async Task<MeetingRoomResult> RoomGet([FromRoute]int id)
|
|
|
+ public async Task<MeetingRoomResult> RoomGet([FromRoute] int id)
|
|
|
{
|
|
|
var room = await _meetingRoomRepository.GetAsync(id);
|
|
|
room.Address = await _meetingLocationRepository.GetAddress(room.LocationId);
|
|
@@ -114,14 +114,21 @@ namespace GxPress.Api.AppControllers
|
|
|
}
|
|
|
var orderLists = new List<TimeDictionary>();
|
|
|
//新版
|
|
|
- foreach (var item in orderList.Select(n => n.Date).Distinct())
|
|
|
+ foreach (var item in orderList)
|
|
|
{
|
|
|
- var timeDictionary = new TimeDictionary();
|
|
|
- timeDictionary.TimeKey = item.ToString();
|
|
|
- timeDictionary.TimeValues = orderList.Where(n => n.Date == item).Select(n => n.Hour).Distinct().ToList();
|
|
|
+ if (orderLists.Any(n => n.TimeKey == item.Date.ToString()))
|
|
|
+ continue;
|
|
|
+ var timeDictionary = new TimeDictionary()
|
|
|
+ {
|
|
|
+ TimeKey = item.Date.ToString(),
|
|
|
+ };
|
|
|
+ foreach (var data in orderList.Where(n => n.Date == Convert.ToInt32(item.Date)).Distinct().ToList())
|
|
|
+ {
|
|
|
+ timeDictionary.TimeValues.Add(data.Hour);
|
|
|
+ timeDictionary.NewTimeValues.Add(new TimeValue { Key = data.Hour, Value = data.UserName });
|
|
|
+ }
|
|
|
orderLists.Add(timeDictionary);
|
|
|
}
|
|
|
-
|
|
|
return new MeetingRoomResult
|
|
|
{
|
|
|
RoomName = room.Name,
|
|
@@ -136,7 +143,7 @@ namespace GxPress.Api.AppControllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("rooms/{id}/actions/order")]
|
|
|
- public async Task<DefaultResult> Order([FromRoute]int id, [FromBody] MeetingOrderRequest request)
|
|
|
+ public async Task<DefaultResult> Order([FromRoute] int id, [FromBody] MeetingOrderRequest request)
|
|
|
{
|
|
|
var room = await _meetingRoomRepository.GetAsync(id);
|
|
|
var meeting = new Meeting();
|
|
@@ -682,11 +689,17 @@ namespace GxPress.Api.AppControllers
|
|
|
var orderLists = new List<TimeDictionary>();
|
|
|
var orderAllList = await _meetingOrderRepository.GetListAsyncSinceNow(room.Id);
|
|
|
//新版
|
|
|
- foreach (var item in orderAllList.Select(n => n.Date).Distinct())
|
|
|
+ foreach (var item in orderAllList)
|
|
|
{
|
|
|
+ if (orderLists.Any(n => n.TimeKey == item.Date.ToString()))
|
|
|
+ continue;
|
|
|
var timeDictionary = new TimeDictionary();
|
|
|
- timeDictionary.TimeKey = item.ToString();
|
|
|
- timeDictionary.TimeValues = orderAllList.Where(n => n.Date == item).OrderBy(n => n.Hour).Select(n => n.Hour).Distinct().ToList();
|
|
|
+ timeDictionary.TimeKey = item.Date.ToString();
|
|
|
+ foreach (var date in orderAllList.Where(n => n.Date == item.Date).OrderBy(n => n.Hour).Select(n => n.Hour).Distinct().ToList())
|
|
|
+ {
|
|
|
+ timeDictionary.TimeValues.Add(date);
|
|
|
+ timeDictionary.NewTimeValues.Add(new TimeValue { Key = date, Value = item.UserName });
|
|
|
+ }
|
|
|
orderLists.Add(timeDictionary);
|
|
|
}
|
|
|
#endregion
|
|
@@ -723,7 +736,7 @@ namespace GxPress.Api.AppControllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("{id}/actions/cancel")]
|
|
|
- public async Task<DefaultResult> Cancel([FromRoute]int id)
|
|
|
+ public async Task<DefaultResult> Cancel([FromRoute] int id)
|
|
|
{
|
|
|
await _meetingRepository.DeleteAsync(id);
|
|
|
|
|
@@ -738,7 +751,7 @@ namespace GxPress.Api.AppControllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("actions/users")]
|
|
|
- public async Task<IEnumerable<MeetingUserResult>> GetUsers([FromBody]MeetingUsersRequest request)
|
|
|
+ public async Task<IEnumerable<MeetingUserResult>> GetUsers([FromBody] MeetingUsersRequest request)
|
|
|
{
|
|
|
return await _meetingRepository.GetUserByMeeting(request);
|
|
|
}
|