自动化立体仓库 - WMS系统
skyouc
昨天 05466547c913ad2cd29944e5444dd387ce64b25f
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -599,6 +599,12 @@
        if (Objects.isNull(param.getBarcode())) {
            throw new CoolException("托盘码不能为空!!");
        }
        BasContainer container = basContainerService
                .selectOne(new EntityWrapper<BasContainer>().eq("barcode", param.getBarcode()));
        if (Objects.isNull(container)) {
            throw new CoolException("数据错误:容器码不存在!!");
        }
        // if (param.getBarcode().length() != 8) {
        // throw new CoolException("条码长度不是8位===>>" + param.getBarcode());
        // }
@@ -1534,7 +1540,7 @@
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {
                throw new CoolException("更新目标库位状态失败");
                throw new CoolException("更新目标站点状态失败");
            }
        } else {
            throw new CoolException("移转失败,目标库位状态:" + station.getLocSts());
@@ -1604,6 +1610,7 @@
        if (Objects.isNull(param.getBarcode())) {
            throw new CoolException("托盘码不能为空!!");
        }
        if (Objects.isNull(param.getCombMats()) || param.getCombMats().isEmpty()) {
            throw new CoolException("组托明细不能为空!!");
        }
@@ -1734,6 +1741,7 @@
                    throw new CoolException("数据错误,站点不存在!!");
                }
                station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
                station.setBarcode(null);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("站点状态更新失败!!");
                }
@@ -1778,6 +1786,7 @@
        }
        station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
        station.setBarcode(null);
        if (!basStationService.updateById(station)) {
            throw new CoolException("站点状态修改失败!");
        }
@@ -1799,6 +1808,13 @@
        generateCrnInTask(waitPakins, station, param.getLocType1(), userId);
    }
    /**
     * SO/EO 区组托
     * @author Ryan
     * @date 2025/12/18 15:19
     * @param params
     * @return com.core.common.R
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R collectionPakin(CollectionPakinParams params, Long userId) {
@@ -2171,8 +2187,8 @@
        // 判断根据分拣出库后,还需要出多少托盘或料箱;如果余料大于0, 出新托盘或料箱
        if (totalOut.get().compareTo(0.0) > 0) {
            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
            //TODO 细化区分,当前出库托盘是滞满足拣货数量
            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station);
            //TODO 细化区分,当前出库托盘是满足拣货数量
        } else {
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                    // todo 根据物料种类,区分库区类型
@@ -2182,7 +2198,7 @@
            CrnTaskDetlDTO crnTaskDetlDTO = new CrnTaskDetlDTO().setLocNo(locMast.getLocNo()).setLocDetlList(locDetls);
            locMasts.add(crnTaskDetlDTO);
            // 空板出库
            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId);
            generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station);
        }
    }
@@ -2190,11 +2206,12 @@
     * 生成堆垛机出库任务
     *
     * @param locMasts
     * @param station
     * @author Ryan
     * @date 2025/12/6 14:44
     */
    @Transactional(rollbackFor = Exception.class)
    public void generateTask(List<CrnTaskDetlDTO> locMasts, Integer ioType, BasDevp devp, Long userId) {
    public void generateTask(List<CrnTaskDetlDTO> locMasts, Integer ioType, BasDevp devp, Long userId, BasStation station) {
        Date now = new Date();
        for (CrnTaskDetlDTO crnTaskDetlDTO : locMasts) {
@@ -2221,6 +2238,9 @@
                wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站
                wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站
                wrkMast.setSourceLocNo(locMast.getLocNo()); // 源库位
                //小松项目,缓存出库AGV站点,用于清空缓存区库存
                wrkMast.setPauseMk(station.getDevNo());
//                wrkMast.setAvgSta(station.getDevNo());;
                wrkMast.setFullPlt("Y"); // 满板:Y
                wrkMast.setPicking("N"); // 拣料
                wrkMast.setExitMk("N"); // 退出
@@ -2244,6 +2264,8 @@
                wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号
                wrkDetl.setWrkNo(workNo);
                wrkDetl.setIoTime(now);
                wrkDetl.setZpallet(null);
                wrkDetl.setBarcode(null);
                wrkDetl.setAppeTime(now);
                wrkDetl.setAppeUser(userId);
                wrkDetl.setModiTime(now);
@@ -2443,7 +2465,7 @@
        if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) {
            station.setLocSts("R"); // S.入库预约
            station.setBarcode(barcode);
//            station.setBarcode(barcode);
            station.setModiTime(new Date());
            station.setModiUser(userId);
            if (!basStationService.updateById(station)) {