|
|
@@ -4076,7 +4076,62 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return result;
|
|
|
+ // ========== 新增:调用月份过滤方法,过滤组装完成后的VO数据 ==========
|
|
|
+ List<InsFeeFollowOrderVo> finalResult = filterResultByMonth(result, followInvoicePageListVo);
|
|
|
+ return finalResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据前端传入的月份条件过滤已组装完成的保费跟踪VO列表
|
|
|
+ * @param originVoList 组装完成的全部vo数据
|
|
|
+ * @param queryParam 前端查询参数
|
|
|
+ * @return 过滤后符合月份条件的数据
|
|
|
+ */
|
|
|
+ private List<InsFeeFollowOrderVo> filterResultByMonth(List<InsFeeFollowOrderVo> originVoList, FollowInvoicePageListVo queryParam) {
|
|
|
+ // 无搜索条件直接返回原数据
|
|
|
+ if (CollUtil.isEmpty(queryParam.getSearchList())) {
|
|
|
+ return originVoList;
|
|
|
+ }
|
|
|
+ // 取出月份搜索条件 signDate
|
|
|
+ FollowInvoicePageListVo.SearchVO monthSearch = queryParam.getSearchList().stream()
|
|
|
+ .filter(s -> FollowInvoicePageListVo.SearchVO.signDate.equals(s.getName()))
|
|
|
+ .findFirst()
|
|
|
+ .orElse(null);
|
|
|
+ // 不存在月份条件 / 搜索值为空,直接返回原数据
|
|
|
+ if (monthSearch == null || StrUtil.isBlank(monthSearch.getSearch())) {
|
|
|
+ return originVoList;
|
|
|
+ }
|
|
|
+ String searchType = monthSearch.getType();
|
|
|
+ String searchValue = monthSearch.getSearch();
|
|
|
+ // 分割多月份
|
|
|
+ List<Integer> targetMonthList = Arrays.stream(searchValue.split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(StrUtil::isNotBlank)
|
|
|
+ .map(Integer::valueOf)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (CollUtil.isEmpty(targetMonthList)) {
|
|
|
+ return originVoList;
|
|
|
+ }
|
|
|
+ // 构建过滤断言
|
|
|
+ Predicate<InsFeeFollowOrderVo> monthPredicate;
|
|
|
+ switch (searchType) {
|
|
|
+ case "等于":
|
|
|
+ case "包含":
|
|
|
+ monthPredicate = vo -> targetMonthList.contains(vo.getMonth());
|
|
|
+ break;
|
|
|
+ case "不等于":
|
|
|
+ case "不包含":
|
|
|
+ monthPredicate = vo -> !targetMonthList.contains(vo.getMonth());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ // 其他类型不做过滤
|
|
|
+ return originVoList;
|
|
|
+ }
|
|
|
+ // 过滤返回
|
|
|
+ return originVoList.stream()
|
|
|
+ .filter(monthPredicate)
|
|
|
+ .collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
/**
|