自动化立体仓库 - WMS系统
pang.jiabao
2024-12-19 e8cdc81123495b0a3aa3473554fb7c0465386f44
src/main/java/com/zy/common/utils/OutStockInterceptUtil.java
@@ -1,6 +1,7 @@
package com.zy.common.utils;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasDevp;
@@ -21,11 +22,13 @@
    /**
     * 堆垛机库入库站点
     */
    public static final Map<Integer,Boolean> inSiteMap = new HashMap<Integer,Boolean>(){{
        inSiteMap.put(1040,true);
        inSiteMap.put(2010,true);inSiteMap.put(2000,true);
        inSiteMap.put(3010,true);
    }};
    public static final Map<Integer,Boolean> inSiteMap = new HashMap<Integer,Boolean>();
    static {
        inSiteMap.put(1040, true);
        inSiteMap.put(2010, true);inSiteMap.put(2000, true);
        inSiteMap.put(3010, true);
    }
    /**
     * 堆垛机出库操作时拦截出库站点,判断出入库模式
@@ -33,7 +36,7 @@
     */
    public static void outStockIntercept(Integer site){
        // 只判断堆垛机库的入库站点
        if (inSiteMap.get(site)) {
        if (inSiteMap.get(site) != null) {
            BasDevpMapper basDevpMapper = SpringUtils.getBean(BasDevpMapper.class);
            BasDevp basDevp = basDevpMapper.selectById(site);
            String devMk = basDevp.getDevMk();
@@ -42,8 +45,15 @@
            } else if (devMk.equals("2")) {
                 // 判断该站点入库任务是否完成
                WrkMastMapper wrkMastMapper = SpringUtils.getBean(WrkMastMapper.class);
                int count = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>()
                        .eq("source_sta_no", site).in("io_type",1,10,53,57));
                Wrapper<WrkMast> wrapper = new EntityWrapper<WrkMast>().in("io_type", 1, 10, 53, 57);
                switch (site) {
                    case 1040: wrapper.in("sta_no","1043","1044");break;
                    case 2010: wrapper.in("sta_no","2013","2014"); break;
                    case 2000: wrapper.in("sta_no","2003","2004");break;
                    case 3010: wrapper.in("sta_no","3013","3014");break;
                    default:
                }
                int count = wrkMastMapper.selectCount(wrapper);
                if (count == 0) {
                    basDevp.setDevMk("0"); // 没有入库任务,切换成出库模式
                    basDevpMapper.updateById(basDevp);