| | |
| | | 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.service.room.RoomService; |
| | | import cn.lihu.jh.module.system.api.dept.DeptApi; |
| | | import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import java.util.stream.Collectors; |
| | | |
| | | 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.service.room.RoomService; |
| | | import cn.lihu.jh.module.system.api.dept.DeptApi; |
| | | import cn.lihu.jh.module.system.api.dept.dto.DeptRespDTO; |
| | | import cn.lihu.jh.framework.common.pojo.PageParam; |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.pojo.CommonResult; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.success; |
| | | |
| | | import cn.lihu.jh.framework.excel.core.util.ExcelUtils; |
| | | |
| | | import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.success; |
| | | import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*; |
| | | |
| | | |
| | |
| | | |
| | | @GetMapping(value = {"/list-all-bed"}) |
| | | @Operation(summary = "获取诊床列表", description = "主要用于前端的开诊管理") |
| | | public CommonResult<Map<Long, List<RoomRespVO>>> getAllBedMap() { |
| | | public CommonResult<Map<String, List<RoomRespVO>>> getAllBedMap() { |
| | | |
| | | RoomPageReqVO pageReqVO = new RoomPageReqVO(); |
| | | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | |
| | | |
| | | List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class); |
| | | |
| | | Map<Long, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomId)); |
| | | Map<String, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomName)); |
| | | return success(map); |
| | | } |
| | | |
| | | @GetMapping(value = {"/list-simple-room"}) |
| | | @Operation(summary = "获取门诊室列表", description = "主要用于前端的诊室选择") |
| | | public CommonResult<List<RoomRespVO>> getSimpleRoomList() { |
| | | public CommonResult<Map<String, List<RoomRespVO>>> getSimpleRoomList() { |
| | | List<RoomDO> list = roomService.simpleRoomList(); |
| | | return success(BeanUtils.toBean(list, RoomRespVO.class)); |
| | | List<RoomRespVO> list2 = BeanUtils.toBean(list, RoomRespVO.class); |
| | | |
| | | Map<String, List<RoomRespVO>> map = list2.stream().collect(Collectors.groupingBy(RoomRespVO::getRoomName)); |
| | | return success(map); |
| | | } |
| | | |
| | | @GetMapping(value = {"/reset-room"}) |
| | | @Operation(summary = "重置门诊室", description = "主要用于每天关闭工位") |
| | | public CommonResult<String> resetRoom() { |
| | | roomService.resetRoom(); |
| | | return success("reset room ok"); |
| | | } |
| | | |
| | | @GetMapping(value = {"/get-opening-flag"}) |
| | | @Operation(summary = "当前开诊状态获取", description = "当前开诊状态获取 监控用") |
| | | public CommonResult<Integer> getOpeningFlag() { |
| | | Integer openingFlag = roomService.getOpeningFlag(); |
| | | return success( openingFlag ); |
| | | } |
| | | |
| | | } |