自动化立体仓库 - WMS系统
skyouc
3 天以前 7195aaf32896dc48b686b1a145e67a9afe9205dd
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -133,7 +133,7 @@
        locMast.setLocSts("Q");
        locMast.setModiTime(now);
        locMast.setModiUser(userId);
        if (!locCacheService.updateById(locMast)) {
        if (!locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()))) {
            throw new CoolException("修改库位状态失败");
        }
    }
@@ -160,22 +160,22 @@
        String locNo = ""; // 待修改目标库位
        String locSts = ""; // 待修改目标库位状态
        // 入库取消(修改目标库位)
        if (wrkMast.getWrkSts() < 4) {
        if (wrkMast.getIoType() == 1 &&  wrkMast.getWrkSts() < 204) {
            locNo = wrkMast.getLocNo();
            locSts = "O";
            // 库位转移
            if (wrkMast.getIoType() == 11) {
                // 库位转移:源库位
                LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getSourceLocNo()));
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
                }
                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F");
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                locCacheService.updateById(locMast);
            }
//            // 库位转移
//            if (wrkMast.getIoType() == 11) {
//                // 库位转移:源库位
//                LocCache locMast = locCacheService.selectOne(new EntityWrapper<LocCache>().eq("loc_no", wrkMast.getSourceLocNo()));
//                if (Cools.isEmpty(locMast)) {
//                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
//                }
//                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F");
//                locMast.setModiTime(now);
//                locMast.setModiUser(userId);
//                locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()));
//            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (station.getLocSts().equals("R")) {
@@ -189,7 +189,7 @@
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
            // 出库取消(修改源库位)
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) {
        } else if (wrkMast.getWrkSts() > 300 && wrkMast.getWrkSts() < 304) {
            locNo = wrkMast.getSourceLocNo();
            // 出库 ===>> F.在库
            if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) {
@@ -208,27 +208,19 @@
                locMast.setLocSts("O");
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                locCacheService.updateById(locMast);
                locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()));
//                locCacheService.updateById(locMast);
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo()));
            if (station.getLocSts().equals("S")) {
                station.setLocSts("O");
                station.setBarcode("");
                station.setModiTime(new Date());
                station.setModiUser(userId);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("更新源站点状态失败");
                }
            } else {
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            station.setLocSts("O");
            station.setBarcode("");
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {
                throw new CoolException("更新源站点状态失败");
            }
        } else {
            throw new CoolException("当前工作状态无法取消");
        }
        //取消入库工作档时,查询组托表,如果有将状态改为待处理
        if (wrkMast.getIoType() == 1) {
        } else if (wrkMast.getIoType() == 1) {
            List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
            for (WaitPakin waitPakin : waitPakins) {
                if (!Cools.isEmpty(waitPakin)) {
@@ -241,7 +233,22 @@
                            .eq("batch", waitPakin.getBatch()));
                }
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (station.getLocSts().equals("R")) {
                station.setLocSts("O");
                station.setBarcode("");
                station.setModiTime(new Date());
                station.setModiUser(userId);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("更新源站点状态失败");
                }
            }
        } else {
            throw new CoolException("当前工作状态无法取消");
        }
        //取消入库工作档时,查询组托表,如果有将状态改为待处理
        //取消出库工作档时,查询单据管理表,回滚作业中数量
        if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) {
@@ -324,7 +331,8 @@
        locMast.setLocSts(locSts);
        locMast.setModiTime(now);
        locMast.setModiUser(userId);
        boolean locMastRes = locCacheService.updateById(locMast);
        boolean locMastRes = locCacheService.update(locMast, new EntityWrapper<LocCache>().eq("loc_no", locMast.getLocNo()));
        if (!wrkMastRes || !locMastRes) {
            throw new CoolException("保存数据失败");
        }