eight
2024-09-13 9ddc38c82866653987733935c380496a79d70945
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -82,6 +82,19 @@
        }
    }
    @PostMapping("/dev-lose")
    @Operation(summary = "遗失")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<Long> devLose(@Valid @RequestBody DevRentSaveReqVO loseReqVO) {
        try {
            return devRentService.loseOperation(loseReqVO);
        } catch ( RuntimeException runtimeException ) {
            String err = ExceptionUtils.formatException( runtimeException );
            log.error("devLose: " + err);
            return CommonResult.error(DEV_LOSE_EXCEPTION);
        }
    }
    @PostMapping("/create")
    @Operation(summary = "创建装机拆机")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
@@ -138,11 +151,10 @@
    @GetMapping("/get-latest-rent")
    @Operation(summary = "获取患者设备的最近租赁情况")
    @Parameter(name = "dev-id", description = "设备编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<DevRentRespVO> getLatestRent( @RequestParam("dev-id") String devId )
    public CommonResult<DevRentRespVO> getLatestRent( @Valid DevRentSearchReqVO searchReqVO )
    {
        DevRentDO devRent = devRentService.getLatestRent( devId );
        DevRentDO devRent = devRentService.getLatestRent( searchReqVO );
        return CommonResult.success(BeanUtils.toBean(devRent, DevRentRespVO.class));
    }
}