//预估房间数量 public int RoomCount(int eventId, out bool isVisiable) { int roomCount = 0; isVisiable = false; try { //需要计算 List <EventRoomResponse> list = _roomData.GetList(new EventRoomQueryRequest() { EventId = eventId }); roomCount = list.Count(); } catch (Exception ex) { LogUtils.LogError("EventRoomService.RoomCount", ex); } return(roomCount); }
// 裁判数据统计 public RefereeSignDataResponse RefereeSignData(int eventId, string manMemberId) { RefereeSignDataResponse response = new RefereeSignDataResponse(); try { //数据统计 List <t_event_sign> list = _refereeSignRepo.RefereeSignData(eventId, manMemberId); List <EventRoomResponse> list1 = _roomData.GetList(new EventRoomQueryRequest() { EventId = eventId }); if (list1 != null && list1.Count > 0) { response.LeastCount = list1.Where(c => c.RoomStatus == RoomStatusEm.闲置).Count(); } if (list != null && list.Count > 0) { response.SignCount = list.Where(c => c.signdate.ToShortDateString() == DateTime.Now.ToShortDateString() && c.eventSignStatus == EventSignStatusEm.已签到).Count(); response.UsedCount = list.Where(c => c.signdate.ToShortDateString() == DateTime.Now.ToShortDateString() && c.refereeStatus == RefereeStatusEm.使用中).Count(); response.UnusedCount = list.Where(c => c.signdate.ToShortDateString() == DateTime.Now.ToShortDateString() && c.refereeStatus == RefereeStatusEm.闲置).Count(); response.StopCount = list.Where(c => c.signdate.ToShortDateString() == DateTime.Now.ToShortDateString() && c.isStop).Count(); } var eventGroup = _dbContext.Select <t_event_group>(c => c.eventId == eventId); foreach (var item in eventGroup) { response.RefereeSignGroup.Add(new RefereeSignGroupResponse { EventGroupId = item.id, LeastCount = list1.Where(c => c.EventGroupId == item.id).Count(), SignCount = list.Where(c => c.eventSignStatus == EventSignStatusEm.已签到 && c.eventGroupId == item.id).Count() }); } } catch (Exception ex) { LogUtils.LogError("EventSignService.RefereeSignData", ex); } return(response); }