Enhance filtering logic in LeaseApplyInfoServiceImpl for improved query accuracy

This commit is contained in:
syruan 2025-11-07 16:56:42 +08:00
parent 85f91ac8d7
commit 510d85723c
1 changed files with 11 additions and 0 deletions

View File

@ -766,8 +766,19 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
new HashSet<>(statusList); new HashSet<>(statusList);
sortedList = sortedList.stream() sortedList = sortedList.stream()
// 关键词
.filter(item -> StringUtils.isBlank(keyWord) || containsKeyword(item, keyWord)) .filter(item -> StringUtils.isBlank(keyWord) || containsKeyword(item, keyWord))
// 状态过滤
.filter(item -> statusSet.isEmpty() || statusSet.contains(item.getTaskStatus())) .filter(item -> statusSet.isEmpty() || statusSet.contains(item.getTaskStatus()))
// 租赁单位
.filter(item -> leaseApplyInfo.getLeaseUnitId() == null
|| Objects.equals(item.getLeaseUnitId(), leaseApplyInfo.getLeaseUnitId()))
// 租赁工程
.filter(item -> leaseApplyInfo.getLeaseProjectId() == null
|| Objects.equals(item.getLeaseProjectId(), leaseApplyInfo.getLeaseProjectId()))
// 分公司
.filter(item -> StringUtils.isBlank(leaseApplyInfo.getImpUnitName())
|| Objects.equals(item.getImpUnitName(), leaseApplyInfo.getImpUnitName()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
return sortedList; return sortedList;