| | |
| | | return success("success"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import cn.lihu.jh.framework.common.exception.ErrorCode; |
| | | import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | |
| | | ErrorCode result = queueService.startBedDoctorPause(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(0); |
| | | return success(SUCCESS.getCode()); |
| | | |
| | | return error(result); |
| | | } |
| | |
| | | |
| | | ErrorCode result = queueService.startBedDoctorResume(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(0); |
| | | return success(SUCCESS.getCode()); |
| | | |
| | | return error(result); |
| | | } |
| | |
| | | return error(result); |
| | | } |
| | | |
| | | @GetMapping("/bed-doctor-get") |
| | | @Operation(summary = "医生工位获取") |
| | | @PreAuthorize("@ss.hasPermission('ecg:queue:bedcontrol')") |
| | | public CommonResult<RoomRespVO> bedDoctorGet( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | |
| | | CommonResult<RoomRespVO> result = queueService.getRoom(roomId, bedNo, userId); |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping("/startbiz") |
| | | @Operation(summary = "手动开诊") |
| | | @PreAuthorize("@ss.hasPermission('ecg:queue:setting')") |
| | |
| | | package cn.lihu.jh.module.ecg.controller.admin.room; |
| | | |
| | | import cn.lihu.jh.framework.common.enums.CommonStatusEnum; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | import cn.lihu.jh.module.ecg.service.room.RoomService; |
| | | import cn.lihu.jh.module.system.api.dept.DeptApi; |
| | | import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO; |
| | |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('clinic:room:query')") |
| | | public CommonResult<RoomRespVO> getRoom(@RequestParam("id") Integer id) { |
| | | RoomDO room = roomService.getRoom(id); |
| | | RoomResVO room = roomService.getRoom(id); |
| | | return success(BeanUtils.toBean(room, RoomRespVO.class)); |
| | | } |
| | | |
| | |
| | | @Operation(summary = "获得诊室和诊疗床分页") |
| | | @PreAuthorize("@ss.hasPermission('clinic:room:query')") |
| | | public CommonResult<PageResult<RoomRespVO>> getRoomPage(@Valid RoomPageReqVO pageReqVO) { |
| | | PageResult<RoomDO> pageResult = roomService.getRoomPage(pageReqVO); |
| | | PageResult<RoomResVO> pageResult = roomService.getRoomPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, RoomRespVO.class)); |
| | | } |
| | | |
| | |
| | | public void exportRoomExcel(@Valid RoomPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<RoomDO> list = roomService.getRoomPage(pageReqVO).getList(); |
| | | List<RoomResVO> list = roomService.getRoomPage(pageReqVO).getList(); |
| | | // 导出 Excel |
| | | ExcelUtils.write(response, "诊室和诊疗床.xls", "数据", RoomRespVO.class, |
| | | BeanUtils.toBean(list, RoomRespVO.class)); |
| | |
| | | |
| | | RoomPageReqVO pageReqVO = new RoomPageReqVO(); |
| | | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<RoomDO> list = roomService.getRoomPage(pageReqVO).getList(); |
| | | List<RoomResVO> list = roomService.getRoomPage(pageReqVO).getList(); |
| | | |
| | | List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class); |
| | | |
| | |
| | | @GetMapping(value = {"/list-simple-room"}) |
| | | @Operation(summary = "获取门诊室列表", description = "主要用于前端的诊室选择") |
| | | public CommonResult<Map<String, List<RoomRespVO>>> getSimpleRoomList() { |
| | | List<RoomDO> list = roomService.simpleRoomList(); |
| | | List<RoomResVO> list = roomService.simpleRoomList(); |
| | | List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class); |
| | | |
| | | Map<String, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomName)); |
| | |
| | | import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX; |
| | | |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; |
| | | import cn.lihu.jh.module.ecg.enums.BedStatusEnum; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @author 芋道源码 |
| | | */ |
| | | @Mapper |
| | | public interface RoomMapper extends BaseMapperX<RoomDO> { |
| | | public interface RoomMapper extends BaseMapperX<RoomResVO> { |
| | | |
| | | default PageResult<RoomDO> selectPage(RoomPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<RoomDO>() |
| | | .eqIfPresent(RoomDO::getRoomId, reqVO.getRoomId()) |
| | | .eqIfPresent(RoomDO::getBedNo, reqVO.getBedNo()) |
| | | .betweenIfPresent(RoomDO::getCreateTime, reqVO.getCreateTime()) |
| | | .orderByDesc(RoomDO::getId)); |
| | | default PageResult<RoomResVO> selectPage(RoomPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<RoomResVO>() |
| | | .eqIfPresent(RoomResVO::getRoomId, reqVO.getRoomId()) |
| | | .eqIfPresent(RoomResVO::getBedNo, reqVO.getBedNo()) |
| | | .betweenIfPresent(RoomResVO::getCreateTime, reqVO.getCreateTime()) |
| | | .orderByDesc(RoomResVO::getId)); |
| | | } |
| | | |
| | | @Select({ "SELECT room_id, room_name, count(1) as bed_num FROM lihu.clinic_room group by room_id;" }) |
| | |
| | | " #{curStatus.status} " + |
| | | " </foreach> );" + |
| | | "</script>") |
| | | List<RoomResVO> simpleRoomList(@Param("curStatusList") List<BedStatusEnum> curStatusList); |
| | | |
| | | List<RoomDO> simpleRoomList(@Param("curStatusList") List<BedStatusEnum> curStatusList); |
| | | @Select("SELECT * FROM lihu.clinic_room where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId}") |
| | | RoomResVO getRoom(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId); |
| | | |
| | | @Update("<script> " + |
| | | "update lihu.clinic_room set status=#{newStatus.status} where room_id=#{roomId} and bed_no=#{bedNo} " + |
| | |
| | | package cn.lihu.jh.module.ecg.service.queue; |
| | | |
| | | import cn.lihu.jh.framework.common.exception.ErrorCode; |
| | | import cn.lihu.jh.framework.common.pojo.CommonResult; |
| | | import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | |
| | | ErrorCode bedDoctorResume(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode bedDoctorOn(Long roomId, String bedNo, Long docId, String docName); |
| | | ErrorCode bedDoctorOff(Long roomId, String bedNo, Long docId, String docName); |
| | | |
| | | CommonResult<RoomRespVO> getRoom(Long roomId, String bedNo, Long docId); |
| | | /** |
| | | * 获得排队 |
| | | * |
| | |
| | | package cn.lihu.jh.module.ecg.service.queue; |
| | | |
| | | import cn.lihu.jh.framework.common.exception.ErrorCode; |
| | | import cn.lihu.jh.framework.common.pojo.CommonResult; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.BedQueueStatisticDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | 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.ErrorCodeConstants; |
| | | import cn.lihu.jh.module.ecg.enums.QueueStatusEnum; |
| | | import cn.lihu.jh.module.infra.api.config.ConfigApi; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS; |
| | | import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.lihu.jh.module.ecg.Constants.ECG_OPENING_TIME_KEY; |
| | | import static cn.lihu.jh.module.ecg.Constants.ECG_QUEUE_READY_MAX_KEY; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.error; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.success; |
| | | import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<RoomRespVO> getRoom(Long roomId, String bedNo, Long docId) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo)); |
| | | if (null == bedQueueBO) { |
| | | return error(QUEUE_BED_ABNORMAL); |
| | | } |
| | | |
| | | RoomResVO roomResVO = roomMapper.getRoom(roomId, bedNo, docId); |
| | | if (null == roomResVO) { |
| | | return error(ECG_INNER_ERROR); |
| | | } |
| | | |
| | | RoomRespVO roomRespVO = BeanUtils.toBean(roomResVO, RoomRespVO.class); |
| | | return success(roomRespVO); |
| | | } |
| | | |
| | | @Override |
| | | public ErrorCode bedDoctorPause(Long roomId, String bedNo, Long docId, String docName) { |
| | | BedQueueBO bedQueueBO = mapBedVsQueue.get(String.format("%09d%s", roomId, bedNo)); |
| | | if (null == bedQueueBO) |
| | |
| | | bedStatusEnumList.add(BedStatusEnum.OPENING); |
| | | bedStatusEnumList.add(BedStatusEnum.DOCTOR_ON); |
| | | bedStatusEnumList.add(BedStatusEnum.PAUSE); |
| | | List<RoomDO> roomDOList = roomMapper.simpleRoomList(bedStatusEnumList); |
| | | List<RoomResVO> roomDOList = roomMapper.simpleRoomList(bedStatusEnumList); |
| | | List<BedQueueBO> bedQueueBOList = roomDOList.stream().map(item -> BeanUtils.toBean(item, BedQueueBO.class)).toList(); |
| | | |
| | | // 从DB 获取 队列中 就诊准备中人员统计 列表 |
| | |
| | | |
| | | import java.util.*; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.pojo.PageParam; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | * @param id 编号 |
| | | * @return 诊室和诊疗床 |
| | | */ |
| | | RoomDO getRoom(Integer id); |
| | | RoomResVO getRoom(Integer id); |
| | | |
| | | /** |
| | | * 获得诊室和诊疗床分页 |
| | |
| | | * @param pageReqVO 分页查询 |
| | | * @return 诊室和诊疗床分页 |
| | | */ |
| | | PageResult<RoomDO> getRoomPage(RoomPageReqVO pageReqVO); |
| | | PageResult<RoomResVO> getRoomPage(RoomPageReqVO pageReqVO); |
| | | |
| | | List<RoomStatisticsDO> roomStatistics(); |
| | | |
| | | List<RoomDO> simpleRoomList(); |
| | | List<RoomResVO> simpleRoomList(); |
| | | |
| | | } |
| | |
| | | |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomSaveReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomResVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.room.RoomMapper; |
| | | import cn.lihu.jh.module.ecg.enums.BedStatusEnum; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.pojo.PageParam; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Override |
| | | public Integer createRoom(RoomSaveReqVO createReqVO) { |
| | | // 插入 |
| | | RoomDO room = BeanUtils.toBean(createReqVO, RoomDO.class); |
| | | RoomResVO room = BeanUtils.toBean(createReqVO, RoomResVO.class); |
| | | roomMapper.insert(room); |
| | | // 返回 |
| | | return room.getId(); |
| | |
| | | // 校验存在 |
| | | validateRoomExists(updateReqVO.getId()); |
| | | // 更新 |
| | | RoomDO updateObj = BeanUtils.toBean(updateReqVO, RoomDO.class); |
| | | RoomResVO updateObj = BeanUtils.toBean(updateReqVO, RoomResVO.class); |
| | | roomMapper.updateById(updateObj); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public RoomDO getRoom(Integer id) { |
| | | public RoomResVO getRoom(Integer id) { |
| | | return roomMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<RoomDO> getRoomPage(RoomPageReqVO pageReqVO) { |
| | | public PageResult<RoomResVO> getRoomPage(RoomPageReqVO pageReqVO) { |
| | | return roomMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<RoomDO> simpleRoomList() { |
| | | public List<RoomResVO> simpleRoomList() { |
| | | List<BedStatusEnum> bedStatusEnumList = new ArrayList<BedStatusEnum>(); |
| | | bedStatusEnumList.add(BedStatusEnum.OPENING); |
| | | bedStatusEnumList.add(BedStatusEnum.DOCTOR_ON); |