|
|
@@ -5577,6 +5577,24 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
log.info("superviseSettlementDetailExcel:settlementQueryVo=[{}]", JSONUtil.toJsonStr(settlementQueryVo));
|
|
|
settlementQueryVo.setSystemCode(baseController.getSystemCode());
|
|
|
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")) {
|
|
|
exportSuperviseSettlementDetailExcelDtos = baseMapper.getPlatFormSettlementDetailExcelDtos(page, settlementQueryVo);
|
|
|
}else{
|