WMS移位管理完成移位修改
This commit is contained in:
+16
-1
@@ -212,7 +212,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO 若数据量升级 后期优化
|
//TODO 若数据量升级 后期优化
|
||||||
// 查询现有库存时,按唯一索引(storage_location_id, material_base_info_id, shipper_id) 查询
|
// 查询现有库存时,按 库位 + 物料 + 货主 + 批次 + 物料状态 + 容器 维度查询,避免多条命中
|
||||||
MaterialInventory materialInventoryDb = null;
|
MaterialInventory materialInventoryDb = null;
|
||||||
|
|
||||||
if (materialInventoryDO.getStorageLocationId() != null && materialInventoryDO.getMaterialBaseInfoId() != null) {
|
if (materialInventoryDO.getStorageLocationId() != null && materialInventoryDO.getMaterialBaseInfoId() != null) {
|
||||||
@@ -226,6 +226,21 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
|||||||
if (shipperId != null) {
|
if (shipperId != null) {
|
||||||
wrapper.eq(MaterialInventory::getShipperId, shipperId);
|
wrapper.eq(MaterialInventory::getShipperId, shipperId);
|
||||||
}
|
}
|
||||||
|
// 如果有批次号,则再按批次号细分(优先使用上面解析出来的 batchNumber)
|
||||||
|
if (!StringUtils.isEmpty(batchNumber)) {
|
||||||
|
wrapper.eq(MaterialInventory::getBatchNumber, batchNumber);
|
||||||
|
} else if (materialInventoryDO.getBatchNumber() != null) {
|
||||||
|
wrapper.eq(MaterialInventory::getBatchNumber, materialInventoryDO.getBatchNumber());
|
||||||
|
}
|
||||||
|
// 如果有物料状态码,则再按物料状态细分
|
||||||
|
if (materialInventoryDO.getMaterialStatusCode() != null
|
||||||
|
&& !materialInventoryDO.getMaterialStatusCode().trim().isEmpty()) {
|
||||||
|
wrapper.eq(MaterialInventory::getMaterialStatusCode, materialInventoryDO.getMaterialStatusCode());
|
||||||
|
}
|
||||||
|
// 如果有容器ID,则再按容器细分
|
||||||
|
if (materialInventoryDO.getContainerId() != null) {
|
||||||
|
wrapper.eq(MaterialInventory::getContainerId, materialInventoryDO.getContainerId());
|
||||||
|
}
|
||||||
materialInventoryDb = materialInventoryMapper.selectOne(wrapper);
|
materialInventoryDb = materialInventoryMapper.selectOne(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user