mirror of
https://gitee.com/zhijiantianya/ruoyi-vue-pro.git
synced 2026-07-08 14:39:53 +08:00
fix(wms): 移除库存加锁查询排序
去掉库存 FOR UPDATE 查询中的 ORDER BY 和本地 ID 排序, 避免租户拦截器重写 SQL 后生成 MySQL 语法错误。 对应 https://t.zsxq.com/gHhfb、https://t.zsxq.com/cpUEC
This commit is contained in:
@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user