feat: 统一列表模糊搜索行为

- 统一管理端和用户中心搜索参数及多字段包含匹配

- 修复聊天搜索竞态并优化部门重名路径展示

- 补充部门展开、模型空白词和聊天查询回归测试
This commit is contained in:
2026-08-13 22:29:59 +08:00
parent 765006747a
commit 64a85c6a5b
83 changed files with 1134 additions and 208 deletions

View File

@@ -19,6 +19,7 @@ import tech.easyflow.approval.mapper.ApprovalTaskAssigneeMapper;
import tech.easyflow.approval.mapper.ApprovalTaskMapper;
import tech.easyflow.approval.service.ApprovalAssigneeService;
import tech.easyflow.common.constant.enums.EnumDataStatus;
import tech.easyflow.common.util.SearchKeywordUtil;
import tech.easyflow.common.web.exceptions.BusinessException;
import tech.easyflow.system.entity.SysAccount;
import tech.easyflow.system.entity.SysAccountRole;
@@ -365,7 +366,7 @@ public class ApprovalAssigneeServiceImpl implements ApprovalAssigneeService {
.eq(SysAccount::getStatus, EnumDataStatus.AVAILABLE.getCode())
.orderBy("nickname asc, login_name asc, id asc");
if (StringUtils.hasText(keyword)) {
String likeKeyword = "%" + keyword.trim() + "%";
String likeKeyword = SearchKeywordUtil.literalContainsPattern(keyword);
queryWrapper.and("(`login_name` like ? or `nickname` like ?)", likeKeyword, likeKeyword);
}
Page<SysAccount> page = sysAccountService.page(new Page<>(actualPageNumber, actualPageSize), queryWrapper);

View File

@@ -7,6 +7,7 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import tech.easyflow.common.util.SearchKeywordUtil;
import tech.easyflow.common.web.exceptions.BusinessException;
import tech.easyflow.approval.entity.ApprovalFlow;
import tech.easyflow.approval.entity.ApprovalFlowScope;
@@ -72,7 +73,7 @@ public class ApprovalFlowServiceImpl extends ServiceImpl<ApprovalFlowMapper, App
long actualPageSize = pageSize == null || pageSize < 1 ? 10L : pageSize;
QueryWrapper queryWrapper = QueryWrapper.create();
if (StringUtils.hasText(name)) {
queryWrapper.like(ApprovalFlow::getName, name.trim());
queryWrapper.and("name LIKE ?", SearchKeywordUtil.literalContainsPattern(name));
}
if (StringUtils.hasText(resourceType)) {
queryWrapper.eq(ApprovalFlow::getResourceType, ApprovalResourceType.from(resourceType).getCode());

View File

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import tech.easyflow.common.entity.LoginAccount;
import tech.easyflow.common.satoken.util.SaTokenUtil;
import tech.easyflow.common.util.SearchKeywordUtil;
import tech.easyflow.common.web.exceptions.BusinessException;
import tech.easyflow.approval.entity.ApprovalFlowStep;
import tech.easyflow.approval.entity.ApprovalInstance;
@@ -310,7 +311,7 @@ public class ApprovalQueryServiceImpl implements ApprovalQueryService {
queryWrapper.eq(ApprovalInstance::getActionType, ApprovalActionType.from(actionType).getCode());
}
if (StringUtils.hasText(keyword)) {
queryWrapper.like(ApprovalInstance::getSummary, keyword.trim());
queryWrapper.and("summary LIKE ?", SearchKeywordUtil.literalContainsPattern(keyword));
}
return queryWrapper;
}