wujianwei
2025-09-10 d68d7e5d1fe9659ea21868809dab69a814e07f04
service/src/main/java/com/ruoyi/cwgl/service/impl/SmartLockerApplicationServiceImpl.java
@@ -1,7 +1,9 @@
package com.ruoyi.cwgl.service.impl;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
@@ -179,4 +181,33 @@
    {
        return smartLockerApplicationMapper.deleteSmartLockerApplicationById(id);
    }
    @Override
    public int invalid(Integer id) {
        SmartLockerApplication smartLockerApplication = smartLockerApplicationMapper.selectSmartLockerApplicationById(id);
        if (smartLockerApplication==null){
            throw new ServiceException("数据不存在");
        }
        smartLockerApplication.setCancelTime(new Date());
        smartLockerApplication.setStatus(1);
        return smartLockerApplicationMapper.updateSmartLockerApplication(smartLockerApplication);
    }
    @Override
    @DataSource(DataSourceType.CWSJ)
    public Integer selectCwByLicensePlateNumber(String licensePlateNumber) {
        Integer integer = smartLockerApplicationMapper.selectCwByLicensePlateNumber(licensePlateNumber);
        if (integer==null){
            throw new ServiceException("查询不到智能柜格口号");
        }
        return integer;
    }
    @Override
    public void updateExpiredStatus() {
        int i = smartLockerApplicationMapper.updateExpiredStatus();
        logger.info("更新{}条数据过期状态成功",i);
    }
}