|
|
@@ -2535,55 +2535,56 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
* @date 2026/5/23 16:28
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<CompanySuperviseSettlementReportDto> companySuperviseSettlementReport(
|
|
|
+ public HttpResult<List<CompanySuperviseSettlementReportDto>> companySuperviseSettlementReport(
|
|
|
SettlementReportQueryVo queryVo) {
|
|
|
- log.info("保险公司结算报表查询:{}", JSONUtil.toJsonStr(queryVo));
|
|
|
- // 查询所有公司
|
|
|
- List<CompanySuperviseSettlementReportDto> allCompanies =
|
|
|
- baseMapper.selectAllCompanyReports(queryVo);
|
|
|
- if (CollUtil.isEmpty(allCompanies)) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
- // 查询应开票金额
|
|
|
- Map<String, BigDecimal> superviseAmountMap =
|
|
|
- baseMapper.getSuperviseAmount()
|
|
|
- .stream()
|
|
|
- .collect(Collectors.toMap(
|
|
|
- InvoiceAmountDto::getCompanyId,
|
|
|
- dto -> defaultZero(dto.getSuperviseAmount())
|
|
|
- ));
|
|
|
- // companyId -> dto
|
|
|
- Map<String, CompanySuperviseSettlementReportDto> companyMap =
|
|
|
- allCompanies.stream()
|
|
|
- .collect(Collectors.toMap(
|
|
|
- CompanySuperviseSettlementReportDto::getCompanyId,
|
|
|
- Function.identity(),
|
|
|
- (a, b) -> a
|
|
|
- ));
|
|
|
- // 构建树
|
|
|
- List<CompanySuperviseSettlementReportDto> roots = new ArrayList<>();
|
|
|
- for (CompanySuperviseSettlementReportDto dto : allCompanies) {
|
|
|
- initAmount(dto);
|
|
|
- if (StrUtil.isBlank(dto.getParentId())
|
|
|
- || "0".equals(dto.getParentId())) {
|
|
|
-
|
|
|
- roots.add(dto);
|
|
|
- continue;
|
|
|
- }
|
|
|
- CompanySuperviseSettlementReportDto parent =
|
|
|
- companyMap.get(dto.getParentId());
|
|
|
- if (parent != null) {
|
|
|
- if (parent.getChildren() == null) {
|
|
|
- parent.setChildren(new ArrayList<>());
|
|
|
- }
|
|
|
- parent.getChildren().add(dto);
|
|
|
- }
|
|
|
- }
|
|
|
- // 自底向上汇总
|
|
|
- for (CompanySuperviseSettlementReportDto root : roots) {
|
|
|
- aggregate(root, superviseAmountMap);
|
|
|
- }
|
|
|
- return roots;
|
|
|
+ return null;
|
|
|
+// log.info("保险公司结算报表查询:{}", JSONUtil.toJsonStr(queryVo));
|
|
|
+// // 查询所有公司
|
|
|
+// List<CompanySuperviseSettlementReportDto> allCompanies =
|
|
|
+// baseMapper.selectAllCompanyReports(queryVo);
|
|
|
+// if (CollUtil.isEmpty(allCompanies)) {
|
|
|
+// return Collections.emptyList();
|
|
|
+// }
|
|
|
+// // 查询应开票金额
|
|
|
+// Map<String, BigDecimal> superviseAmountMap =
|
|
|
+// baseMapper.getSuperviseAmount()
|
|
|
+// .stream()
|
|
|
+// .collect(Collectors.toMap(
|
|
|
+// InvoiceAmountDto::getCompanyId,
|
|
|
+// dto -> defaultZero(dto.getSuperviseAmount())
|
|
|
+// ));
|
|
|
+// // companyId -> dto
|
|
|
+// Map<String, CompanySuperviseSettlementReportDto> companyMap =
|
|
|
+// allCompanies.stream()
|
|
|
+// .collect(Collectors.toMap(
|
|
|
+// CompanySuperviseSettlementReportDto::getCompanyId,
|
|
|
+// Function.identity(),
|
|
|
+// (a, b) -> a
|
|
|
+// ));
|
|
|
+// // 构建树
|
|
|
+// List<CompanySuperviseSettlementReportDto> roots = new ArrayList<>();
|
|
|
+// for (CompanySuperviseSettlementReportDto dto : allCompanies) {
|
|
|
+// initAmount(dto);
|
|
|
+// if (StrUtil.isBlank(dto.getParentId())
|
|
|
+// || "0".equals(dto.getParentId())) {
|
|
|
+//
|
|
|
+// roots.add(dto);
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// CompanySuperviseSettlementReportDto parent =
|
|
|
+// companyMap.get(dto.getParentId());
|
|
|
+// if (parent != null) {
|
|
|
+// if (parent.getChildren() == null) {
|
|
|
+// parent.setChildren(new ArrayList<>());
|
|
|
+// }
|
|
|
+// parent.getChildren().add(dto);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 自底向上汇总
|
|
|
+// for (CompanySuperviseSettlementReportDto root : roots) {
|
|
|
+// aggregate(root, superviseAmountMap);
|
|
|
+// }
|
|
|
+// return roots;
|
|
|
}
|
|
|
|
|
|
|