eight
2024-09-20 a9bfa2051eba0f8f1d1a8430292a89113f62b35f
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;
@@ -49,6 +48,12 @@
    public CommonResult<Long> installOperation(DevRentSaveReqVO createReqVO) {
        Long userId = SecurityFrameworkUtils.getLoginUserId();
        String userNickname = SecurityFrameworkUtils.getLoginUserNickname();
        // 检查设备编号
        DeviceDO deviceDO = deviceMapper.getDeviceByDevId( createReqVO.getDevId() );
        if (null == deviceDO ) {
            return CommonResult.error(DEVICE_NOT_EXISTS);
        }
        Long rent_id = createReqVO.getId();
        if (null == rent_id) {
@@ -261,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);
        }
    }
@@ -282,7 +287,7 @@
    private void markDevLost(DevRentSaveReqVO createReqVO) {
        // 设备标注遗失
        DeviceDO deviveDO = deviceMapper.selectById(createReqVO.getDevId());
        DeviceDO deviveDO = deviceMapper.getDeviceByDevId(createReqVO.getDevId());
        if (null != deviveDO) {
            deviveDO.setLost(1);
            deviveDO.setLoseDate( createReqVO.getReturnTime().toLocalDate() );
@@ -292,7 +297,7 @@
    private void resumeDevLost(DevRentSaveReqVO createReqVO) {
        // 设备标注遗失 恢复为正常
        DeviceDO deviveDO = deviceMapper.selectById(createReqVO.getDevId());
        DeviceDO deviveDO = deviceMapper.getDeviceByDevId(createReqVO.getDevId());
        if (null != deviveDO) {
            deviveDO.setLost(0);
            deviveDO.setLoseDate( null );
@@ -300,4 +305,4 @@
        }
    }
}
}