|  | @@ -1,6 +1,7 @@
 | 
											
												
													
														|  |  package com.ym.mec.biz.service.impl;
 |  |  package com.ym.mec.biz.service.impl;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import com.alibaba.fastjson.JSON;
 |  |  import com.alibaba.fastjson.JSON;
 | 
											
												
													
														|  | 
 |  | +import com.baomidou.mybatisplus.extension.api.R;
 | 
											
												
													
														|  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
											
												
													
														|  |  import com.ym.mec.auth.api.entity.SysUser;
 |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
											
												
													
														|  |  import com.ym.mec.biz.dal.dao.*;
 |  |  import com.ym.mec.biz.dal.dao.*;
 | 
											
										
											
												
													
														|  | @@ -19,6 +20,7 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 | 
											
												
													
														|  |  import com.ym.mec.util.collection.MapUtil;
 |  |  import com.ym.mec.util.collection.MapUtil;
 | 
											
												
													
														|  |  import com.ym.mec.util.date.DateUtil;
 |  |  import com.ym.mec.util.date.DateUtil;
 | 
											
												
													
														|  |  import org.apache.commons.lang3.StringUtils;
 |  |  import org.apache.commons.lang3.StringUtils;
 | 
											
												
													
														|  | 
 |  | +import org.apache.poi.ss.formula.functions.T;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.stereotype.Service;
 |  |  import org.springframework.stereotype.Service;
 | 
											
												
													
														|  |  import org.springframework.transaction.annotation.Transactional;
 |  |  import org.springframework.transaction.annotation.Transactional;
 | 
											
										
											
												
													
														|  | @@ -29,6 +31,10 @@ import java.time.DayOfWeek;
 | 
											
												
													
														|  |  import java.time.LocalDate;
 |  |  import java.time.LocalDate;
 | 
											
												
													
														|  |  import java.time.LocalDateTime;
 |  |  import java.time.LocalDateTime;
 | 
											
												
													
														|  |  import java.util.*;
 |  |  import java.util.*;
 | 
											
												
													
														|  | 
 |  | +import java.util.concurrent.CompletableFuture;
 | 
											
												
													
														|  | 
 |  | +import java.util.concurrent.ExecutorService;
 | 
											
												
													
														|  | 
 |  | +import java.util.concurrent.Executors;
 | 
											
												
													
														|  | 
 |  | +import java.util.function.Consumer;
 | 
											
												
													
														|  |  import java.util.stream.Collectors;
 |  |  import java.util.stream.Collectors;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import static com.ym.mec.biz.dal.enums.IndexDataType.*;
 |  |  import static com.ym.mec.biz.dal.enums.IndexDataType.*;
 | 
											
										
											
												
													
														|  | @@ -58,13 +64,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  |  	private StudentRegistrationDao studentRegistrationDao;
 |  |  	private StudentRegistrationDao studentRegistrationDao;
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  | -	private MusicGroupPerformanceDao musicGroupPerformanceDao;
 |  | 
 | 
											
												
													
														|  | -	@Autowired
 |  | 
 | 
											
												
													
														|  |  	private StudentDao studentDao;
 |  |  	private StudentDao studentDao;
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  |  	private SysEmployeePositionService employeePositionService;
 |  |  	private SysEmployeePositionService employeePositionService;
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  |  	private MusicGroupCalenderRefundPeriodDao musicGroupCalenderRefundPeriodDao;
 |  |  	private MusicGroupCalenderRefundPeriodDao musicGroupCalenderRefundPeriodDao;
 | 
											
												
													
														|  | 
 |  | +	private static final ExecutorService exportExecutorService = Executors.newFixedThreadPool(10);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 |  |  	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 | 
											
												
													
														|  |  		@Override
 |  |  		@Override
 | 
											
										
											
												
													
														|  | @@ -116,7 +121,14 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			dataTypes = Arrays.stream(queryInfo.getDataTypes().split(",")).collect(Collectors.toSet());
 |  |  			dataTypes = Arrays.stream(queryInfo.getDataTypes().split(",")).collect(Collectors.toSet());
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -		List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getIndexBaseData(organIds, dataTypes, startDate.toString(), endDate.toString(),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +		String startDate1 = startDate.toString();
 | 
											
												
													
														|  | 
 |  | +		String endDate1 = endDate.toString();
 | 
											
												
													
														|  | 
 |  | +		List<Integer> arrayList = null;
 | 
											
												
													
														|  | 
 |  | +		if(!CollectionUtils.isEmpty(organIds)){
 | 
											
												
													
														|  | 
 |  | +			arrayList = new ArrayList<>(organIds);
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  | 
 |  | +		Integer tenantId = queryInfo.getTenantId();
 | 
											
												
													
														|  | 
 |  | +		List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getIndexBaseData(organIds, dataTypes, startDate1, endDate1,tenantId);
 | 
											
												
													
														|  |  		if(Objects.isNull(indexBaseDatas)){
 |  |  		if(Objects.isNull(indexBaseDatas)){
 | 
											
												
													
														|  |  			indexBaseDatas = new ArrayList<>();
 |  |  			indexBaseDatas = new ArrayList<>();
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
										
											
												
													
														|  | @@ -127,7 +139,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			vipDataTypes.add("VIP_GROUP_COURSE");
 |  |  			vipDataTypes.add("VIP_GROUP_COURSE");
 | 
											
												
													
														|  |  			vipDataTypes.add("VIP_GROUP_ONLINE_COURSE");
 |  |  			vipDataTypes.add("VIP_GROUP_ONLINE_COURSE");
 | 
											
												
													
														|  |  			vipDataTypes.add("VIP_GROUP_OFFLINE_COURSE");
 |  |  			vipDataTypes.add("VIP_GROUP_OFFLINE_COURSE");
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> indexBaseDataList = indexBaseMonthDataDao.getVipCourseDataList(organIds, vipDataTypes, startDate.toString(), endDate.toString(),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> indexBaseDataList = indexBaseMonthDataDao.getVipCourseDataList(organIds, vipDataTypes, startDate1, endDate1,tenantId);
 | 
											
												
													
														|  |  			if(!CollectionUtils.isEmpty(indexBaseDataList)){
 |  |  			if(!CollectionUtils.isEmpty(indexBaseDataList)){
 | 
											
												
													
														|  |  				for (IndexBaseMonthData indexBaseMonthData : indexBaseDataList) {
 |  |  				for (IndexBaseMonthData indexBaseMonthData : indexBaseDataList) {
 | 
											
												
													
														|  |  					if(StringUtils.isBlank(indexBaseMonthData.getExtendInfo())){
 |  |  					if(StringUtils.isBlank(indexBaseMonthData.getExtendInfo())){
 | 
											
										
											
												
													
														|  | @@ -152,61 +164,24 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().filter(d->Objects.nonNull(d.getDataType())).collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
 |  |  		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().filter(d->Objects.nonNull(d.getDataType())).collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -		//按天汇总
 |  | 
 | 
											
												
													
														|  | -		if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(FINANCE_PAY.getCode())||dataTypes.contains(FINANCE_BALANCE_AMOUNT.getCode())||dataTypes.contains(FINANCE_AMOUNT.getCode())) && organIds != null){
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> financePayDataWithTimely = indexBaseMonthDataDao.getFinancePayDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(IndexDataType.FINANCE_PAY,financePayDataWithTimely);
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId()));
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId()));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> totalAmountDataWithTimely = indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(IndexDataType.TOTAL_AMOUNT,totalAmountDataWithTimely);
 |  | 
 | 
											
												
													
														|  | -			//经营报表细化
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> applyAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"APPLY,ADD_STUDENT",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(APPLY_AMOUNT,applyAmount);
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> renewAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"RENEW",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(RENEW_AMOUNT,renewAmount);
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> vipAmount = indexBaseMonthDataDao.getVipAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(VIP_AMOUNT,vipAmount);
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> practiceAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(PRACTICE_AMOUNT,practiceAmount);
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> otherAmount = indexBaseMonthDataDao.getOtherAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			typeDateMap.put(OTHER_AMOUNT,otherAmount);
 |  | 
 | 
											
												
													
														|  | -		}
 |  | 
 | 
											
												
													
														|  |  		//按分部汇总
 |  |  		//按分部汇总
 | 
											
												
													
														|  | -		List<IndexBaseDto> indexBaseDtoList = new ArrayList<>();
 |  | 
 | 
											
												
													
														|  | -		if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(ORGAN_FINANCE_PAY.getCode())||dataTypes.contains(ORGAN_FINANCE_BALANCE_AMOUNT.getCode())||
 |  | 
 | 
											
												
													
														|  | 
 |  | +		if((CollectionUtils.isEmpty(dataTypes) || dataTypes.contains(ORGAN_FINANCE_BALANCE_AMOUNT.getCode()) ||
 | 
											
												
													
														|  |  				dataTypes.contains(ORGAN_FINANCE_AMOUNT.getCode())) && organIds != null){
 |  |  				dataTypes.contains(ORGAN_FINANCE_AMOUNT.getCode())) && organIds != null){
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> financePayDataWithTimely = indexBaseMonthDataDao.getOrganFinancePayDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_FINANCE_PAY,financePayDataWithTimely));
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceBalanceDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId())));
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_FINANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceActualDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId())));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> totalAmountDataWithTimely = indexBaseMonthDataDao.getOrganTotalAmountDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_TOTAL_AMOUNT,totalAmountDataWithTimely));
 |  | 
 | 
											
												
													
														|  | -			//经营报表细化
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> applyAmount = indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"APPLY,ADD_STUDENT",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_APPLY_AMOUNT,applyAmount));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> renewAmount = indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"RENEW",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_RENEW_AMOUNT,renewAmount));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> vipAmount = indexBaseMonthDataDao.getOrganVipAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_VIP_AMOUNT,vipAmount));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> practiceAmount = indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_PRACTICE_AMOUNT,practiceAmount));
 |  | 
 | 
											
												
													
														|  | -			List<IndexBaseMonthData> otherAmount = indexBaseMonthDataDao.getOrganOtherAmountDataWithTimelyDetails(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_OTHER_AMOUNT,otherAmount));
 |  | 
 | 
											
												
													
														|  | 
 |  | +			//经营数据查询
 | 
											
												
													
														|  | 
 |  | +			this.syncOperation(startDate1,endDate1,arrayList,tenantId,result,typeDateMap);
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(MUSIC_GROUP_COURSE.getCode())||dataTypes.contains(VIP_GROUP_COURSE.getCode())
 |  |  		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(MUSIC_GROUP_COURSE.getCode())||dataTypes.contains(VIP_GROUP_COURSE.getCode())
 | 
											
												
													
														|  |  				||dataTypes.contains(VIP_GROUP_ONLINE_COURSE.getCode())||dataTypes.contains(VIP_GROUP_OFFLINE_COURSE.getCode())
 |  |  				||dataTypes.contains(VIP_GROUP_ONLINE_COURSE.getCode())||dataTypes.contains(VIP_GROUP_OFFLINE_COURSE.getCode())
 | 
											
												
													
														|  |  				||dataTypes.contains(PRACTICE_GROUP_COURSE.getCode())){
 |  |  				||dataTypes.contains(PRACTICE_GROUP_COURSE.getCode())){
 | 
											
												
													
														|  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.MUSIC_GROUP_COURSE.getCode())) && organIds != null) {
 |  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.MUSIC_GROUP_COURSE.getCode())) && organIds != null) {
 | 
											
												
													
														|  | -				List<IndexBaseMonthData> musicCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.MUSIC, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +				List<IndexBaseMonthData> musicCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate1, endDate1, GroupType.MUSIC, null, null, arrayList,tenantId);
 | 
											
												
													
														|  |  				typeDateMap.put(MUSIC_GROUP_COURSE,musicCourseData);
 |  |  				typeDateMap.put(MUSIC_GROUP_COURSE,musicCourseData);
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_COURSE.getCode())) && organIds != null) {
 |  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_COURSE.getCode())) && organIds != null) {
 | 
											
												
													
														|  | -				List<IndexBaseMonthData> vipCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -				List<OrganVipGroupCategoryCourseNumDto> vipGroupCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +				List<IndexBaseMonthData> vipCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate1, endDate1, GroupType.VIP, null, null, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +				List<OrganVipGroupCategoryCourseNumDto> vipGroupCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate1, endDate1, GroupType.VIP, null, null, arrayList,tenantId);
 | 
											
												
													
														|  |  				Map<Integer, Map<String, Integer>> organCategoryCourseMap = new HashMap<>();
 |  |  				Map<Integer, Map<String, Integer>> organCategoryCourseMap = new HashMap<>();
 | 
											
												
													
														|  |  				if (!CollectionUtils.isEmpty(vipGroupCategoryCourseData)) {
 |  |  				if (!CollectionUtils.isEmpty(vipGroupCategoryCourseData)) {
 | 
											
												
													
														|  |  					organCategoryCourseMap = vipGroupCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 |  |  					organCategoryCourseMap = vipGroupCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 | 
											
										
											
												
													
														|  | @@ -220,8 +195,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_ONLINE_COURSE.getCode())) && organIds != null) {
 |  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_ONLINE_COURSE.getCode())) && organIds != null) {
 | 
											
												
													
														|  | -				List<IndexBaseMonthData> vipOnlineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.ONLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -				List<OrganVipGroupCategoryCourseNumDto> vipGroupOnlineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.ONLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +				List<IndexBaseMonthData> vipOnlineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate1, endDate1, GroupType.VIP, null, TeachModeEnum.ONLINE, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +				List<OrganVipGroupCategoryCourseNumDto> vipGroupOnlineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate1, endDate1, GroupType.VIP, null, TeachModeEnum.ONLINE, arrayList,tenantId);
 | 
											
												
													
														|  |  				Map<Integer, Map<String, Integer>> organOnlineCategoryCourseMap = new HashMap<>();
 |  |  				Map<Integer, Map<String, Integer>> organOnlineCategoryCourseMap = new HashMap<>();
 | 
											
												
													
														|  |  				if (!CollectionUtils.isEmpty(vipGroupOnlineCategoryCourseData)) {
 |  |  				if (!CollectionUtils.isEmpty(vipGroupOnlineCategoryCourseData)) {
 | 
											
												
													
														|  |  					organOnlineCategoryCourseMap = vipGroupOnlineCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 |  |  					organOnlineCategoryCourseMap = vipGroupOnlineCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 | 
											
										
											
												
													
														|  | @@ -235,8 +210,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_OFFLINE_COURSE.getCode())) && organIds != null) {
 |  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_OFFLINE_COURSE.getCode())) && organIds != null) {
 | 
											
												
													
														|  | -				List<IndexBaseMonthData> vipOfflineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.OFFLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | -				List<OrganVipGroupCategoryCourseNumDto> vipGroupOfflineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.OFFLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +				List<IndexBaseMonthData> vipOfflineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate1, endDate1, GroupType.VIP, null, TeachModeEnum.OFFLINE, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +				List<OrganVipGroupCategoryCourseNumDto> vipGroupOfflineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate1, endDate1, GroupType.VIP, null, TeachModeEnum.OFFLINE, arrayList,tenantId);
 | 
											
												
													
														|  |  				Map<Integer, Map<String, Integer>> organOfflineCategoryCourseMap = new HashMap<>();
 |  |  				Map<Integer, Map<String, Integer>> organOfflineCategoryCourseMap = new HashMap<>();
 | 
											
												
													
														|  |  				if (!CollectionUtils.isEmpty(vipGroupOfflineCategoryCourseData)) {
 |  |  				if (!CollectionUtils.isEmpty(vipGroupOfflineCategoryCourseData)) {
 | 
											
												
													
														|  |  					organOfflineCategoryCourseMap = vipGroupOfflineCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 |  |  					organOfflineCategoryCourseMap = vipGroupOfflineCategoryCourseData.stream().collect(Collectors.groupingBy(OrganVipGroupCategoryCourseNumDto::getOrganId, Collectors.toMap(OrganVipGroupCategoryCourseNumDto::getCategoryName, o -> o.getCourseNum())));
 | 
											
										
											
												
													
														|  | @@ -250,7 +225,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.PRACTICE_GROUP_COURSE.getCode())) && organIds != null) {
 |  |  			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.PRACTICE_GROUP_COURSE.getCode())) && organIds != null) {
 | 
											
												
													
														|  | -				List<IndexBaseMonthData> practiceCourses = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.PRACTICE, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 |  | 
 | 
											
												
													
														|  | 
 |  | +				List<IndexBaseMonthData> practiceCourses = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate1, endDate1, GroupType.PRACTICE, null, null, arrayList,tenantId);
 | 
											
												
													
														|  |  				typeDateMap.put(PRACTICE_GROUP_COURSE,practiceCourses);
 |  |  				typeDateMap.put(PRACTICE_GROUP_COURSE,practiceCourses);
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
										
											
												
													
														|  | @@ -277,7 +252,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  			typeDateMap.put(dataType, new ArrayList<>(Arrays.asList(indexBaseMonthData)));
 |  |  			typeDateMap.put(dataType, new ArrayList<>(Arrays.asList(indexBaseMonthData)));
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +		Boolean addFlag = false;
 | 
											
												
													
														|  | 
 |  | +		if(CollectionUtils.isEmpty(result)){
 | 
											
												
													
														|  | 
 |  | +			addFlag = true;
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  |  		for (Map.Entry<IndexDataType, List<IndexBaseMonthData>> typeDateMapEntry : typeDateMap.entrySet()) {
 |  |  		for (Map.Entry<IndexDataType, List<IndexBaseMonthData>> typeDateMapEntry : typeDateMap.entrySet()) {
 | 
											
												
													
														|  |  			List<IndexBaseMonthData> value = typeDateMapEntry.getValue();
 |  |  			List<IndexBaseMonthData> value = typeDateMapEntry.getValue();
 | 
											
												
													
														|  |  			Set<String> hasMonths = value.stream().filter(e->e.getMonth() != null).map(d -> DateUtil.dateToString(d.getMonth(), "yyyy-MM-dd")).collect(Collectors.toSet());
 |  |  			Set<String> hasMonths = value.stream().filter(e->e.getMonth() != null).map(d -> DateUtil.dateToString(d.getMonth(), "yyyy-MM-dd")).collect(Collectors.toSet());
 | 
											
										
											
												
													
														|  | @@ -313,9 +291,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  					indexBaseMonthData.setPercent(indexBaseMonthData.getActivateNum().divide(indexBaseMonthData.getTotalNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 |  |  					indexBaseMonthData.setPercent(indexBaseMonthData.getActivateNum().divide(indexBaseMonthData.getTotalNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 | 
											
												
													
														|  |  				}
 |  |  				}
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  | -			IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 |  | 
 | 
											
												
													
														|  | -			indexBaseData.setIndexMonthData(value, currentMonth);
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  			if(OTHER_AMOUNT.equals(typeDateMapEntry.getKey())){
 |  |  			if(OTHER_AMOUNT.equals(typeDateMapEntry.getKey())){
 | 
											
												
													
														|  | 
 |  | +				IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  |  				List<IndexBaseMonthData> otherAmountDetails = new ArrayList<>();
 |  |  				List<IndexBaseMonthData> otherAmountDetails = new ArrayList<>();
 | 
											
												
													
														|  |  				if(value != null && value.size() > 0){
 |  |  				if(value != null && value.size() > 0){
 | 
											
												
													
														|  |  					Map<String, List<IndexBaseMonthData>> collect = value.stream().filter(c->StringUtils.isNotEmpty(c.getOrderType())).collect(Collectors.groupingBy(e -> e.getOrderType()));
 |  |  					Map<String, List<IndexBaseMonthData>> collect = value.stream().filter(c->StringUtils.isNotEmpty(c.getOrderType())).collect(Collectors.groupingBy(e -> e.getOrderType()));
 | 
											
										
											
												
													
														|  | @@ -328,46 +307,132 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  					});
 |  |  					});
 | 
											
												
													
														|  |  				}
 |  |  				}
 | 
											
												
													
														|  |  				indexBaseData.setIndexMonthDataDetail(otherAmountDetails);
 |  |  				indexBaseData.setIndexMonthDataDetail(otherAmountDetails);
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setPercent(value.stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
											
												
													
														|  | 
 |  | +				result.add(indexBaseData);
 | 
											
												
													
														|  | 
 |  | +				continue;
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  | -			if(FINANCE_PAY.equals(typeDateMapEntry.getKey()) || FINANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  | 
 | 
											
												
													
														|  | 
 |  | +			if(FINANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  				FINANCE_BALANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  |  				FINANCE_BALANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  					TOTAL_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  |  					TOTAL_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  					APPLY_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  |  					APPLY_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  					RENEW_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  |  					RENEW_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  					VIP_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  |  					VIP_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  | -					PRACTICE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
 |  | 
 | 
											
												
													
														|  | -					OTHER_AMOUNT.equals(typeDateMapEntry.getKey())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +					PRACTICE_AMOUNT.equals(typeDateMapEntry.getKey())){
 | 
											
												
													
														|  | 
 |  | +				IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  |  				indexBaseData.setPercent(value.stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
 |  |  				indexBaseData.setPercent(value.stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
											
												
													
														|  | 
 |  | +				result.add(indexBaseData);
 | 
											
												
													
														|  | 
 |  | +				continue;
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  			if(IndexDataType.VIP_GROUP_COURSE.equals(typeDateMapEntry.getKey()) || VIP_GROUP_ONLINE_COURSE.equals(typeDateMapEntry.getKey()) ||
 |  |  			if(IndexDataType.VIP_GROUP_COURSE.equals(typeDateMapEntry.getKey()) || VIP_GROUP_ONLINE_COURSE.equals(typeDateMapEntry.getKey()) ||
 | 
											
												
													
														|  |  					IndexDataType.VIP_GROUP_OFFLINE_COURSE.equals(typeDateMapEntry.getKey())){
 |  |  					IndexDataType.VIP_GROUP_OFFLINE_COURSE.equals(typeDateMapEntry.getKey())){
 | 
											
												
													
														|  | 
 |  | +				IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  |  				for (IndexBaseMonthData indexBaseMonthData : indexBaseData.getIndexMonthData()) {
 |  |  				for (IndexBaseMonthData indexBaseMonthData : indexBaseData.getIndexMonthData()) {
 | 
											
												
													
														|  |  					if(vipCategoryCourseListMap.containsKey(indexBaseMonthData.getMonth())&&vipCategoryCourseListMap.get(indexBaseMonthData.getMonth()).containsKey(indexBaseData.getDataType())){
 |  |  					if(vipCategoryCourseListMap.containsKey(indexBaseMonthData.getMonth())&&vipCategoryCourseListMap.get(indexBaseMonthData.getMonth()).containsKey(indexBaseData.getDataType())){
 | 
											
												
													
														|  |  						TreeMap<String, Integer> extendSortMap = new TreeMap<>(vipCategoryCourseListMap.get(indexBaseMonthData.getMonth()).get(indexBaseData.getDataType()));
 |  |  						TreeMap<String, Integer> extendSortMap = new TreeMap<>(vipCategoryCourseListMap.get(indexBaseMonthData.getMonth()).get(indexBaseData.getDataType()));
 | 
											
												
													
														|  |  						indexBaseMonthData.setExtendInfo(JSON.toJSONString(extendSortMap));
 |  |  						indexBaseMonthData.setExtendInfo(JSON.toJSONString(extendSortMap));
 | 
											
												
													
														|  |  					}
 |  |  					}
 | 
											
												
													
														|  |  				}
 |  |  				}
 | 
											
												
													
														|  | 
 |  | +				result.add(indexBaseData);
 | 
											
												
													
														|  | 
 |  | +				continue;
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  			if(QUIT_MUSIC_GROUP_STUDENT_NUM.equals(typeDateMapEntry.getKey())){
 |  |  			if(QUIT_MUSIC_GROUP_STUDENT_NUM.equals(typeDateMapEntry.getKey())){
 | 
											
												
													
														|  |  				//查询时间段内学员成功退团申请的数量
 |  |  				//查询时间段内学员成功退团申请的数量
 | 
											
												
													
														|  | 
 |  | +				IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  |  				Integer quitNum = musicGroupDao.countQuitNum(queryInfo);
 |  |  				Integer quitNum = musicGroupDao.countQuitNum(queryInfo);
 | 
											
												
													
														|  |  				indexBaseData.setIndexMonthData(new ArrayList<>(),null);
 |  |  				indexBaseData.setIndexMonthData(new ArrayList<>(),null);
 | 
											
												
													
														|  |  				indexBaseData.setIndexMonthDataDetail(new ArrayList<>());
 |  |  				indexBaseData.setIndexMonthDataDetail(new ArrayList<>());
 | 
											
												
													
														|  |  				indexBaseData.setDataType(QUIT_MUSIC_GROUP_STUDENT_NUM);
 |  |  				indexBaseData.setDataType(QUIT_MUSIC_GROUP_STUDENT_NUM);
 | 
											
												
													
														|  |  				indexBaseData.setPercent(new BigDecimal(quitNum));
 |  |  				indexBaseData.setPercent(new BigDecimal(quitNum));
 | 
											
												
													
														|  |  				indexBaseData.setTitle(QUIT_MUSIC_GROUP_STUDENT_NUM.getMsg());
 |  |  				indexBaseData.setTitle(QUIT_MUSIC_GROUP_STUDENT_NUM.getMsg());
 | 
											
												
													
														|  | 
 |  | +				result.add(indexBaseData);
 | 
											
												
													
														|  | 
 |  | +				continue;
 | 
											
												
													
														|  | 
 |  | +			}
 | 
											
												
													
														|  | 
 |  | +			if(addFlag){
 | 
											
												
													
														|  | 
 |  | +				IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 | 
											
												
													
														|  | 
 |  | +				indexBaseData.setIndexMonthData(value, currentMonth);
 | 
											
												
													
														|  | 
 |  | +				result.add(indexBaseData);
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  | -			result.add(indexBaseData);
 |  | 
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  | -		result.addAll(indexBaseDtoList);
 |  | 
 | 
											
												
													
														|  |  		return result;
 |  |  		return result;
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +	//异步处理经营数据查询
 | 
											
												
													
														|  | 
 |  | +	public void syncOperation(String startDate1,String endDate1,List<Integer> arrayList,Integer tenantId,List<IndexBaseDto> indexBaseDtoList,Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap){
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future1 = CompletableFuture.supplyAsync(() -> {
 | 
											
												
													
														|  | 
 |  | +//			List<IndexBaseDto> indexBaseDtoList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_RENEW_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"RENEW",null,tenantId)));
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_VIP_AMOUNT,indexBaseMonthDataDao.getOrganVipAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId)));
 | 
											
												
													
														|  | 
 |  | +//			return indexBaseDtoList;
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future2 = CompletableFuture.supplyAsync(() -> {
 | 
											
												
													
														|  | 
 |  | +//			List<IndexBaseDto> indexBaseDtoList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_PRACTICE_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,tenantId)));
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_OTHER_AMOUNT,indexBaseMonthDataDao.getOrganOtherAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId)));
 | 
											
												
													
														|  | 
 |  | +//			return indexBaseDtoList;
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future3 = CompletableFuture.supplyAsync(() -> {
 | 
											
												
													
														|  | 
 |  | +//			List<IndexBaseDto> indexBaseDtoList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_TOTAL_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
 | 
											
												
													
														|  | 
 |  | +			//经营报表细化
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_APPLY_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"APPLY,ADD_STUDENT",null,tenantId)));
 | 
											
												
													
														|  | 
 |  | +//			return indexBaseDtoList;
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future4 = CompletableFuture.supplyAsync(() -> {
 | 
											
												
													
														|  | 
 |  | +//			List<IndexBaseDto> indexBaseDtoList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceBalanceDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
 | 
											
												
													
														|  | 
 |  | +			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_FINANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceActualDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
 | 
											
												
													
														|  | 
 |  | +//			return indexBaseDtoList;
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future5 = CompletableFuture.supplyAsync(()->{
 | 
											
												
													
														|  | 
 |  | +//			Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = new HashMap<>(2);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimely(startDate1, endDate1, arrayList,tenantId));
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimely(startDate1, endDate1, arrayList,tenantId));
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future6 = CompletableFuture.supplyAsync(()->{
 | 
											
												
													
														|  | 
 |  | +//			Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = new HashMap<>(2);
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> renewAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"RENEW",null,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(RENEW_AMOUNT,renewAmount);
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> vipAmount = indexBaseMonthDataDao.getVipAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(VIP_AMOUNT,vipAmount);
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future7 = CompletableFuture.supplyAsync(()->{
 | 
											
												
													
														|  | 
 |  | +//			Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = new HashMap<>(2);
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> totalAmountDataWithTimely = indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate1, endDate1, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(IndexDataType.TOTAL_AMOUNT,totalAmountDataWithTimely);
 | 
											
												
													
														|  | 
 |  | +			//经营报表细化
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> applyAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"APPLY,ADD_STUDENT",null,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(APPLY_AMOUNT,applyAmount);
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		CompletableFuture future8 = CompletableFuture.supplyAsync(()->{
 | 
											
												
													
														|  | 
 |  | +//			Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = new HashMap<>(2);
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> practiceAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(PRACTICE_AMOUNT,practiceAmount);
 | 
											
												
													
														|  | 
 |  | +			List<IndexBaseMonthData> otherAmount = indexBaseMonthDataDao.getOtherAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId);
 | 
											
												
													
														|  | 
 |  | +			typeDateMap.put(OTHER_AMOUNT,otherAmount);
 | 
											
												
													
														|  | 
 |  | +			return true;
 | 
											
												
													
														|  | 
 |  | +		},exportExecutorService);
 | 
											
												
													
														|  | 
 |  | +		future1.join();future2.join();future3.join();future4.join();
 | 
											
												
													
														|  | 
 |  | +		future5.join();future6.join();future7.join();future8.join();
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	@Override
 |  |  	@Override
 | 
											
												
													
														|  |  	@Transactional(rollbackFor = Exception.class)
 |  |  	@Transactional(rollbackFor = Exception.class)
 | 
											
												
													
														|  |  	public void indexBaseDataTask(Integer tenantId, String dayStr, Set<IndexDataType> dataTypes) {
 |  |  	public void indexBaseDataTask(Integer tenantId, String dayStr, Set<IndexDataType> dataTypes) {
 | 
											
												
													
														|  |  		LocalDate nowDate = LocalDate.now();
 |  |  		LocalDate nowDate = LocalDate.now();
 | 
											
												
													
														|  | -		
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  		List<Organization> allOrgans = organizationService.findAllOrgans(tenantId);
 |  |  		List<Organization> allOrgans = organizationService.findAllOrgans(tenantId);
 | 
											
												
													
														|  |  		this.organIds.get().clear();
 |  |  		this.organIds.get().clear();
 | 
											
												
													
														|  |  		this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
 |  |  		this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
 | 
											
										
											
												
													
														|  | @@ -887,7 +952,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
											
												
													
														|  |  		Map<Integer, Integer> studentErrorLeaveMap = new HashMap<>();
 |  |  		Map<Integer, Integer> studentErrorLeaveMap = new HashMap<>();
 | 
											
												
													
														|  |  		//会员过期学员数
 |  |  		//会员过期学员数
 | 
											
												
													
														|  |  		Map<Integer, Integer> noMemberStudentMap = new HashMap<>();
 |  |  		Map<Integer, Integer> noMemberStudentMap = new HashMap<>();
 | 
											
												
													
														|  | -		
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  		Integer tenantId = TenantContextHolder.getTenantId();
 |  |  		Integer tenantId = TenantContextHolder.getTenantId();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		if(IndexErrorType.MUSIC_PATROL.equals(errorType)||Objects.isNull(errorType)){
 |  |  		if(IndexErrorType.MUSIC_PATROL.equals(errorType)||Objects.isNull(errorType)){
 |