pang.jiabao
2025-07-20 504b8cb910483dd7771984682488e8d5e7826d42
src/main/java/com/zy/service/impl/MainServiceImpl.java
@@ -118,6 +118,9 @@
    private WaitPakinMapper waitPakinMapper;
    @Autowired
    private LocMastService locMastService;
    @Resource
    private LocMastMapper locMastMapper;
    @Autowired
    private StaDescService staDescService;
    @Autowired
@@ -731,7 +734,7 @@
                        continue;
                    }
                } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
                } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("M")|| shallowLoc.getLocSts().equals("Z")) {
                    News.warnNoLog(""+mark+" - 1"+" - 12"+" - // F、D  库位状态={}",shallowLoc.getLocSts());
                    // 此标记避免多次执行移库任务
                    if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) {
@@ -898,7 +901,7 @@
                                }
                            }
                        } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
                        } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("M")|| shallowLoc.getLocSts().equals("Z")) {
                            News.warnNoLog(""+mark+" - 2"+" - 9"+" - // F、D  库位状态={}",shallowLoc.getLocSts());
//                            WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
                            //2022-08-16 modify,不根据updmk标记移库任务(容易被取消导致堵塞),查询工作档是否存在任务
@@ -1526,13 +1529,25 @@
     */
    private synchronized void moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc,Integer mark) {
        // 只有208L能放11层
        String model = null;
        if(shallowLoc.getLocSts().equals("F")) {
            LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", shallowLoc.getLocNo()));
            if(locDetl != null && locDetl.getModel() != null) {
                String matModel = locMastMapper.selectMatMatnrByMaktx(locDetl.getModel());
                if(matModel != null && matModel.equals("208L")) {
                    model = "208L";
                }
            }
        }
        try {
            News.warnNoLog(""+mark+"moveLocForDeepLoc"+" - 0"+" - 开始执行:因双深库位阻塞,对浅库位进行移转(立即执行版)");
            List<Integer> rows = locMastService.queryDistinctRow(crn.getId());
            LocMast loc = null;
            for (Integer row : rows) {
                if (Utils.isDeepLoc(slaveProperties, row)) {
                    loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
//                    loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
                    loc = locMastMapper.queryFreeLocMastNew(row,model);
                    if (loc != null) {
                        if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
@@ -1551,12 +1566,12 @@
            if (null == loc) {
                for (Integer row : rows) {
                    if (Utils.isShallowLoc(slaveProperties, row)) {
                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
//                        loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2());
                        loc = locMastMapper.queryFreeLocMastNew(row,model);
                        if (null != loc) {//对应深库位非在库状态,不能移库
                            String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo());
                            LocMast deepLoc1 = locMastService.selectById(deepLoc);
                            if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("D")) {
                            if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("M")&& !deepLoc1.getLocSts().equals("Z")) {
                                loc = null;
                            }
                        }
@@ -1588,7 +1603,7 @@
                wrkMast.setFullPlt(shallowLoc.getLocSts().equals("F") ? "Y" : "N"); // 满板
                wrkMast.setPicking("N"); // 拣料
                wrkMast.setExitMk("N"); // 退出
                wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板
                wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("M") ? "M" : shallowLoc.getLocSts().equals("Z") ? "Z" : "N"); // 空板
                wrkMast.setBarcode(shallowLoc.getBarcode()); // 托盘码
                wrkMast.setLinkMis("N");
                wrkMast.setAppeTime(new Date());
@@ -1616,7 +1631,7 @@
                    }
                }
                // 修改源库位状态
                if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("F")) {
                if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("M") || shallowLoc.getLocSts().equals("Z")) {
                    shallowLoc.setLocSts("R"); // R.出库预约
                    shallowLoc.setModiTime(new Date());
                    if (!locMastService.updateById(shallowLoc)) {