eight
2025-04-10 c85110528d1a68c1132c244a9f8f3da4087b41bb
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -1,12 +1,10 @@
package cn.lihu.jh.module.ecg.controller.admin.devrent;
import cn.lihu.jh.framework.common.util.exception.ExceptionUtils;
import cn.lihu.jh.framework.security.core.util.SecurityFrameworkUtils;
import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
import cn.lihu.jh.module.ecg.enums.DevStateEnum;
import cn.lihu.jh.module.ecg.service.devmanage.DeviceService;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import io.swagger.v3.oas.models.security.SecurityScheme;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@@ -27,7 +25,6 @@
import cn.lihu.jh.framework.apilog.core.annotation.ApiAccessLog;
import static cn.lihu.jh.framework.apilog.core.enums.OperateTypeEnum.*;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO;
@@ -60,10 +57,6 @@
    public CommonResult<Long> routineFinish(@Valid @RequestBody RoutineFinishReqVO routineFinishReqVO) {
        CommonResult<Long> result = devRentService.routineFinishOperation(routineFinishReqVO);
        // 抢 排队 患者
        queueService.startHurryUpOneBed(routineFinishReqVO.getRoomId(), routineFinishReqVO.getBedNo());
        // 自动确费
        try {
            String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
            String userHisId = SecurityFrameworkUtils.getLoginUserHisId();
@@ -82,10 +75,6 @@
    public CommonResult<Long> devReady(@Valid @RequestBody DevRentSaveReqVO createReqVO) {
        CommonResult<Long> result = devRentService.readyOperation(createReqVO);
        // 抢 排队 患者
        queueService.startHurryUpOneBed(createReqVO.getRoomId(), createReqVO.getBedNo());
        // 自动确费
        try {
            String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
            String userHisId = SecurityFrameworkUtils.getLoginUserHisId();
@@ -196,6 +185,7 @@
            devRentRespVO.setCategory(deviceDO.getCategory());
            devRentRespVO.setBrand(deviceDO.getBrand());
            devRentRespVO.setModel(deviceDO.getModel());
            devRentRespVO.setDevState(deviceDO.getState());
        }
        return CommonResult.success(devRentRespVO);
    }
@@ -252,16 +242,17 @@
            devRentRespVO.setCategory(deviceDO.getCategory());
            devRentRespVO.setBrand(deviceDO.getBrand());
            devRentRespVO.setModel(deviceDO.getModel());
            devRentRespVO.setDevState(deviceDO.getState());
        }
        return CommonResult.success(devRentRespVO);
    }
    @GetMapping("/get-installed-rent")
    @Operation(summary = "获取已安装租赁情况")
    @GetMapping("/get-existing-rent")
    @Operation(summary = "获取已安装、已领用的租赁情况")
    @PreAuthorize("@ss.hasPermission('ecg:doctor:task')")
    public CommonResult<DevRentRespVO> getInstalledRent( @Valid DevRentSearchReqVO searchReqVO )
    {
        DevRentDO devRent = devRentService.getInstalledOrCancelledRent( searchReqVO );
        DevRentDO devRent = devRentService.getExistingRent( searchReqVO );
        if (null == devRent) {
            return CommonResult.success(null);
        }
@@ -272,6 +263,7 @@
        devRentRespVO.setCategory( deviceDO.getCategory() );
        devRentRespVO.setBrand( deviceDO.getBrand() );
        devRentRespVO.setModel( deviceDO.getModel() );
        devRentRespVO.setDevState( devRent.getState() );
        return CommonResult.success(devRentRespVO);
    }