自动化立体仓库 - WMS系统
whycq
2024-07-23 0301e6673ac109b076f4feba47a9cee0ef033afa
src/main/java/com/zy/asrs/task/AutoMoveScheduler.java
@@ -56,14 +56,14 @@
     * ioType 108.自动调拨
     * crnNo :2目标楼层
     */
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute2(){
    @Scheduled(cron = "0/3 * * * * ? ")
    private synchronized void execute2(){
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",108)
                        .andNew()
                        .eq("crn_no",2).or().eq("crn_no",3)
                        .orderBy("appe_time",true)
                        .orderBy("io_pri",false).orderBy("appe_time",true)
                );
        if (agvWrkMastList.isEmpty()) {
            return;
@@ -110,6 +110,7 @@
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",111)
                .orderBy("io_pri",false)
                .orderBy("appe_time",true)
        );
        if (agvWrkMastList.isEmpty()) {
@@ -118,6 +119,27 @@
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            try{
                autoMoveHandler.start3(agvWrkMast);
            } catch (Exception e){
                log.error("工作号"+agvWrkMast.getWrkNo()+"调拨出库,处理失败:===》异常原因:"+e.getMessage());
            }
        }
    }
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute4(){
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",114)
                .orderBy("io_pri",false)
                .orderBy("appe_time",true)
        );
        if (agvWrkMastList.isEmpty()) {
            return;
        }
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            try{
                autoMoveHandler.start4(agvWrkMast);
            } catch (Exception e){
                log.error("工作号"+agvWrkMast.getWrkNo()+"调拨出库,处理失败:===》异常原因:"+e.getMessage());
            }
@@ -158,7 +180,8 @@
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 214)
                .eq("loc_no","")
                .eq("io_type",113));
                .eq("io_type",113)
                .orderBy("io_pri",false));
        if (agvWrkMastList.isEmpty()) {
            return;
        }
@@ -219,6 +242,23 @@
        }
    }
    private boolean determineFloorConnection(Integer floor){
        try{
            List<AgvBasDevp> agvBasDevps = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("floor", floor).like("dev_no", "DB_"));
            if (!agvBasDevps.isEmpty()){
                for (AgvBasDevp agvBasDevp:agvBasDevps){
                    if (agvBasDevp.getInEnable().equals("Y")){
                        return false;
                    }
                }
                return true;
            }
        }catch (Exception e){
            log.error("判断当前楼层接驳位是否全部关闭,异常"+e.getMessage());
        }
        return false;
    }
    /**
     * 站点是否自动
     * 自动: 生成 109 自动回流