| | |
| | | @Resource |
| | | private DeviceService deviceService; |
| | | |
| | | @PostMapping("/dev-ready") |
| | | @Operation(summary = "设备准备") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Long> devReady(@Valid @RequestBody DevRentSaveReqVO createReqVO) { |
| | | try { |
| | | return devRentService.readyOperation(createReqVO); |
| | | } catch ( RuntimeException runtimeException ) { |
| | | String err = ExceptionUtils.formatException( runtimeException ); |
| | | log.error("devInstall: " + err); |
| | | return CommonResult.error(DEV_INSTALL_EXCEPTION); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/dev-install") |
| | | @Operation(summary = "装机") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DevRentRespVO> getDevRent(@RequestParam("id") Long id) { |
| | | DevRentDO devRent = devRentService.getDevRent(id); |
| | | return CommonResult.success(BeanUtils.toBean(devRent, DevRentRespVO.class)); |
| | | |
| | | DevRentRespVO devRentRespVO = BeanUtils.toBean(devRent, DevRentRespVO.class); |
| | | |
| | | DeviceDO deviceDO = deviceService.getDevice( devRent.getDevId() ); |
| | | if (null != deviceDO) { |
| | | devRentRespVO.setCategory(deviceDO.getCategory()); |
| | | devRentRespVO.setBrand(deviceDO.getBrand()); |
| | | devRentRespVO.setModel(deviceDO.getModel()); |
| | | } |
| | | return CommonResult.success(devRentRespVO); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | |
| | | BeanUtils.toBean(list, DevRentRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/get-latest-rent") |
| | | @GetMapping("/get-ready-rent") |
| | | @Operation(summary = "获取患者设备的最近租赁情况") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DevRentRespVO> getLatestRent( @Valid DevRentSearchReqVO searchReqVO ) |
| | | public CommonResult<DevRentRespVO> getReadyRent( @Valid DevRentSearchReqVO searchReqVO ) |
| | | { |
| | | DevRentDO devRent = devRentService.getLatestRent( searchReqVO ); |
| | | DevRentDO devRent = devRentService.getReadyOrCancelledRent( searchReqVO ); |
| | | if (null == devRent) { |
| | | return CommonResult.success(null); |
| | | } |
| | | |
| | | DevRentRespVO devRentRespVO = BeanUtils.toBean(devRent, DevRentRespVO.class); |
| | | |
| | | DeviceDO deviceDO = deviceService.getDevice( devRent.getDevId() ); |
| | | if (null != deviceDO) { |
| | | devRentRespVO.setCategory(deviceDO.getCategory()); |
| | | devRentRespVO.setBrand(deviceDO.getBrand()); |
| | | devRentRespVO.setModel(deviceDO.getModel()); |
| | | } |
| | | return CommonResult.success(devRentRespVO); |
| | | } |
| | | |
| | | @GetMapping("/get-installed-rent") |
| | | @Operation(summary = "获取患者设备的最近租赁情况") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DevRentRespVO> getInstalledRent( @Valid DevRentSearchReqVO searchReqVO ) |
| | | { |
| | | DevRentDO devRent = devRentService.getInstalledOrCancelledRent( searchReqVO ); |
| | | if (null == devRent) { |
| | | return CommonResult.success(null); |
| | | } |