云
2 天以前 87733eb3623593da247c051593d64b8ff9e1d3a4
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/materialstock/MesWmMaterialStockServiceImpl.java
@@ -347,8 +347,11 @@
    @Override
    public void checkAreaMixingRule(Long areaId, Long itemId, Long batchId) {
        // 1.1 校验库位必须存在
        // 1.1 校验库位必须存在(未使用库位时跳过混放校验)
        MesWmWarehouseAreaDO area = areaService.validateWarehouseAreaExists(areaId);
        if (area == null) {
            return;
        }
        // 2. 查询当前库位上已有的库存记录
        List<MesWmMaterialStockDO> stockList = getMaterialStockListByAreaId(areaId);
@@ -388,8 +391,8 @@
                || ObjUtil.notEqual(stock.getBatchId(), batchId)
                || (batchCode != null && ObjUtil.notEqual(stock.getBatchCode(), batchCode))
                || ObjUtil.notEqual(stock.getWarehouseId(), warehouseId)
                || ObjUtil.notEqual(stock.getLocationId(), locationId)
                || ObjUtil.notEqual(stock.getAreaId(), areaId)) {
                || (locationId != null && ObjUtil.notEqual(stock.getLocationId(), locationId))
                || (areaId != null && ObjUtil.notEqual(stock.getAreaId(), areaId))) {
            throw exception(WM_MATERIAL_STOCK_SELECTION_MISMATCH);
        }
        // 3. 校验库存记录必须是合格库(暂存库存未质检,不可用于出库/占用)