自动化立体仓库 - WMS系统
whycq
2024-05-29 b8f320c817c486c33613ca196ceab7c8fd354bae
src/main/java/com/zy/asrs/task/AutoMoveScheduler.java
@@ -3,7 +3,9 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.entity.AgvLocMast;
import com.zy.asrs.entity.AgvWrkMast;
import com.zy.asrs.service.AgvLocMastService;
import com.zy.asrs.service.AgvWrkMastService;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.AutoMoveHandler;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +23,8 @@
    private AgvLocMastService agvLocMastService;
    @Autowired
    private AutoMoveHandler autoMoveHandler;
    @Autowired
    private AgvWrkMastService agvWrkMastService;
    // 调拨出库
    @Scheduled(cron = "0/2 * * * * ? ")
@@ -40,8 +44,59 @@
    }
    // 空板自动回库
    // 调拨出库
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute2(){
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",108)
                        .eq("crn_no",2)
                        .orderBy("appe_time",true)
                );
        if (agvWrkMastList.isEmpty()) {
            return;
        }
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            ReturnT<String> returnT = autoMoveHandler.start2(agvWrkMast);
        }
    }
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute5(){
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",108)
                .eq("crn_no",3)
                .orderBy("appe_time",true)
        );
        if (agvWrkMastList.isEmpty()) {
            return;
        }
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            ReturnT<String> returnT = autoMoveHandler.start2(agvWrkMast);
        }
    }
    // 调拨出库
    @Scheduled(cron = "0/2 * * * * ? ")
    private void execute3(){
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 22)
                .andNew().eq("io_type",111)
        );
        if (agvWrkMastList.isEmpty()) {
            return;
        }
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            ReturnT<String> returnT = autoMoveHandler.start3(agvWrkMast);
        }
    }
    // 空板自动回库  库位-接驳点
    //@Scheduled(cron = "0/2 * * * * ? ")
    private void autoEmptyBack(){
        // 查询 不为1楼的空货架
        List<AgvLocMast> agvLocMasts = agvLocMastService.selectList(
@@ -55,6 +110,39 @@
        for (AgvLocMast agvLocMast : agvLocMasts) {
            ReturnT<String> returnT = autoMoveHandler.autoEmptyBack(agvLocMast);
        }
    }
    // 空板自动回库  接驳点 - 1楼库位
    //@Scheduled(cron = "0/2 * * * * ? ")
    private void autoEmptyBack3(){
        // 工作档为201 且 入出库类型为109
        List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>()
                .eq("wrk_sts", 201)
                .eq("loc_no","")
                .eq("io_type",109)
                .or().eq("io_type",112));
        if (agvWrkMastList.isEmpty()) {
            return;
        }
        for (AgvWrkMast agvWrkMast : agvWrkMastList) {
            ReturnT<String> returnT = autoMoveHandler.autoEmptyBack3(agvWrkMast);
        }
    }
    // 空板自动回库
    @Scheduled(cron = "0/2 * * * * ? ")
    private void autoEmptyBack2(){
        // 查询 不为1楼的空货架
        List<AgvLocMast> agvLocMasts = agvLocMastService.selectList(
                new EntityWrapper<AgvLocMast>()
                        .ne("floor", 1)
                        .eq("loc_sts","D")
                        .eq("loc_type1",3));
        if (agvLocMasts.isEmpty()) {
            return;
        }
        for (AgvLocMast agvLocMast : agvLocMasts) {
            ReturnT<String> returnT = autoMoveHandler.autoEmptyBack2(agvLocMast);
        }
    }
}