whyclxw
2025-04-19 124b7c033060cfc35f1bc3344d4a14724948deaf
添加锁的同名判断
2个文件已修改
10 ■■■■■ 已修改文件
src/main/java/com/whyc/service/LockInfService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LockCtlLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/LockInfService.java
@@ -63,6 +63,15 @@
        int lockId=0;
        if(sinf!=null){
            stationId=sinf.getStationId();
            //根据锁名判断机房下是否存在同名锁
            QueryWrapper wrapper1=new QueryWrapper();
            wrapper1.eq("station_id",stationId);
            wrapper1.eq("lock_name",lockInf.getLockName());
            wrapper1.last("limit 1");
            LockInf judgeLock=mapper.selectOne(wrapper1);
            if (judgeLock!=null){
                return new Response().set(1,false,"当前机房下已经存在同名锁");
            }
            //获取当前最大的锁
            lockId=getMaxLockId(stationId);
            if(lockId==0){
src/main/resources/mapper/LockCtlLogMapper.xml
@@ -69,7 +69,6 @@
            <if test="logDto.endTime!=null">
                and tb_lock_ctl_log.ctl_time&lt;=#{logDto.endTime}
            </if>
            and tb_lock_ctl_log.lock_id in(
            select distinct lock_id from plus_user.tb_baojigroup_lock,plus_user.tb_baojigroup_usr
            <where>