From 24b7c98e01c211e93f00293e6e4e96ba1b9db93f Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期一, 14 十月 2024 14:50:43 +0800 Subject: [PATCH] 常规检查 step 2 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java index b1fa875..054b4a7 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devmanage/DeviceController.java @@ -1,5 +1,9 @@ package cn.lihu.jh.module.ecg.controller.admin.devmanage; +import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.JobRecordPageReqVO; +import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.JobRecordStatisticVO; +import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceStatisticDO; +import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.springframework.security.access.prepost.PreAuthorize; @@ -7,6 +11,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; +import java.time.LocalDate; import java.util.*; import java.io.IOException; @@ -71,6 +76,25 @@ return success(BeanUtils.toBean(device, DeviceRespVO.class)); } + @GetMapping("/get-by-dev-id") + @Operation(summary = "鑾峰緱璁惧") + @Parameter(name = "devId", description = "缂栧彿", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") + public CommonResult<DeviceRespVO> getDevice(@RequestParam("dev-id") String devId) { + DeviceDO device = deviceService.getDevice(devId); + return success(BeanUtils.toBean(device, DeviceRespVO.class)); + } + + @PostMapping("/update-dev-state") + @Operation(summary = "鏇存柊璁惧鐘舵��") + @Parameter(name = "devId", description = "缂栧彿", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") + public CommonResult<Integer> updateDeviceState(@Valid @RequestBody DeviceSaveReqVO updateReqVO) { + updateReqVO.setStateDate( LocalDate.now() ); + Integer ret = deviceService.updateDeviceState(updateReqVO); + return success(ret); + } + @GetMapping("/page") @Operation(summary = "鑾峰緱璁惧鍒嗛〉") @PreAuthorize("@ss.hasPermission('ecg:device:query')") @@ -92,4 +116,12 @@ BeanUtils.toBean(list, DeviceRespVO.class)); } -} \ No newline at end of file + @GetMapping("/dev-statistic") + @Operation(summary = "璁惧缁熻") + @PreAuthorize("@ss.hasPermission('ecg:device:statistic')") + public CommonResult<List<DeviceStatisticVO>> getDeviceStatistic(@Valid DevicePageReqVO pageReqVO) { + List<DeviceStatisticDO> statisticDOList = deviceService.getDeviceStatistic(pageReqVO); + return success(BeanUtils.toBean(statisticDOList, DeviceStatisticVO.class)); + } + +} -- Gitblit v1.9.3