|
@@ -942,6 +942,35 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
// 5. 将其他费用收入合并进结果集合
|
|
// 5. 将其他费用收入合并进结果集合
|
|
|
mergeOtherCostIncomeToResult(filterIncomeList, resultList, companyMap);
|
|
mergeOtherCostIncomeToResult(filterIncomeList, resultList, companyMap);
|
|
|
|
|
|
|
|
|
|
+ if (CollUtil.isEmpty(resultList)){
|
|
|
|
|
+ return resultList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 按companyName分组,组内year+month升序,最后打平
|
|
|
|
|
+ resultList = resultList.stream()
|
|
|
|
|
+ // 按公司名称分组
|
|
|
|
|
+ .collect(Collectors.groupingBy(FollowCompanyFeeVO::getCompanyName))
|
|
|
|
|
+ // 获取分组后的value集合
|
|
|
|
|
+ .values()
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ // 组内排序:先转数字,year升序,month升序
|
|
|
|
|
+ .map(group -> group.stream()
|
|
|
|
|
+ .sorted((o1, o2) -> {
|
|
|
|
|
+ // year、month字符串转Integer
|
|
|
|
|
+ int y1 = Integer.parseInt(o1.getYear());
|
|
|
|
|
+ int m1 = Integer.parseInt(o1.getMonth());
|
|
|
|
|
+ int y2 = Integer.parseInt(o2.getYear());
|
|
|
|
|
+ int m2 = Integer.parseInt(o2.getMonth());
|
|
|
|
|
+ if (y1 != y2) {
|
|
|
|
|
+ return Integer.compare(y1, y2);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Integer.compare(m1, m2);
|
|
|
|
|
+ })
|
|
|
|
|
+ .collect(Collectors.toList()))
|
|
|
|
|
+ // 将各个公司分组的list打平成一个大list
|
|
|
|
|
+ .flatMap(List::stream)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
return resultList;
|
|
return resultList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -5551,6 +5580,24 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
log.info("superviseSettlementDetailExcel:settlementQueryVo=[{}]", JSONUtil.toJsonStr(settlementQueryVo));
|
|
log.info("superviseSettlementDetailExcel:settlementQueryVo=[{}]", JSONUtil.toJsonStr(settlementQueryVo));
|
|
|
settlementQueryVo.setSystemCode(baseController.getSystemCode());
|
|
settlementQueryVo.setSystemCode(baseController.getSystemCode());
|
|
|
Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = null;
|
|
Page<ExportSuperviseSettlementDetailExcelDto> exportSuperviseSettlementDetailExcelDtos = null;
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 一次性获取保险公司全量Map,全局复用
|
|
|
|
|
+ Map<String, EsmInsCompany> companyMap = getAllInsCompanyMap();
|
|
|
|
|
+ if (CollUtil.isEmpty(companyMap)) {
|
|
|
|
|
+ return exportSuperviseSettlementDetailExcelDtos;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询当前公司下所有的子公司
|
|
|
|
|
+ if (StrUtil.isNotBlank(settlementQueryVo.getCompanyId())){
|
|
|
|
|
+ // 将全量数据按照 parentId 进行分组,key 是 parentId,value 是该 parentId 下的所有公司列表
|
|
|
|
|
+ Map<String, List<EsmInsCompany>> parentGroupMap = companyMap.values().stream()
|
|
|
|
|
+ .filter(c -> c.getParentId() != null)
|
|
|
|
|
+ .collect(Collectors.groupingBy(EsmInsCompany::getParentId));
|
|
|
|
|
+ List<String> allChildIdspOtimized = getAllChildIdsOptimized(settlementQueryVo.getCompanyId(), parentGroupMap);
|
|
|
|
|
+ allChildIdspOtimized.add(settlementQueryVo.getCompanyId());
|
|
|
|
|
+ settlementQueryVo.setCompanyIdList(allChildIdspOtimized);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (settlementQueryVo.getInvoiceTypes().contains("5") && settlementQueryVo.getInvoiceTypes().contains("6")) {
|
|
if (settlementQueryVo.getInvoiceTypes().contains("5") && settlementQueryVo.getInvoiceTypes().contains("6")) {
|
|
|
exportSuperviseSettlementDetailExcelDtos = baseMapper.getPlatFormSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
exportSuperviseSettlementDetailExcelDtos = baseMapper.getPlatFormSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
}else{
|
|
}else{
|