| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建装机拆机") |
| | | @PreAuthorize("@ss.hasPermission('ecg:dev-rent:create')") |
| | | public CommonResult<Integer> createDevRent(@Valid @RequestBody DevRentSaveReqVO createReqVO) { |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Long> createDevRent(@Valid @RequestBody DevRentSaveReqVO createReqVO) { |
| | | return success(devRentService.createDevRent(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新装机拆机") |
| | | @PreAuthorize("@ss.hasPermission('ecg:dev-rent:update')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Boolean> updateDevRent(@Valid @RequestBody DevRentSaveReqVO updateReqVO) { |
| | | devRentService.updateDevRent(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除装机拆机") |
| | | @Parameter(name = "id", description = "编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('ecg:dev-rent:delete')") |
| | | public CommonResult<Boolean> deleteDevRent(@RequestParam("id") Integer id) { |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Boolean> deleteDevRent(@RequestParam("id") Long id) { |
| | | devRentService.deleteDevRent(id); |
| | | return success(true); |
| | | } |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得装机拆机") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('ecg:dev-rent:query')") |
| | | public CommonResult<DevRentRespVO> getDevRent(@RequestParam("id") Integer id) { |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DevRentRespVO> getDevRent(@RequestParam("id") Long id) { |
| | | DevRentDO devRent = devRentService.getDevRent(id); |
| | | return success(BeanUtils.toBean(devRent, DevRentRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得装机拆机分页") |
| | | @PreAuthorize("@ss.hasPermission('ecg:dev-rent:query')") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<PageResult<DevRentRespVO>> getDevRentPage(@Valid DevRentPageReqVO pageReqVO) { |
| | | PageResult<DevRentDO> pageResult = devRentService.getDevRentPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, DevRentRespVO.class)); |
| | |
| | | BeanUtils.toBean(list, DevRentRespVO.class)); |
| | | } |
| | | |
| | | } |
| | | @GetMapping("/get-latest-rent") |
| | | @Operation(summary = "获取患者设备的最近租赁情况") |
| | | @Parameter(name = "pat-id", description = "患者编号", required = true, example = "1024") |
| | | @Parameter(name = "dev-id", description = "设备编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DevRentRespVO> getLatestRent( |
| | | @RequestParam("pat-id") String patId, @RequestParam("dev-id") String devId) |
| | | { |
| | | DevRentDO devRent = devRentService.getLatestRent(patId, devId); |
| | | return success(BeanUtils.toBean(devRent, DevRentRespVO.class)); |
| | | } |
| | | } |