fix(wms): 移除库存加锁查询排序

去掉库存 FOR UPDATE 查询中的 ORDER BY 和本地 ID 排序,
避免租户拦截器重写 SQL 后生成 MySQL 语法错误。

对应 https://t.zsxq.com/gHhfb、https://t.zsxq.com/cpUEC
This commit is contained in:
YunaiV
2026-06-26 19:42:29 -07:00
parent a25dd36be6
commit 9705ce1195

View File

@ -14,7 +14,6 @@ import cn.iocoder.yudao.module.wms.dal.dataobject.md.item.WmsItemSkuDO;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@ -100,11 +99,8 @@ public interface WmsInventoryMapper extends BaseMapperX<WmsInventoryDO> {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<Long> sortedIds = new ArrayList<>(ids);
Collections.sort(sortedIds);
return selectList(new LambdaQueryWrapperX<WmsInventoryDO>()
.in(WmsInventoryDO::getId, sortedIds)
.orderByAsc(WmsInventoryDO::getId)
.in(WmsInventoryDO::getId, ids)
.last("FOR UPDATE"));
}