fix(设备管理): 修复U位位置检查的数值类型问题
确保位置和高度参数被正确转换为整数类型,避免字符串比较问题 添加调试日志帮助追踪U位检查流程
This commit is contained in:
@@ -45,13 +45,14 @@ async function checkPositionAvailable(
|
||||
excludeDeviceId = null,
|
||||
transaction = null
|
||||
) {
|
||||
if (!position || position <= 0) {
|
||||
const pos = parseInt(position, 10);
|
||||
if (!pos || pos <= 0) {
|
||||
return { available: true, reason: null };
|
||||
}
|
||||
|
||||
const deviceHeight = height || 1;
|
||||
const startU = position;
|
||||
const endU = position + deviceHeight - 1;
|
||||
const deviceHeight = parseInt(height, 10) || 1;
|
||||
const startU = pos;
|
||||
const endU = pos + deviceHeight - 1;
|
||||
|
||||
const queryOptions = {
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user