fix(接口测试): 高级搜索Boolean类型条件值筛选问题

--bug=1048317 --user=宋昌昌 【接口测试】MOCK-高级搜索-状态等于开启-搜索后数据显示错误 https://www.tapd.cn/55049933/s/1601857
This commit is contained in:
song-cc-rock 2024-10-30 11:48:20 +08:00 committed by Craftsman
parent 887fe6e41a
commit 37ac980085
2 changed files with 6 additions and 2 deletions

View File

@ -5,5 +5,5 @@ package io.metersphere.system.constants;
* @CreateTime: 2024-09-02 10:47 * @CreateTime: 2024-09-02 10:47
*/ */
public enum UserViewConditionValueType { public enum UserViewConditionValueType {
ARRAY,STRING,INT,FLOAT ARRAY,STRING,INT,FLOAT,BOOLEAN
} }

View File

@ -1,5 +1,6 @@
package io.metersphere.system.service; package io.metersphere.system.service;
import io.metersphere.sdk.dto.CombineCondition;
import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.exception.MSException;
import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.BeanUtils;
import io.metersphere.sdk.util.EnumValidator; import io.metersphere.sdk.util.EnumValidator;
@ -16,7 +17,6 @@ import io.metersphere.system.dto.UserViewDTO;
import io.metersphere.system.dto.UserViewListGroupedDTO; import io.metersphere.system.dto.UserViewListGroupedDTO;
import io.metersphere.system.dto.request.UserViewAddRequest; import io.metersphere.system.dto.request.UserViewAddRequest;
import io.metersphere.system.dto.request.UserViewUpdateRequest; import io.metersphere.system.dto.request.UserViewUpdateRequest;
import io.metersphere.sdk.dto.CombineCondition;
import io.metersphere.system.mapper.ExtUserViewMapper; import io.metersphere.system.mapper.ExtUserViewMapper;
import io.metersphere.system.mapper.UserViewConditionMapper; import io.metersphere.system.mapper.UserViewConditionMapper;
import io.metersphere.system.mapper.UserViewMapper; import io.metersphere.system.mapper.UserViewMapper;
@ -197,6 +197,8 @@ public class UserViewService {
return UserViewConditionValueType.INT.name(); return UserViewConditionValueType.INT.name();
} else if (value instanceof Float || value instanceof Double) { } else if (value instanceof Float || value instanceof Double) {
return UserViewConditionValueType.FLOAT.name(); return UserViewConditionValueType.FLOAT.name();
} else if (value instanceof Boolean) {
return UserViewConditionValueType.BOOLEAN.name();
} else { } else {
return UserViewConditionValueType.STRING.name(); return UserViewConditionValueType.STRING.name();
} }
@ -214,6 +216,8 @@ public class UserViewService {
return Long.valueOf(valueStr); return Long.valueOf(valueStr);
case FLOAT: case FLOAT:
return Double.valueOf(valueStr); return Double.valueOf(valueStr);
case BOOLEAN:
return Boolean.valueOf(valueStr);
default: default:
return valueStr; return valueStr;
} }