|  |  | 
 |  |  | package cn.lihu.jh.module.ecg.service.queue; | 
 |  |  |  | 
 |  |  | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; | 
 |  |  | import cn.lihu.jh.module.ecg.dal.mysql.queue.queueMapper; | 
 |  |  | import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; | 
 |  |  | import cn.lihu.jh.module.ecg.enums.BedStatusEnum; | 
 |  |  | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; | 
 |  |  | import cn.lihu.jh.framework.common.exception.ErrorCode; | 
 |  |  | import cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.concurrent.Callable; | 
 |  |  | import java.util.concurrent.ConcurrentHashMap; | 
 |  |  | import java.util.concurrent.PriorityBlockingQueue; | 
 |  |  | import java.util.concurrent.atomic.AtomicInteger; | 
 |  |  |  | 
 |  |  | import static cn.lihu.jh.module.ecg.service.queue.QueueService.MAX_QUEUE_NUM; | 
 |  |  | public class BedOpenCallable implements Callable<ErrorCode> { | 
 |  |  |  | 
 |  |  | public class BedOpenCallable implements Callable<Integer> { | 
 |  |  |  | 
 |  |  |     QueueService queueService; | 
 |  |  |     QueueServiceTxFunctions queueService; | 
 |  |  |     private Long roomId; | 
 |  |  |     private String roomName; | 
 |  |  |     private String bedNo; | 
 |  |  |  | 
 |  |  |     public BedOpenCallable(QueueService queueService, Long roomId, String bedNo) | 
 |  |  |     public BedOpenCallable(QueueServiceTxFunctions queueService, Long roomId, String roomName, String bedNo) | 
 |  |  |     { | 
 |  |  |         super(); | 
 |  |  |         this.roomId = roomId; | 
 |  |  |         this.roomName = roomName; | 
 |  |  |         this.bedNo = bedNo; | 
 |  |  |         this.queueService = queueService; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Integer call() throws Exception { | 
 |  |  |         return queueService.bedOpen(roomId, bedNo); | 
 |  |  |     public ErrorCode call() throws Exception { | 
 |  |  |         ErrorCode ec = queueService.bedOpen(roomId, roomName, bedNo); | 
 |  |  |         if (GlobalErrorCodeConstants.SUCCESS.equals(ec)) { | 
 |  |  |             queueService.hurryupOneBed(roomId, bedNo); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         queueService.monitorInfo(); | 
 |  |  |         return ec; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |