自动化立体仓库 - WMS系统
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -387,6 +387,7 @@
            wrkMast.setModiUser(userId);
            wrkMast.setModiTime(now);
            wrkMast.setPacked(itemId);
            wrkMast.setMk(locMast.getMk());
            if (!wrkMastService.insert(wrkMast)) {
                throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo());
            }
@@ -461,6 +462,10 @@
        }
        // 获取库位
        LocMast locMast = locMastService.selectById(taskDto.getLocNo());
        if(!locMast.getLocSts().equals("F")) {
            throw new CoolException("订单预览数据已过期,请重试");
        }
        // 判断是否是盘点单
        String orderNo = taskDto.getLocDtos().get(0).getOrderNo();
        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
@@ -498,6 +503,7 @@
        wrkMast.setAppeTime(now);
        wrkMast.setModiUser(userId);
        wrkMast.setModiTime(now);
        wrkMast.setMk(locMast.getMk());
        if (!wrkMastService.insert(wrkMast)) {
            throw new CoolException("保存工作档失败,出库库位号:" + taskDto.getLocNo());
        }
@@ -703,6 +709,7 @@
            wrkMast.setAppeTime(now);
            wrkMast.setModiUser(userId);
            wrkMast.setModiTime(now);
            wrkMast.setMk(locMast.getMk());
            boolean res = wrkMastService.insert(wrkMast);
            if (!res) {
                throw new CoolException("保存工作档失败");
@@ -773,6 +780,7 @@
            wrkMast.setAppeTime(now);
            wrkMast.setModiUser(1L);
            wrkMast.setModiTime(now);
            wrkMast.setMk(locMast.getMk());
            wrkMast.setMemo("生成自动空板出库");
            boolean res = wrkMastService.insert(wrkMast);
            if (!res) {
@@ -813,6 +821,7 @@
                throw new CoolException(firstFrozenLocNo + "库位已被冻结!");
            }
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()));
            if (locMast.getLocSts().equals("F")) {
                // 启动出库开始 107.盘点出库
                stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId, param.getCheckId(), null);
@@ -832,10 +841,36 @@
        if (Cools.isEmpty(sourceLoc)) {
            throw new CoolException("未找到库位");
        }
        if (Utils.isDeepLoc(slaveProperties, sourceLocNo)) {
            String shallowLoc = Utils.getShallowLoc(slaveProperties, sourceLocNo);
            LocMast locMast = locMastService.selectById(shallowLoc);
            if (locMast == null) {
                throw new CoolException(shallowLoc + "浅库位不存在");
            }
            if(!locMast.getLocSts().equals("O")) {
                throw new CoolException(shallowLoc + "浅库位状态不为空");
            }
        }
        LocMast loc = locMastService.selectById(locNo);
        if (Cools.isEmpty(loc)) {
            throw new CoolException("未找到库位");
        }
        if (Utils.isDeepLoc(slaveProperties, locNo)) {
            String shallowLoc = Utils.getShallowLoc(slaveProperties, locNo);
            LocMast locMast = locMastService.selectById(shallowLoc);
            if (locMast == null) {
                throw new CoolException(shallowLoc + "浅库位不存在");
            }
            if(!locMast.getLocSts().equals("O")) {
                throw new CoolException(shallowLoc + "浅库位有货,无法移转");
            }
        }
        // 判断库位是否冻结
        String sourceLocFrozen = locMastMapper.findFirstFrozenLocNo(Arrays.asList(sourceLoc.getLocNo(), loc.getLocNo()));
        if (sourceLocFrozen != null) {
@@ -878,6 +913,7 @@
        wrkMast.setAppeTime(now);
        wrkMast.setModiUser(userId);
        wrkMast.setModiTime(now);
        wrkMast.setMemo("人工手动移库");
        boolean res = wrkMastService.insert(wrkMast);
        if (!res) {
            throw new CoolException("保存工作档失败");
@@ -1008,7 +1044,7 @@
                        // todo 盘点记录
                        // 修改库存
                        if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(),
                                locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3())) {
                                adjust.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(), locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3())) {
                            throw new CoolException(locDetl.getLocNo() + "库位," + locDetl.getMatnr() + "商品," + locDetl.getBatch() + "批号修改数量失败");
                        }
                        // 保存调整记录
@@ -1182,6 +1218,9 @@
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
        if (wrkMast.getWrkSts() ==14|| wrkMast.getWrkSts() == 15) {
            throw new CoolException(workNo + "工作档已完成不允许取消");
        }
        String locNo = ""; // 待修改目标库位
        String locSts = ""; // 待修改目标库位状态
        // 入库取消(修改目标库位)