出入库异常未按照仓库过滤

This commit is contained in:
秦鸿展
2026-04-21 17:41:53 +08:00
parent 838a7d6acd
commit afe1cd5011
5 changed files with 31 additions and 5 deletions
@@ -37,8 +37,14 @@ public class InOrderAbnormalApplicationService {
if (topOrganizationId != null && topOrganizationId != 1){
inOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
inOrderAbnormalDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
// 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与出库异常一致)
if (inOrderAbnormalDO.getWarehouseId() == null) {
AssociationWarehouseCacheDO cache =
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
if (cache != null && cache.getWarehouseId() != null) {
inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
}
}
}
return inOrderAbnormalDomainService.queryList(inOrderAbnormalDO);
}
@@ -1,6 +1,8 @@
package com.mhd.wms.application.service.outOrderAbnormal;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.outOrderAbnormal.repository.po.OutOrderAbnormalPO;
import com.mhd.wms.domain.outOrderAbnormal.repository.todo.OutOrderAbnormalDO;
@@ -35,6 +37,14 @@ public class OutOrderAbnormalApplicationService {
if (topOrganizationId != null && topOrganizationId != 1){
outOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
// 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与入库异常一致)
if (outOrderAbnormalDO.getWarehouseId() == null) {
AssociationWarehouseCacheDO cache =
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
if (cache != null && cache.getWarehouseId() != null) {
outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId());
}
}
}
return outOrderAbnormalDomainService.queryList(outOrderAbnormalDO);
}
@@ -82,6 +82,8 @@ public class InOrderAbnormalDTO extends BaseVOEntity {
@Excel(name = "备注")
private String remark;
@ApiModelProperty("仓库id(列表筛选,关联 stock_in_order")
private Long warehouseId;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@@ -78,6 +78,14 @@ public class OutOrderAbnormalDTO extends BaseVOEntity {
@Excel(name = "备注")
private String remark;
@ApiModelProperty("仓库id(列表筛选,关联 stock_out_order")
private Long warehouseId;
@ApiModelProperty("货主id(列表筛选,关联 stock_out_order")
private Long shipperId;
@ApiModelProperty("出库单类型编码(列表筛选,关联 stock_out_order")
private String orderTypeCode;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@@ -92,14 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<sql id="joinStockOutOrderPoWhere">
<if test="warehouseId != null and warehouseId != '' ">
<if test="warehouseId != null">
and b.warehouse_id = #{warehouseId}
</if>
<if test="shipperId != null and shipperId != ''">
<if test="shipperId != null">
and b.shipper_id = #{shipperId}
</if>
<if test="orderTypeCode != null and orderTypeCode != ''">
and a.order_type_code = #{orderTypeCode}
and b.order_type_code = #{orderTypeCode}
</if>
<choose>
<when test="delFlag != null"> and b.del_flag = #{delFlag} </when>