Administrator
2025-08-04 b2eec14bf5a5924d17640e484810f75663c1f38b
fix(ai): 修复商品列表查询功能

- 将 ObjectUtil.isNotNull 替换为 StrUtil.isNotEmpty,以正确处理空字符串
- 在表格重新加载时将查询参数设置为 null,以解决查询条件未重置的问题
2 files modified
5 ■■■■■ changed files
src/main/java/cc/mrbird/febs/ai/service/impl/AiProductServiceImpl.java 3 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/ai/product/list.html 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/ai/service/impl/AiProductServiceImpl.java
@@ -12,6 +12,7 @@
import cc.mrbird.febs.common.entity.QueryRequest;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -53,7 +54,7 @@
        Page<AiProduct> page = new Page<>(request.getPageNum(), request.getPageSize());
        LambdaQueryWrapper<AiProduct> query = Wrappers.lambdaQuery(AiProduct.class);
        if (ObjectUtil.isNotNull(dto.getProductCategoryId())){
        if (StrUtil.isNotEmpty(dto.getProductCategoryId())){
            query.eq(AiProduct::getProductCategoryId, dto.getProductCategoryId());
        }
        query.ne(AiProduct::getState, 2);
src/main/resources/templates/febs/views/modules/ai/product/list.html
@@ -336,7 +336,7 @@
            category.setValue(categoryList);
            $searchForm[0].reset();
            sortObject.type = 'null';
            tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject});
            tableIns.reload({where: null, page: {curr: 1}, initSort: sortObject});
        });
        // 获取查询参数
        function getQueryParams() {