eight
2024-09-20 a9bfa2051eba0f8f1d1a8430292a89113f62b35f
 拆机界面 设备详情显示
已修改4个文件
60 ■■■■ 文件已修改
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jh-module-ecg/jh-module-ecg-api/src/main/java/cn/lihu/jh/module/ecg/enums/ErrorCodeConstants.java
@@ -13,27 +13,31 @@
    ErrorCode APPOINTMENT_NOT_EXISTS = new ErrorCode(1_010_001_000, "预约不存在");
    ErrorCode APPOINTMENT_NOT_TODAY = new ErrorCode(1_010_001_001, "不是当天预约");
    ErrorCode ROOM_NOT_EXISTS = new ErrorCode(1_010_002_000, "诊室和诊疗床不存在");
    ErrorCode ROOM_NOT_SIT = new ErrorCode(1_010_002_001, "请重新就座");
    ErrorCode ROOM_INVALID_STATUS = new ErrorCode(1_010_002_001, "诊室和诊疗床状态异常");
    ErrorCode QUEUE_NOT_EXISTS = new ErrorCode(1_010_003_000, "排队不存在");
    ErrorCode QUEUE_BED_NOT_EXIST = new ErrorCode(1_010_003_001, "工位队列不存在");
    ErrorCode QUEUE_BED_EXIST = new ErrorCode(1_010_003_001, "工位队列已存在");
    ErrorCode QUEUE_HAVE_PATIENT = new ErrorCode(1_010_003_002, "队列中有患者");
    ErrorCode QUEUE_NOT_READY_PATIENT = new ErrorCode(1_010_003_003, "没有准备中的患者");
    ErrorCode QUEUE_BED_EXIST = new ErrorCode(1_010_003_002, "工位队列已存在");
    ErrorCode QUEUE_HAVE_PATIENT = new ErrorCode(1_010_003_003, "队列中有患者");
    ErrorCode QUEUE_NOT_READY_PATIENT = new ErrorCode(1_010_003_004, "没有准备中的患者");
    ErrorCode PATIENT_NOT_EXISTS = new ErrorCode(1_010_004_000, "患者不存在");
    ErrorCode DEV_MODEL_NOT_EXISTS = new ErrorCode(1_010_005_000, "设备型号不存在");
    ErrorCode DEVICE_NOT_EXISTS = new ErrorCode(1_010_005_001,  "设备不存在");
    ErrorCode DEV_RENT_NOT_EXISTS = new ErrorCode(1_010_005_002, "租借不存在");
    ErrorCode DEV_INSTALL_EXCEPTION = new ErrorCode(1_010_005_003, "装机内部错误");
    ErrorCode DEV_DISMANTLE_EXCEPTION = new ErrorCode(1_010_005_004, "拆机内部错误");
    ErrorCode DEV_CANCEL_EXCEPTION = new ErrorCode(1_010_005_005, "拆机内部错误");
    ErrorCode DEV_LOSE_EXCEPTION = new ErrorCode(1_010_005_005, "遗失内部错误");
    ErrorCode DEV_INSTALL_EXIST = new ErrorCode(1_010_005_006, "当天已有装机");
    ErrorCode DEV_DISMANTLE_EXIST = new ErrorCode(1_010_005_006, "当天已有拆机");
    ErrorCode JOB_RECORD_NOT_EXISTS = new ErrorCode(1_010_006_000, "工作记录不存在");
    ErrorCode DEV_INSTALL_NOT_EXISTS = new ErrorCode(1_010_006_000, "装机不存在");
    ErrorCode DEV_INSTALL_EXCEPTION = new ErrorCode(1_010_006_001, "装机内部错误");
    ErrorCode DEV_DISMANTLE_EXCEPTION = new ErrorCode(1_010_006_002, "拆机内部错误");
    ErrorCode DEV_CANCEL_EXCEPTION = new ErrorCode(1_010_006_003, "取消装机内部错误");
    ErrorCode DEV_LOSE_EXCEPTION = new ErrorCode(1_010_006_004, "遗失内部错误");
    ErrorCode DEV_INSTALL_EXIST = new ErrorCode(1_010_006_005, "当天已有装机");
    ErrorCode DEV_DISMANTLE_EXIST = new ErrorCode(1_010_006_006, "当天已有拆机");
    ErrorCode CALL_NOT_EXISTS = new ErrorCode(1_010_007_000, "叫号不存在");
    ErrorCode JOB_RECORD_NOT_EXISTS = new ErrorCode(1_010_007_000, "工作记录不存在");
    ErrorCode CALL_NOT_EXISTS = new ErrorCode(1_010_008_000, "叫号不存在");
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -1,6 +1,8 @@
package cn.lihu.jh.module.ecg.controller.admin.devrent;
import cn.lihu.jh.framework.common.util.exception.ExceptionUtils;
import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
import cn.lihu.jh.module.ecg.service.devmanage.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@@ -21,7 +23,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.framework.common.util.exception.ExceptionUtils.formatException;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
@@ -41,6 +42,9 @@
    @Resource
    private DevRentService devRentService;
    @Resource
    private DeviceService deviceService;
    @PostMapping("/dev-install")
    @Operation(summary = "装机")
@@ -155,6 +159,16 @@
    public CommonResult<DevRentRespVO> getLatestRent( @Valid DevRentSearchReqVO searchReqVO )
    {
        DevRentDO devRent = devRentService.getLatestRent( searchReqVO );
        return CommonResult.success(BeanUtils.toBean(devRent, DevRentRespVO.class));
        if (null == devRent) {
            return CommonResult.success(null);
        }
        DeviceDO deviceDO = deviceService.getDevice( devRent.getDevId() );
        DevRentRespVO devRentRespVO = BeanUtils.toBean(devRent, DevRentRespVO.class);
        devRentRespVO.setCategory( deviceDO.getCategory() );
        devRentRespVO.setBrand( deviceDO.getBrand() );
        devRentRespVO.setModel( deviceDO.getModel() );
        return CommonResult.success(devRentRespVO);
    }
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentRespVO.java
@@ -64,4 +64,13 @@
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
    @Schema(description = "分类名")
    private String category;
    @Schema(description = "品牌")
    private String brand;
    @Schema(description = "型号")
    private String model;
}
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -12,11 +12,10 @@
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.*;
import cn.lihu.jh.module.ecg.controller.admin.devrent.vo.*;
import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.common.pojo.PageParam;
import cn.lihu.jh.framework.common.util.object.BeanUtils;
import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper;
@@ -267,7 +266,7 @@
    private void validateDevRentExists(Long id) {
        if (devRentMapper.selectById(id) == null) {
            throw exception(DEV_RENT_NOT_EXISTS);
            throw exception(DEV_INSTALL_NOT_EXISTS);
        }
    }