| | |
| | | import java.util.concurrent.*; |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.lihu.jh.module.ecg.Utils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper; |
| | |
| | | private DevRentMapper devRentMapper; |
| | | |
| | | ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); |
| | | |
| | | ConcurrentHashMap<String, RoomDO> mapRoomBed = new ConcurrentHashMap<>(); |
| | | |
| | | @Override |
| | | public Integer createqueue(QueueSaveReqVO createReqVO) { |
| | |
| | | return patientStatisticVO; |
| | | } |
| | | |
| | | public PatientStatisticVO getBedDevInstallStatistic(Long roomId, String bedNo) { |
| | | PatientStatisticVO patientStatisticVO = new PatientStatisticVO(); |
| | | List<BedQueueStatisticDO> bedQueueStatisticDOList = queueMapper.bedQueueStatistic(roomId, bedNo); |
| | | bedQueueStatisticDOList.forEach(item -> { |
| | | if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReceivedNum(item.getTotalInStatus()); |
| | | } else if (QueueStatusEnum.FINISH.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setFinishedNum(item.getTotalInStatus()); |
| | | } |
| | | }); |
| | | |
| | | return patientStatisticVO; |
| | | } |
| | | |
| | | public PatientStatisticVO getBedDevReadyStatistic(Long roomId, String bedNo) { |
| | | PatientStatisticVO patientStatisticVO = new PatientStatisticVO(); |
| | | patientStatisticVO.setFinishedNum(0); |
| | | List<BedQueueStatisticDO> bedQueueStatisticDOList = queueMapper.bedQueueStatistic(roomId, bedNo); |
| | | bedQueueStatisticDOList.forEach(item -> { |
| | | if (QueueStatusEnum.READY.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReadyNum(item.getTotalInStatus()); |
| | | } else if (QueueStatusEnum.PASSED.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setPassedNum(item.getTotalInStatus()); |
| | | } else if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setFinishedNum( item.getTotalInStatus() + patientStatisticVO.getFinishedNum() ); |
| | | } else if (QueueStatusEnum.INSTALLING.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setFinishedNum( item.getTotalInStatus() + patientStatisticVO.getFinishedNum() ); |
| | | } else if (QueueStatusEnum.FINISH.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setFinishedNum(item.getTotalInStatus() + patientStatisticVO.getFinishedNum()); |
| | | } |
| | | }); |
| | | |
| | | RoomDO roomDO = getRoomDO(roomId, bedNo); |
| | | Integer[] checkTypes = roomDO.getCheckTypes(); |
| | | List<Byte> statusList = new ArrayList<>(); |
| | | statusList.add(QueueStatusEnum.WAITING.getStatus()); |
| | | Integer num = queueMapper.checkTypeAndStatusStatistic(roomId, bedNo, checkTypes, statusList); |
| | | patientStatisticVO.setQueuingNum(num); |
| | | |
| | | return patientStatisticVO; |
| | | } |
| | | |
| | | public void initCheckType() { |
| | | queueServiceTxFunctions.initCheckType( ); |
| | | } |
| | |
| | | return roomMapper.getRoomByDocId(docId); |
| | | } |
| | | |
| | | private RoomDO getRoomDO(Long roomId, String bedNo) { |
| | | RoomDO roomDO = mapRoomBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if ( null == roomDO) |
| | | roomDO = roomMapper.getRoom(roomId, bedNo); |
| | | |
| | | return roomDO; |
| | | } |
| | | |
| | | } |