feat: 收款流水列表补充收款金额区间与认领人筛选(认领人经认领记录参数化两段查询过滤)

This commit is contained in:
刘泉佳
2026-09-29 10:28:27 +08:00
parent 4c32cb9046
commit 9cf42b4105
2 changed files with 31 additions and 0 deletions
@@ -144,6 +144,10 @@ public class ReceiptFlowServiceImpl extends BaseServiceImpl<KingdeeReceiptFlowMa
query.getPushStatus())
.eq(Func.isNotEmpty(query.getKingdeeBillStatus()), KingdeeReceiptFlow::getKingdeeBillStatus,
query.getKingdeeBillStatus())
.ge(query.getReceiptAmountStart() != null, KingdeeReceiptFlow::getReceiptAmount,
query.getReceiptAmountStart())
.le(query.getReceiptAmountEnd() != null, KingdeeReceiptFlow::getReceiptAmount,
query.getReceiptAmountEnd())
.ge(query.getTransactionStartTime() != null, KingdeeReceiptFlow::getTransactionTime,
query.getTransactionStartTime())
.le(query.getTransactionEndTime() != null, KingdeeReceiptFlow::getTransactionTime,
@@ -151,6 +155,23 @@ public class ReceiptFlowServiceImpl extends BaseServiceImpl<KingdeeReceiptFlowMa
.eq(KingdeeReceiptFlow::getStatus, 1)
.orderByDesc(KingdeeReceiptFlow::getTransactionTime)
.orderByDesc(KingdeeReceiptFlow::getCreateTime);
// 认领人筛选:先查该认领人有效认领的流水id(参数化查询,避免拼接 SQL),空则直接返回空页
if (Func.isNotEmpty(query.getClaimerName())) {
List<Long> claimedFlowIds = claimMapper.selectList(Wrappers.<ReceiptClaim>lambdaQuery()
.select(ReceiptClaim::getReceiptFlowId)
.like(ReceiptClaim::getClaimerName, query.getClaimerName())
.eq(ReceiptClaim::getClaimStatus, CLAIMED)).stream()
.map(ReceiptClaim::getReceiptFlowId)
.filter(Objects::nonNull)
.distinct()
.toList();
if (claimedFlowIds.isEmpty()) {
page.setRecords(List.of());
page.setTotal(0);
return page.convert(ReceiptFlowWrapper.build()::entityVO);
}
wrapper.in(KingdeeReceiptFlow::getId, claimedFlowIds);
}
return page(page, wrapper).convert(ReceiptFlowWrapper.build()::entityVO);
}