出入库异常未按照仓库过滤
This commit is contained in:
+24
-10
@@ -32,17 +32,31 @@ public class InOrderAbnormalApplicationService {
|
|||||||
|
|
||||||
public List<InOrderAbnormalPO> queryList(InOrderAbnormalDO inOrderAbnormalDO) {
|
public List<InOrderAbnormalPO> queryList(InOrderAbnormalDO inOrderAbnormalDO) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (loginUser != null){
|
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
AssociationWarehouseCacheDO cache =
|
||||||
if (topOrganizationId != null && topOrganizationId != 1){
|
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||||
inOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
if (inOrderAbnormalDO.getWarehouseId() == null && cache != null
|
||||||
|
&& cache.getWarehouseId() != null) {
|
||||||
|
inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
|
||||||
}
|
}
|
||||||
// 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与出库异常一致)
|
if (inOrderAbnormalDO.getTopOrganizationId() == null) {
|
||||||
if (inOrderAbnormalDO.getWarehouseId() == null) {
|
Long top = loginUser.getUserPo().getTopOrganizationId();
|
||||||
AssociationWarehouseCacheDO cache =
|
if (top == null || Long.valueOf(1L).equals(top)) {
|
||||||
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
if (cache != null) {
|
||||||
if (cache != null && cache.getWarehouseId() != null) {
|
top = cache.getTopOrganizationId();
|
||||||
inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
|
}
|
||||||
|
}
|
||||||
|
if (top != null && !Long.valueOf(1L).equals(top)) {
|
||||||
|
inOrderAbnormalDO.setTopOrganizationId(top);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inOrderAbnormalDO.getOrganizationId() == null) {
|
||||||
|
Long orgId = loginUser.getUserPo().getOrganizationId();
|
||||||
|
if (orgId == null && cache != null) {
|
||||||
|
orgId = cache.getOrganizationId();
|
||||||
|
}
|
||||||
|
if (orgId != null) {
|
||||||
|
inOrderAbnormalDO.setOrganizationId(orgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-10
@@ -32,17 +32,32 @@ public class OutOrderAbnormalApplicationService {
|
|||||||
|
|
||||||
public List<OutOrderAbnormalPO> queryList(OutOrderAbnormalDO outOrderAbnormalDO) {
|
public List<OutOrderAbnormalPO> queryList(OutOrderAbnormalDO outOrderAbnormalDO) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
if (loginUser != null){
|
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
// 请求带仓库时也会读关联缓存,用于补全「会话里为空的组织」(UserPo 常见无 organizationId)
|
||||||
if (topOrganizationId != null && topOrganizationId != 1){
|
AssociationWarehouseCacheDO cache =
|
||||||
outOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||||
|
if (outOrderAbnormalDO.getWarehouseId() == null && cache != null
|
||||||
|
&& cache.getWarehouseId() != null) {
|
||||||
|
outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
|
||||||
}
|
}
|
||||||
// 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与入库异常一致)
|
if (outOrderAbnormalDO.getTopOrganizationId() == null) {
|
||||||
if (outOrderAbnormalDO.getWarehouseId() == null) {
|
Long top = loginUser.getUserPo().getTopOrganizationId();
|
||||||
AssociationWarehouseCacheDO cache =
|
if (top == null || Long.valueOf(1L).equals(top)) {
|
||||||
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
if (cache != null) {
|
||||||
if (cache != null && cache.getWarehouseId() != null) {
|
top = cache.getTopOrganizationId();
|
||||||
outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
|
}
|
||||||
|
}
|
||||||
|
if (top != null && !Long.valueOf(1L).equals(top)) {
|
||||||
|
outOrderAbnormalDO.setTopOrganizationId(top);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (outOrderAbnormalDO.getOrganizationId() == null) {
|
||||||
|
Long orgId = loginUser.getUserPo().getOrganizationId();
|
||||||
|
if (orgId == null && cache != null) {
|
||||||
|
orgId = cache.getOrganizationId();
|
||||||
|
}
|
||||||
|
if (orgId != null) {
|
||||||
|
outOrderAbnormalDO.setOrganizationId(orgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user