自动化立体仓库 - WMS系统
pjb
2025-07-10 59faff8bcfda7d9b33e133f88b3f3e97f3d84db3
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -555,16 +555,16 @@
            throw new CoolException(firstFrozenLocNo + "库位已被冻结!");
        }
        if (Cools.isEmpty(param.getOutSite())) {
            throw new CoolException("站点不存在");
        }
        for (String locNo : param.getLocNos()) {
            // 获取工作号
            int workNo = commonService.getWorkNo(WorkNoType.PAKOUT.type);
            int workNo = commonService.getWorkNo(2);
            // 获取库位
            LocMast locMast = locMastService.selectById(locNo);
            if (Cools.isEmpty(locMast)) {
                throw new CoolException(locNo+"库位不存在");
            }
            if (!locMast.getLocSts().equals("D")){
                throw new CoolException("所选库位存在状态不为D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$());
            }
            // 获取源站
            Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
@@ -582,8 +582,8 @@
            wrkMast.setWrkNo(workNo);
            wrkMast.setIoTime(now);
            wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID
            wrkMast.setIoType(110); // 入出库状态: 110.空板出库
            wrkMast.setIoPri(10D);
            wrkMast.setIoType(110); // 入出库状态
            wrkMast.setIoPri(14D);
            wrkMast.setSourceStaNo(sourceStaNo); // 源站
            wrkMast.setStaNo(param.getOutSite()); // 目标站
            wrkMast.setCrnNo(locMast.getCrnNo());
@@ -602,7 +602,7 @@
                throw new CoolException("保存工作档失败");
            }
            // 更新库位状态 D.空板 -> R.出库预约
            if (locMast.getLocSts().equals("D")){
            if (locMast.getLocSts().equals("M") || locMast.getLocSts().equals("Z")){
                locMast.setLocSts("R");
                locMast.setModiUser(userId);
                locMast.setModiTime(now);
@@ -822,7 +822,8 @@
        // 完成空桶库入出库任务另一个任务
        int workNoOther = 0;
        // 入库 + 库位转移
        if ((wrkMast.getWrkSts() < 4 && wrkMast.getIoType() != 101 && wrkMast.getIoType() != 110) || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) {
        if ((wrkMast.getWrkSts() < 4 && wrkMast.getIoType() != 101 && wrkMast.getIoType() != 110) || (wrkMast.getWrkSts() > 10
                && wrkMast.getIoType()==11) || wrkMast.getIoType() == 10 || (wrkMast.getIoType() == 3)) {
            wrkMast.setWrkSts(4L);
            workNoOther = wrkMast.getWorkNoOther();
        // 出库
@@ -859,7 +860,7 @@
    @Override
    @Transactional
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId) {
        param.integrate();
//        param.integrate();
        LocMast locMast = locMastService.selectById(param.getLocNo());
        if (Cools.isEmpty(locMast)) {
            throw new CoolException("库位不存在");
@@ -1243,17 +1244,19 @@
        // 修改库位状态
        if(locNo != null) {
            LocMast locMast = locMastService.selectById(locNo);
            if (Cools.isEmpty(locMast)) {
                throw new CoolException("取消工作档失败,库位不存在:"+ locNo);
            }
            locMast.setLocSts(locSts);
            locMast.setModiTime(now);
            locMast.setModiUser(userId);
            boolean locMastRes = locMastService.updateById(locMast);
            if (!wrkMastRes || !locMastRes) {
                throw new CoolException("保存数据失败");
        if (locNo != null) {
            if (wrkMast.getIoType() != 3) {
                LocMast locMast = locMastService.selectById(locNo);
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消工作档失败,库位不存在:" + locNo);
                }
                locMast.setLocSts(locSts);
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                boolean locMastRes = locMastService.updateById(locMast);
                if (!wrkMastRes || !locMastRes) {
                    throw new CoolException("保存数据失败");
                }
            }
        }
    }