|
|
@ -241,11 +241,18 @@ namespace Shentun.Peis.QueueRegisters |
|
|
/// <param name="input"></param>
|
|
|
/// <param name="input"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("api/app/QueueRegister/GetRoomListByAsbitemId")] |
|
|
[HttpPost("api/app/QueueRegister/GetRoomListByAsbitemId")] |
|
|
public async Task<List<BaseRoomDto>> GetRoomListByAsbitemIdAsync(AsbitemIdInputDto input) |
|
|
|
|
|
|
|
|
public async Task<List<BaseRoomDto>> GetRoomListByAsbitemIdAsync(GetRoomListByAsbitemIdInputDto input) |
|
|
{ |
|
|
{ |
|
|
//已签到的房间
|
|
|
//已签到的房间
|
|
|
var roomIds = await _queueRegisterManager.GetSignInRoomAsync(); |
|
|
var roomIds = await _queueRegisterManager.GetSignInRoomAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var patientRegisterEnt = await _patientRegisterRepository.FirstOrDefaultAsync(f => f.Id == input.PatientRegisterId); |
|
|
|
|
|
|
|
|
|
|
|
if (patientRegisterEnt == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException("人员不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var query = (from room in await _roomRepository.GetQueryableAsync() |
|
|
var query = (from room in await _roomRepository.GetQueryableAsync() |
|
|
join roomDetail in await _roomDetailRepository.GetQueryableAsync() on room.Id equals roomDetail.RoomId |
|
|
join roomDetail in await _roomDetailRepository.GetQueryableAsync() on room.Id equals roomDetail.RoomId |
|
|
join queueRegister in await _queueRegisterRepository.GetQueryableAsync() on room.Id equals queueRegister.RoomId into queueRegisterTemp |
|
|
join queueRegister in await _queueRegisterRepository.GetQueryableAsync() on room.Id equals queueRegister.RoomId into queueRegisterTemp |
|
|
@ -259,6 +266,7 @@ namespace Shentun.Peis.QueueRegisters |
|
|
roomId = room.Id, |
|
|
roomId = room.Id, |
|
|
roomName = room.DisplayName, |
|
|
roomName = room.DisplayName, |
|
|
queueTime = room.QueueTime, |
|
|
queueTime = room.QueueTime, |
|
|
|
|
|
forSexId = room.ForSexId, |
|
|
queueRegisterHaveEmpty |
|
|
queueRegisterHaveEmpty |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
@ -267,8 +275,17 @@ namespace Shentun.Peis.QueueRegisters |
|
|
RoomId = s.Key, |
|
|
RoomId = s.Key, |
|
|
RoomName = s.FirstOrDefault().roomName, |
|
|
RoomName = s.FirstOrDefault().roomName, |
|
|
QueueTime = s.Count(m => m.queueRegisterHaveEmpty != null) * s.FirstOrDefault().queueTime, |
|
|
QueueTime = s.Count(m => m.queueRegisterHaveEmpty != null) * s.FirstOrDefault().queueTime, |
|
|
|
|
|
ForSexId = s.FirstOrDefault().forSexId |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
if (patientRegisterEnt.SexId == SexFlag.UnKnown) |
|
|
|
|
|
{ |
|
|
|
|
|
roomGroup = roomGroup.Where(m => m.ForSexId == ForSexFlag.All).ToList(); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
roomGroup = roomGroup.Where(m => m.ForSexId == ForSexFlag.All || m.ForSexId == patientRegisterEnt.SexId).ToList(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return roomGroup; |
|
|
return roomGroup; |
|
|
@ -302,7 +319,7 @@ namespace Shentun.Peis.QueueRegisters |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//删除排队操作
|
|
|
//删除排队操作
|
|
|
await _queueRegisterRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId, true); |
|
|
|
|
|
|
|
|
await _queueRegisterRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId && d.CompleteFlag != QueueRegisterCompleteFlag.AlreadyCalled, true); |
|
|
|
|
|
|
|
|
var entity = await _queueRegisterManager.ManualQueuingRoomAsync(input.PatientRegisterId, input.RoomId); |
|
|
var entity = await _queueRegisterManager.ManualQueuingRoomAsync(input.PatientRegisterId, input.RoomId); |
|
|
|
|
|
|
|
|
@ -324,7 +341,7 @@ namespace Shentun.Peis.QueueRegisters |
|
|
public async Task<QueueRegisterByPatientRegisterIdDto> AutomaticQueuingRoomAsync(AutomaticQueuingRoomInputDto input) |
|
|
public async Task<QueueRegisterByPatientRegisterIdDto> AutomaticQueuingRoomAsync(AutomaticQueuingRoomInputDto input) |
|
|
{ |
|
|
{ |
|
|
//删除排队操作
|
|
|
//删除排队操作
|
|
|
await _queueRegisterRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId, true); |
|
|
|
|
|
|
|
|
await _queueRegisterRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId && d.CompleteFlag != QueueRegisterCompleteFlag.AlreadyCalled, true); |
|
|
|
|
|
|
|
|
var entity = await _queueRegisterManager.AutomaticQueuingRoomAsync(input.PatientRegisterId); |
|
|
var entity = await _queueRegisterManager.AutomaticQueuingRoomAsync(input.PatientRegisterId); |
|
|
|
|
|
|
|
|
@ -491,7 +508,7 @@ namespace Shentun.Peis.QueueRegisters |
|
|
var queueRegisterList = query.Where(m => m.isVip == 'Y').OrderBy(o => o.queueRegisterNumber).ToList(); |
|
|
var queueRegisterList = query.Where(m => m.isVip == 'Y').OrderBy(o => o.queueRegisterNumber).ToList(); |
|
|
queueRegisterList.AddRange(query.Where(m => m.isVip == 'N').OrderBy(o => o.queueRegisterNumber).ToList()); |
|
|
queueRegisterList.AddRange(query.Where(m => m.isVip == 'N').OrderBy(o => o.queueRegisterNumber).ToList()); |
|
|
|
|
|
|
|
|
var visitEnt = queueRegisterList.Where(m => m.completeFlag == QueueRegisterCompleteFlag.AlreadyCalled).FirstOrDefault(); |
|
|
|
|
|
|
|
|
var visitEnt = queueRegisterList.Where(m => m.completeFlag == QueueRegisterCompleteFlag.AlreadyCalled).OrderByDescending(o => o.callTime).FirstOrDefault(); |
|
|
|
|
|
|
|
|
if (visitEnt != null) |
|
|
if (visitEnt != null) |
|
|
{ |
|
|
{ |
|
|
|