仓库过滤查询
This commit is contained in:
+16
-4
@@ -56,8 +56,14 @@ public class MaterialInventoryApplicationService {
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
// 前端有传warehouseId则优先使用传参;未传时才使用“用户关联仓库”作为默认值
|
||||
if (materialInventoryDO.getWarehouseId() == null) {
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO =
|
||||
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO != null) {
|
||||
materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return materialInventoryDomainService.queryList(materialInventoryDO);
|
||||
}
|
||||
@@ -337,8 +343,14 @@ public class MaterialInventoryApplicationService {
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
// 前端有传warehouseId则优先使用传参;未传时才使用“用户关联仓库”作为默认值
|
||||
if (materialInventoryDO.getWarehouseId() == null) {
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO =
|
||||
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO != null) {
|
||||
materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
List<MaterialInventoryPO> materialInventoryPOS = materialInventoryDomainService.queryList(materialInventoryDO);
|
||||
if (CollectionUtils.isNotEmpty(materialInventoryPOS)){
|
||||
|
||||
Reference in New Issue
Block a user