| | |
| | | |
| | | @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); |
| | |
| | | || 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. 校验库存记录必须是合格库(暂存库存未质检,不可用于出库/占用) |