| | |
| | | import cn.lihu.jh.framework.common.exception.ErrorCode; |
| | | import cn.lihu.jh.framework.common.pojo.CommonResult; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.queue.vo.PatientStatisticVO; |
| | | import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueRespVO; |
| | | 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.module.ecg.enums.QueueStatusEnum; |
| | | import cn.lihu.jh.module.ecg.service.queue.QueueService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static cn.lihu.jh.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.error; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | @Resource |
| | | private QueueService queueService; |
| | | |
| | | @GetMapping("/bed-doctor-pause") |
| | | @Operation(summary = "医生暂停") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:state')") |
| | | public CommonResult<Integer> bedPause( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); |
| | | |
| | | ErrorCode result = queueService.startBedDoctorPause(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(SUCCESS.getCode()); |
| | | |
| | | return error(result); |
| | | } |
| | | |
| | | @GetMapping("/bed-doctor-resume") |
| | | @Operation(summary = "医生恢复") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:state')") |
| | | public CommonResult<Integer> bedResume( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); |
| | | |
| | | ErrorCode result = queueService.startBedDoctorResume(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(SUCCESS.getCode()); |
| | | |
| | | return error(result); |
| | | } |
| | | |
| | | @GetMapping("/bed-doctor-on") |
| | | @Operation(summary = "医生入座") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:state')") |
| | | public CommonResult<Integer> bedDoctorOn( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); |
| | | |
| | | ErrorCode result = queueService.startBedDoctorOn(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(0); |
| | | |
| | | return error(result); |
| | | } |
| | | |
| | | @GetMapping("/bed-doctor-off") |
| | | @Operation(summary = "医生离座") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:state')") |
| | | public CommonResult<Integer> bedDoctorOff( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | | { |
| | | Long userId = SecurityFrameworkUtils.getLoginUserId(); |
| | | String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); |
| | | |
| | | ErrorCode result = queueService.startBedDoctorOff(roomId, bedNo, userId, userNickname); |
| | | if (result.equals(SUCCESS)) |
| | | return success(SUCCESS.getCode()); |
| | | |
| | | return error(result); |
| | | } |
| | | |
| | | @GetMapping("/bed-doctor-get") |
| | | @Operation(summary = "医生工位获取") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:state')") |
| | | 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("/finish-next-patient") |
| | | @Operation(summary = "完成、下一位患者") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | | @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:nextpatient')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<List<QueueRespVO>> finishNextPatient( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | |
| | | @Operation(summary = "过号、下一位患者") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | | @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:nextpatient')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<List<QueueRespVO>> passNextPatient( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | |
| | | @Operation(summary = "取患者列表") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | | @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:patientlist')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<List<QueueRespVO>> getPatientList( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | |
| | | @Operation(summary = "取患者统计") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | | @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:patientstatistic')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<PatientStatisticVO> getPatientStatistic( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo) |
| | |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | | @Parameter(name = "bedNo", description = "工位编号", required = true, example = "B2") |
| | | @Parameter(name = "patId", description = "患者编号", required = true, example = "B2") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:patient')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<String> recallPatient( |
| | | @RequestParam("roomId") Long roomId, |
| | | @RequestParam("bedNo") String bedNo, |
| | |
| | | |
| | | return success("success"); |
| | | } |
| | | |
| | | |
| | | } |