自动化立体仓库 - WMS系统
#
Junjie
2024-04-02 0c45c200a1977c66096af34bb0480744c8d3c76f
#
1个文件已添加
3个文件已修改
52 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/ClearLiftLocNoScheduler.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -49,4 +49,6 @@
    List<LocMast> selectLocDetlNotExist();
    int clearLiftLocNo();
}
src/main/java/com/zy/asrs/task/ClearLiftLocNoScheduler.java
New file
@@ -0,0 +1,40 @@
package com.zy.asrs.task;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.mapper.LocMastMapper;
import com.zy.asrs.service.LocMastService;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class ClearLiftLocNoScheduler {
    @Autowired
    private LocMastMapper locMastMapper;
    @Autowired
    private ConfigService configService;
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute(){
        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","tmpSwitch"));
        if (config == null) {
            return;
        }
        if (!config.getValue().equals("true")) {
            return;
        }
        int clearLiftLocNo = locMastMapper.clearLiftLocNo();
        if (clearLiftLocNo > 0) {
            log.info("清理提升机附近库位:" + clearLiftLocNo + "个");
        }
    }
}
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -238,8 +238,6 @@
                            throw new CoolException("改变库位状态失败");
                        }
                        locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no",locMast1.getLocNo()));
                    } else {
                        throw new CoolException("源库位状态异常");
                    }
                    break;
src/main/resources/mapper/LocMastMapper.xml
@@ -162,4 +162,12 @@
        on lm.loc_no = ld.loc_no
        where ld.matnr is null and lm.loc_sts = 'F'
    </select>
    <delete id="clearLiftLocNo">
        update asr_loc_mast set loc_sts = 'S'
        where row1 >=1 and row1 &lt;= 16
        and bay1 in(21,22,23,37,38,39,56,57,58)
        and lev1 >= 3 and lev1 &lt;= 10
        and loc_sts = 'O'
    </delete>
</mapper>