|  | @@ -113,8 +113,6 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private TenantPaymentOrderService tenantPaymentOrderService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private CourseScheduleDao courseScheduleDao;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  |      private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private StudentExtracurricularExercisesSituationService studentExtracurricularExercisesSituationService;
 | 
	
	
		
			
				|  | @@ -131,8 +129,6 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private CooperationOrganService cooperationOrganService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private StudentPaymentOrderDao studentPaymentOrderDao;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  |      private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private TeacherService teacherService;
 | 
	
	
		
			
				|  | @@ -185,13 +181,9 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private StudentCourseConsumerService studentCourseConsumerService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private StudentStatisticsDao studentStatisticsDao;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  |      private StudentTeacherMapperDao studentTeacherMapperDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private TeacherCloudCourseReportService teacherCloudCourseReportService;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  | -    private CloudTeacherOrderDao cloudTeacherOrderDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private static final ExecutorService exportExecutorService = Executors.newFixedThreadPool(10);
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
	
		
			
				|  | @@ -412,7 +404,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          String month = getParam(info, "month", String.class);
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<>(1);
 | 
	
		
			
				|  |  |          params.put("month",month);
 | 
	
		
			
				|  |  | -        int count = studentPaymentOrderDao.queryCount1(params);
 | 
	
		
			
				|  |  | +        int count = studentPaymentOrderService.getDao().queryCount1(params);
 | 
	
		
			
				|  |  |          if (count <= 0) {
 | 
	
		
			
				|  |  |              return BaseController.failed("没有可导出的数据");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -661,7 +653,9 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              for (MusicalListDetailDto musicalListDetail : musicalListDetails) {
 | 
	
		
			
				|  |  | -                if (!musicalListDetail.getUserId().equals(studentApplyDetailDto.getStudentId())) continue;
 | 
	
		
			
				|  |  | +                if (!musicalListDetail.getUserId().equals(studentApplyDetailDto.getStudentId())) {
 | 
	
		
			
				|  |  | +                    continue;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  studentApplyDetailDto.setKitGroupPurchaseTypeEnum(musicalListDetail.getKitGroupPurchaseTypeEnum());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if (PaymentStatusEnum.YES.equals(studentApplyDetailDto.getPaymentStatus()) && studentApplyDetailDto.getKitGroupPurchaseTypeEnum() == null) {
 | 
	
	
		
			
				|  | @@ -784,10 +778,10 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |              throw new BizException("没有可导出的记录");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          Set<Integer> studentIds = practiceGroupExports.stream().map(CourseGroupExportDto::getStudentId).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentCourseInfo(studentIds, GroupType.PRACTICE);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> studentCourseInfos = courseScheduleService.getDao().getStudentCourseInfo(studentIds, GroupType.PRACTICE);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> totalClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.PRACTICE, null);
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> noStartClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.PRACTICE, CourseStatusEnum.NOT_START);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> totalClassTimes = courseScheduleService.getDao().getStudentCourseScheduleNum(studentIds, GroupType.PRACTICE, null);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> noStartClassTimes = courseScheduleService.getDao().getStudentCourseScheduleNum(studentIds, GroupType.PRACTICE, CourseStatusEnum.NOT_START);
 | 
	
		
			
				|  |  |          for (CourseGroupExportDto practiceGroupExport : practiceGroupExports) {
 | 
	
		
			
				|  |  |              for (CourseGroupExportDto studentCourseInfo : studentCourseInfos) {
 | 
	
		
			
				|  |  |                  if (studentCourseInfo.getStudentId().equals(practiceGroupExport.getStudentId())) {
 | 
	
	
		
			
				|  | @@ -817,7 +811,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |      //vip管理导出
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List vipGroup() {
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> vipGroupExports = courseScheduleDao.getVipGroupExport(organizationService.getEmployeeOrgan(""));
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> vipGroupExports = courseScheduleService.getDao().getVipGroupExport(organizationService.getEmployeeOrgan(""));
 | 
	
		
			
				|  |  |          if (vipGroupExports == null || vipGroupExports.size() == 0) {
 | 
	
		
			
				|  |  |              throw new BizException("没有可导出的记录");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -827,9 +821,9 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          if (!CollectionUtils.isEmpty(studentLastCourseSchedule)) {
 | 
	
		
			
				|  |  |              studentLastCourseMap = MapUtil.convertMybatisMap(studentLastCourseSchedule);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> studentCourseInfos = courseScheduleDao.getStudentVipCourseInfo(studentIds);
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> totalClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.VIP, null);
 | 
	
		
			
				|  |  | -        List<CourseGroupExportDto> noStartClassTimes = courseScheduleDao.getStudentCourseScheduleNum(studentIds, GroupType.VIP, CourseStatusEnum.NOT_START);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> studentCourseInfos = courseScheduleService.getDao().getStudentVipCourseInfo(studentIds);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> totalClassTimes = courseScheduleService.getDao().getStudentCourseScheduleNum(studentIds, GroupType.VIP, null);
 | 
	
		
			
				|  |  | +        List<CourseGroupExportDto> noStartClassTimes = courseScheduleService.getDao().getStudentCourseScheduleNum(studentIds, GroupType.VIP, CourseStatusEnum.NOT_START);
 | 
	
		
			
				|  |  |          for (CourseGroupExportDto vipGroupExport : vipGroupExports) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              String lastClassDateStr = studentLastCourseMap.get(vipGroupExport.getStudentId());
 | 
	
	
		
			
				|  | @@ -999,7 +993,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          orderTypeList.add(OrderTypeEnum.PRACTICE_GROUP_BUY);
 | 
	
		
			
				|  |  |          orderTypeList.add(OrderTypeEnum.PRACTICE_GROUP_RENEW);
 | 
	
		
			
				|  |  |          orderTypeList.add(OrderTypeEnum.SMALL_CLASS_TO_BUY);
 | 
	
		
			
				|  |  | -        List<OrderByTypeExportDto> orders = studentPaymentOrderDao.getOrderByMonthAndType(organIds, orderTypeList, startTime, EndTime);
 | 
	
		
			
				|  |  | +        List<OrderByTypeExportDto> orders = studentPaymentOrderService.getDao().getOrderByMonthAndType(organIds, orderTypeList, startTime, EndTime);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (orders.size() <= 0) {
 | 
	
		
			
				|  |  |              throw new BizException("没有可导出的记录");
 | 
	
	
		
			
				|  | @@ -1411,7 +1405,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserService.getUser();
 | 
	
		
			
				|  |  |          queryInfo.setRoutingOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getRoutingOrganId(), sysUser.getIsSuperAdmin()));
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(queryInfo.getSearch())) {
 | 
	
		
			
				|  |  | -            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  | +            List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  |              List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              if (userIds.size() <= 0) {
 | 
	
		
			
				|  |  |                  userIds.add(0);
 | 
	
	
		
			
				|  | @@ -1441,7 +1435,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserService.getUser();
 | 
	
		
			
				|  |  |          queryInfo.setRoutingOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getRoutingOrganId(), sysUser.getIsSuperAdmin()));
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(queryInfo.getSearch())) {
 | 
	
		
			
				|  |  | -            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  | +            List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  |              List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              if (userIds.size() <= 0) {
 | 
	
		
			
				|  |  |                  userIds.add(0);
 | 
	
	
		
			
				|  | @@ -1550,7 +1544,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<String, Object>();
 | 
	
		
			
				|  |  |          queryInfo.setRows(65535);
 | 
	
		
			
				|  |  |          MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  | -        int count = studentStatisticsDao.countCourseConsumerDetail(params);
 | 
	
		
			
				|  |  | +        int count = studentStatisticsService.getDao().countCourseConsumerDetail(params);
 | 
	
		
			
				|  |  |          checkRows(count);
 | 
	
		
			
				|  |  |          ManagerDownload managerDownload = saveManagerDownload(ExportTypeEnum.EXPORT_COURSE_CONSUMER_DETAIL,user.getId());
 | 
	
		
			
				|  |  |          return this.asyncExport(() -> this.initExportInfo(studentCourseConsumerService.findCourseConsumerDetail(params), managerDownload,ExportEnum.EXPORT_COURSE_CONSUMER_DETAIL),
 | 
	
	
		
			
				|  | @@ -1573,7 +1567,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<String, Object>();
 | 
	
		
			
				|  |  |          queryInfo.setRows(65535);
 | 
	
		
			
				|  |  |          MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  | -        int count = studentStatisticsDao.countPreCourseConsumerDetail(params);
 | 
	
		
			
				|  |  | +        int count = studentStatisticsService.getDao().countPreCourseConsumerDetail(params);
 | 
	
		
			
				|  |  |          checkRows(count);
 | 
	
		
			
				|  |  |          ManagerDownload managerDownload = saveManagerDownload(ExportTypeEnum.EXPORT_PRE_COURSE_CONSUMER_DETAIL,user.getId());
 | 
	
		
			
				|  |  |          return this.asyncExport(() -> this.initExportInfo(studentCourseConsumerService.findPreCourseConsumerDetail(params), managerDownload,ExportEnum.EXPORT_PRE_COURSE_CONSUMER_DETAIL),
 | 
	
	
		
			
				|  | @@ -1674,7 +1668,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserService.getUser();
 | 
	
		
			
				|  |  |          queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getOrganId(), sysUser.getIsSuperAdmin()));
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(queryInfo.getSearch())) {
 | 
	
		
			
				|  |  | -            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  | +            List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  |              List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              if (userIds.size() <= 0) {
 | 
	
		
			
				|  |  |                  userIds.add(0);
 | 
	
	
		
			
				|  | @@ -1684,7 +1678,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<>();
 | 
	
		
			
				|  |  |          MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  |          params.put("notGroupType","MALL_SELL");
 | 
	
		
			
				|  |  | -        int count = studentPaymentOrderDao.queryCount(params);
 | 
	
		
			
				|  |  | +        int count = studentPaymentOrderService.getDao().queryCount(params);
 | 
	
		
			
				|  |  |          if (count <= 0) {
 | 
	
		
			
				|  |  |              return BaseController.failed("没有可导出的数据");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -1702,7 +1696,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserService.getUser();
 | 
	
		
			
				|  |  |          queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getOrganId(), sysUser.getIsSuperAdmin()));
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(queryInfo.getSearch())) {
 | 
	
		
			
				|  |  | -            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  | +            List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  |              List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              if (userIds.size() <= 0) {
 | 
	
		
			
				|  |  |                  userIds.add(0);
 | 
	
	
		
			
				|  | @@ -1712,7 +1706,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<>();
 | 
	
		
			
				|  |  |          MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  |          params.put("paymentType","MALL_BUY");
 | 
	
		
			
				|  |  | -        int count = studentPaymentOrderDao.queryCount(params);
 | 
	
		
			
				|  |  | +        int count = studentPaymentOrderService.getDao().queryCount(params);
 | 
	
		
			
				|  |  |          if (count <= 0) {
 | 
	
		
			
				|  |  |              return BaseController.failed("没有可导出的数据");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -1731,7 +1725,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserService.getUser();
 | 
	
		
			
				|  |  |          queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getOrganId(), sysUser.getIsSuperAdmin()));
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(queryInfo.getSearch())) {
 | 
	
		
			
				|  |  | -            List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  | +            List<BasicUserDto> users = studentPaymentOrderService.getDao().getUsers(queryInfo.getSearch());
 | 
	
		
			
				|  |  |              List<Integer> userIds = users.stream().map(BasicUserDto::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |              if (userIds.size() <= 0) {
 | 
	
		
			
				|  |  |                  userIds.add(0);
 | 
	
	
		
			
				|  | @@ -1740,7 +1734,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          Map<String, Object> params = new HashMap<>();
 | 
	
		
			
				|  |  |          MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  | -        int count = studentPaymentOrderDao.queryCount(params);
 | 
	
		
			
				|  |  | +        int count = studentPaymentOrderService.getDao().queryCount(params);
 | 
	
		
			
				|  |  |          if (count <= 0) {
 | 
	
		
			
				|  |  |              return BaseController.failed("没有可导出的数据");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -1782,7 +1776,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public void mallOrderList(Map<String, Object> params, ManagerDownload managerDownload){
 | 
	
		
			
				|  |  | -        List<StudentPaymentOrderMallExportDto> studentPaymentOrderExportDtos = studentPaymentOrderDao.exportMallQueryPage(params);
 | 
	
		
			
				|  |  | +        List<StudentPaymentOrderMallExportDto> studentPaymentOrderExportDtos = studentPaymentOrderService.getDao().exportMallQueryPage(params);
 | 
	
		
			
				|  |  |          long i = 1;
 | 
	
		
			
				|  |  |          //获取机构费率
 | 
	
		
			
				|  |  |          Integer tenantId = (Integer) params.get("tenantId");
 | 
	
	
		
			
				|  | @@ -2185,7 +2179,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |                      if (row.getGroupType().equals(GroupType.MUSIC)) {
 | 
	
		
			
				|  |  |                          if (row.getType() != OrderTypeEnum.APPLY && row.getType() != OrderTypeEnum.ADD_STUDENT) {
 | 
	
		
			
				|  |  |                              //判断之前是否有付费订单,如果没有,那么是乐团转化
 | 
	
		
			
				|  |  | -                            int orderNum = studentPaymentOrderDao.getStudentMusicOrderNum(row.getMusicGroupId(), row.getUserId(), row.getId());
 | 
	
		
			
				|  |  | +                            int orderNum = studentPaymentOrderService.getDao().getStudentMusicOrderNum(row.getMusicGroupId(), row.getUserId(), row.getId());
 | 
	
		
			
				|  |  |                              if (orderNum == 0) {
 | 
	
		
			
				|  |  |                                  row.setTypeDesc(StudentPaymentOrderExportDto.TypeDesc.MUSIC_CONVERT.getMsg());
 | 
	
		
			
				|  |  |                              }
 | 
	
	
		
			
				|  | @@ -2311,304 +2305,7 @@ public class ExportServiceImpl implements ExportService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public void operatingSummaryIncome(Map<String, Object> params, ManagerDownload managerDownload) {
 | 
	
		
			
				|  |  | -        List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderDao.ExportQueryPage1(params);
 | 
	
		
			
				|  |  | -        long i = 1;
 | 
	
		
			
				|  |  | -        //获取机构费率
 | 
	
		
			
				|  |  | -        List<Long> otherOrderIds = studentPaymentOrderExportDtos.stream().filter(e -> e.getGroupType() != GroupType.GOODS_SELL
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.REPLACEMENT
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.PRACTICE
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.SPORADIC
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.MEMBER
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.ACTIVITY
 | 
	
		
			
				|  |  | -                && e.getGroupType() != GroupType.VIP).map(e -> e.getId()).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -        Map<Long, List<StudentPaymentOrderExportDto>> feeByTypeMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        Map<Long, BigDecimal> childRepairMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!CollectionUtils.isEmpty(otherOrderIds)) {
 | 
	
		
			
				|  |  | -            List<StudentPaymentOrderExportDto> feeByType = sellOrderDao.queryFeeByType(otherOrderIds);
 | 
	
		
			
				|  |  | -            feeByTypeMap = feeByType.stream().collect(Collectors.groupingBy(StudentPaymentOrderExportDto::getId));
 | 
	
		
			
				|  |  | -            childRepairMap = MapUtil.convertIntegerMap(sellOrderDao.queryChildRepair(otherOrderIds));
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        List<Integer> organIds = studentPaymentOrderExportDtos.stream().map(e -> e.getOrganId()).distinct().collect(Collectors.toList());
 | 
	
		
			
				|  |  | -        Map<Integer, String> userOrganNameMap = organizationService.getMap("organization","id_","name_",organIds,managerDownload.getTenantId(),Integer.class,String.class);
 | 
	
		
			
				|  |  | -        //按分部分组
 | 
	
		
			
				|  |  | -        Map<Integer, List<StudentPaymentOrderExportDto>> listMap = studentPaymentOrderExportDtos.stream().collect(Collectors.groupingBy(e -> e.getOrganId()));
 | 
	
		
			
				|  |  | -        List<OperatingTotalIncomeDto> incomeDtos = new ArrayList<>();
 | 
	
		
			
				|  |  | -        //承担课程的云教练收入
 | 
	
		
			
				|  |  | -        String month = params.get("month").toString();
 | 
	
		
			
				|  |  | -//        String firstDayOfMonth = DateUtil.dateToString(DateUtil.getFirstDayOfMonth(DateUtil.stringToDate(month,DateUtil.ISO_YEAR_MONTH_FORMAT)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | -//        String lastDayOfMonth = DateUtil.dateToString(DateUtil.getLastDayOfMonth(DateUtil.stringToDate(month,DateUtil.ISO_YEAR_MONTH_FORMAT)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        String cutMonth = DateUtil.dateToString(DateUtil.addMonths(DateUtil.stringToDate(month,DateUtil.ISO_YEAR_MONTH_FORMAT),-1),DateUtil.ISO_YEAR_MONTH_FORMAT);
 | 
	
		
			
				|  |  | -        String cutFirstDayOfMonth = DateUtil.dateToString(DateUtil.getFirstDayOfMonth(DateUtil.stringToDate(cutMonth,DateUtil.ISO_YEAR_MONTH_FORMAT)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | -        String cutLastDayOfMonth = DateUtil.dateToString(DateUtil.getLastDayOfMonth(DateUtil.stringToDate(cutMonth,DateUtil.ISO_YEAR_MONTH_FORMAT)),DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | -        Map<Integer, BigDecimal> groupCloudAmount = MapUtil.convertIntegerMap(cloudTeacherOrderDao.sumGroupCloudAmount(cutMonth,cutFirstDayOfMonth,cutLastDayOfMonth));
 | 
	
		
			
				|  |  | -        //不承担课程的云教练收入
 | 
	
		
			
				|  |  | -        Map<Integer, BigDecimal> personalCloudAmount = MapUtil.convertIntegerMap(cloudTeacherOrderDao.sumPersonalCloudAmount(cutMonth,cutFirstDayOfMonth,cutLastDayOfMonth));
 | 
	
		
			
				|  |  | -        List<Map> courseFeeStat = courseScheduleStudentPaymentDao.statCourseFee(cutFirstDayOfMonth,cutLastDayOfMonth);
 | 
	
		
			
				|  |  | -        Map<Integer, BigDecimal> courseIncome = courseFeeStat.stream().collect(Collectors.toMap(s -> Integer.parseInt(s.get("key").toString()), s -> BigDecimal.valueOf(Double.parseDouble(s.get("value").toString()))));
 | 
	
		
			
				|  |  | -        for (Integer organId : listMap.keySet()) {
 | 
	
		
			
				|  |  | -            OperatingTotalIncomeDto incomeDto = new OperatingTotalIncomeDto();
 | 
	
		
			
				|  |  | -            incomeDto.setOrganName(userOrganNameMap.get(organId));
 | 
	
		
			
				|  |  | -            for (StudentPaymentOrderExportDto row : listMap.get(organId)) {
 | 
	
		
			
				|  |  | -                if (row.getActualAmount() == null) {
 | 
	
		
			
				|  |  | -                    row.setActualAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                if (row.getBalancePaymentAmount() == null) {
 | 
	
		
			
				|  |  | -                    row.setBalancePaymentAmount(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                if (row.getOrderDetailList() != null) {
 | 
	
		
			
				|  |  | -                    for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
 | 
	
		
			
				|  |  | -                        switch (orderDetail.getType()) {
 | 
	
		
			
				|  |  | -                            case COURSE:
 | 
	
		
			
				|  |  | -                            case CLASSROOM:
 | 
	
		
			
				|  |  | -                            case SINGLE:
 | 
	
		
			
				|  |  | -                            case MIX:
 | 
	
		
			
				|  |  | -                            case COMPREHENSIVE:
 | 
	
		
			
				|  |  | -                            case ENLIGHTENMENT:
 | 
	
		
			
				|  |  | -                            case TRAINING_SINGLE:
 | 
	
		
			
				|  |  | -                            case TRAINING_MIX:
 | 
	
		
			
				|  |  | -                            case MUSIC_NETWORK:
 | 
	
		
			
				|  |  | -                            case HIGH:
 | 
	
		
			
				|  |  | -                            case HIGH_ONLINE:
 | 
	
		
			
				|  |  | -                            case HIGH_ONLINE_COURSE:
 | 
	
		
			
				|  |  | -                                row.setMusicGroupCourseFee(row.getMusicGroupCourseFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case MUSICAL:
 | 
	
		
			
				|  |  | -                                if (row.getGroupType() != GroupType.GOODS_SELL) {
 | 
	
		
			
				|  |  | -                                    if (orderDetail.getKitGroupPurchaseType() != null && orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
 | 
	
		
			
				|  |  | -                                        row.setLeaseFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                    } else {
 | 
	
		
			
				|  |  | -                                        row.setMusicalFee(orderDetail.getPrice());
 | 
	
		
			
				|  |  | -                                    }
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case ACCESSORIES:
 | 
	
		
			
				|  |  | -                            case TEACHING:
 | 
	
		
			
				|  |  | -                                row.setTeachingFee(row.getTeachingFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case OTHER:
 | 
	
		
			
				|  |  | -                                row.setOtherFee(row.getOtherFee().add(orderDetail.getPrice()));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case MAINTENANCE:
 | 
	
		
			
				|  |  | -                                row.setMaintenanceFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case CLOUD_TEACHER:
 | 
	
		
			
				|  |  | -                            case CLOUD_TEACHER_PLUS:
 | 
	
		
			
				|  |  | -                                row.setCloudTeacherFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case DEGREE_REGISTRATION:
 | 
	
		
			
				|  |  | -                                row.setDegreeFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case PRACTICE:
 | 
	
		
			
				|  |  | -                                row.setPracticeCourseFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case VIP:
 | 
	
		
			
				|  |  | -                                row.setVipCourseFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case THEORY_COURSE:
 | 
	
		
			
				|  |  | -                                row.setTheoryCourseFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            case REPAIR:
 | 
	
		
			
				|  |  | -                                row.setRepairFee(getActualAmount(orderDetail.getPrice(), row));
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                            default:
 | 
	
		
			
				|  |  | -                                break;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                //专业
 | 
	
		
			
				|  |  | -                if (row.getGroupType().equals(GroupType.VIP)) {
 | 
	
		
			
				|  |  | -                    row.setVipCourseFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType() == GroupType.ACTIVITY) {
 | 
	
		
			
				|  |  | -                    row.setVipCourseFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType() == GroupType.MEMBER) {
 | 
	
		
			
				|  |  | -                    row.setCloudTeacherFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
 | 
	
		
			
				|  |  | -                    //考级报名
 | 
	
		
			
				|  |  | -                    if (row.getType().equals(OrderTypeEnum.DEGREE_REGISTRATION)) {
 | 
	
		
			
				|  |  | -                        if(StringUtils.isEmpty(row.getMemo())){
 | 
	
		
			
				|  |  | -                            row.setDegreeFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        }else {
 | 
	
		
			
				|  |  | -                            String[] feeTypes = row.getMemo().split(";");
 | 
	
		
			
				|  |  | -                            List<String> feeTypeList = Arrays.asList(feeTypes);
 | 
	
		
			
				|  |  | -                            for (String feeTypeStr : feeTypeList) {
 | 
	
		
			
				|  |  | -                                int index = feeTypeStr.lastIndexOf(":");
 | 
	
		
			
				|  |  | -                                if (index < 0) {
 | 
	
		
			
				|  |  | -                                    continue;
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                                BigDecimal typeFee = new BigDecimal(feeTypeStr.substring(index + 1));
 | 
	
		
			
				|  |  | -                                if (row.getExpectAmount().compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | -                                    typeFee = typeFee.multiply(row.getActualAmount()).divide(row.getExpectAmount(), 2, BigDecimal.ROUND_DOWN);
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                                if (feeTypeStr.contains("VIP")) {
 | 
	
		
			
				|  |  | -                                    row.setVipCourseFee(typeFee);
 | 
	
		
			
				|  |  | -                                } else if (feeTypeStr.contains("网管课")) {
 | 
	
		
			
				|  |  | -                                    row.setPracticeCourseFee(typeFee);
 | 
	
		
			
				|  |  | -                                } else if (feeTypeStr.contains("乐理课")) {
 | 
	
		
			
				|  |  | -                                    row.setTheoryCourseFee(typeFee);
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            row.setDegreeFee(row.getActualAmount().subtract(row.getVipCourseFee()).subtract(row.getPracticeCourseFee()).subtract(row.getTheoryCourseFee()));
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    } else {
 | 
	
		
			
				|  |  | -                        if (row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())) {
 | 
	
		
			
				|  |  | -                            row.setDegreeFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else if (row.getChargeType() != null && SporadicChargeTypeEnum.PRACTICE_GROUP_BUY.getCode().equals(row.getChargeType())) {
 | 
	
		
			
				|  |  | -                            row.setPracticeCourseFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else if (row.getChargeType() != null && SporadicChargeTypeEnum.MUSIC_UPKEEP.getCode().equals(row.getChargeType())) {
 | 
	
		
			
				|  |  | -                            row.setMaintenanceFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else if (row.getChargeType() != null && SporadicChargeTypeEnum.VISITING_FEE.getCode().equals(row.getChargeType())) {
 | 
	
		
			
				|  |  | -                            row.setVisitFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else if (row.getChargeType() != null && (SporadicChargeTypeEnum.RECHARGE.getCode().equals(row.getChargeType()) ||
 | 
	
		
			
				|  |  | -                                SporadicChargeTypeEnum.HIGH_ONLINE_ACTIVITY.getCode().equals(row.getChargeType()))) {
 | 
	
		
			
				|  |  | -                            row.setRechargeFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else if (row.getChargeType() != null && SporadicChargeTypeEnum.CLOUD_TEACHER_BUY.getCode().equals(row.getChargeType())) {
 | 
	
		
			
				|  |  | -                            row.setCloudTeacherFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        } else {
 | 
	
		
			
				|  |  | -                            row.setOtherFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType().equals(GroupType.PRACTICE)) {
 | 
	
		
			
				|  |  | -                    row.setPracticeCourseFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType().equals(GroupType.REPLACEMENT)) {
 | 
	
		
			
				|  |  | -                    row.setMusicalFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else if (row.getGroupType().equals(GroupType.GOODS_SELL)) {
 | 
	
		
			
				|  |  | -                    row.setRetailGoodsFee(row.getActualAmount());
 | 
	
		
			
				|  |  | -                } else {
 | 
	
		
			
				|  |  | -                    List<StudentPaymentOrderExportDto> exportDtoList = feeByTypeMap.get(row.getId());
 | 
	
		
			
				|  |  | -                    if (!CollectionUtils.isEmpty(exportDtoList)) {
 | 
	
		
			
				|  |  | -                        StudentPaymentOrderExportDto feeByType = exportDtoList.get(0);
 | 
	
		
			
				|  |  | -                        BigDecimal childRepairFee = childRepairMap.get(row.getId()) == null ? BigDecimal.ZERO : childRepairMap.get(row.getId());
 | 
	
		
			
				|  |  | -                        row.setMusicalFee(feeByType.getMusicalFee());
 | 
	
		
			
				|  |  | -                        row.setTeachingFee(feeByType.getTeachingFee().subtract(childRepairFee));
 | 
	
		
			
				|  |  | -                        row.setMaintenanceProductFee(feeByType.getRepairFee().add(childRepairFee));
 | 
	
		
			
				|  |  | -                        row.setOtherFee(feeByType.getOtherFee());
 | 
	
		
			
				|  |  | -                        if (row.getGroupType().equals(GroupType.MUSIC)) {
 | 
	
		
			
				|  |  | -                            row.setMusicGroupCourseFee(feeByType.getActualAmount().subtract(feeByType.getMusicalFee()).
 | 
	
		
			
				|  |  | -                                    subtract(row.getTeachingFee()).subtract(row.getMaintenanceFee()).subtract(row.getMaintenanceProductFee()).
 | 
	
		
			
				|  |  | -                                    subtract(feeByType.getOtherFee()).subtract(row.getLeaseFee()).subtract(row.getCloudTeacherFee()).
 | 
	
		
			
				|  |  | -                                    subtract(row.getVipCourseFee()).subtract(row.getPracticeCourseFee()));
 | 
	
		
			
				|  |  | -                        } else if (row.getGroupType().equals(OrderTypeEnum.REPAIR)) {
 | 
	
		
			
				|  |  | -                            row.setRepairFee(feeByType.getActualAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getOtherFee()));
 | 
	
		
			
				|  |  | -                        } else if (row.getGroupType() == GroupType.OUTORDER) {
 | 
	
		
			
				|  |  | -                            //销售收入
 | 
	
		
			
				|  |  | -                            BigDecimal add = feeByType.getMusicalFee().add(row.getTeachingFee()).add(row.getMaintenanceProductFee()).add(feeByType.getOtherFee());
 | 
	
		
			
				|  |  | -                            //服务收入
 | 
	
		
			
				|  |  | -                            BigDecimal subtract = feeByType.getActualAmount().subtract(add);
 | 
	
		
			
				|  |  | -                            //如果是淘器微信那么就是零售
 | 
	
		
			
				|  |  | -                            if (Objects.equals("淘器微信", row.getMerNos()) && add.compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | -                                //如果有服务收入那么是课程学校采买
 | 
	
		
			
				|  |  | -                                row.setMusicalFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                row.setTeachingFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                row.setMaintenanceProductFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                row.setOtherFee(subtract);
 | 
	
		
			
				|  |  | -                                row.setRetailGoodsFee(add);
 | 
	
		
			
				|  |  | -                            } else {
 | 
	
		
			
				|  |  | -                                //拆分导入订单
 | 
	
		
			
				|  |  | -                                if (row.getType() == OrderTypeEnum.OUTORDER || row.getType() == OrderTypeEnum.SCHOOL) {
 | 
	
		
			
				|  |  | -                                    if (row.getType() == OrderTypeEnum.SCHOOL) {
 | 
	
		
			
				|  |  | -                                        row.setMusicalFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                        row.setTeachingFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                        row.setMaintenanceProductFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                        row.setOtherFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                        row.setLargeMusicalFee(add);
 | 
	
		
			
				|  |  | -                                    }
 | 
	
		
			
				|  |  | -                                    row.setCourseSchoolBuyAmount(subtract);
 | 
	
		
			
				|  |  | -                                } else if (row.getType() == OrderTypeEnum.OTHER) {
 | 
	
		
			
				|  |  | -                                    row.setOtherFee(row.getOtherFee().add(subtract));
 | 
	
		
			
				|  |  | -                                } else {
 | 
	
		
			
				|  |  | -                                    row.setMusicalFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                    row.setTeachingFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                    row.setMaintenanceProductFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                    row.setOtherFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                                    row.setRetailGoodsFee(add);
 | 
	
		
			
				|  |  | -                                    row.setMusicGroupCourseFee(subtract);
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            row.setTransferFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                            row.setPlatformFee(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                row.setId(i);
 | 
	
		
			
				|  |  | -                row.setRepairFee(row.getRepairFee().add(row.getMaintenanceProductFee()));
 | 
	
		
			
				|  |  | -                row.setOrderAmount(row.getExpectAmount().add(row.getCouponRemitFee()));
 | 
	
		
			
				|  |  | -                i++;
 | 
	
		
			
				|  |  | -                //学员指导课费
 | 
	
		
			
				|  |  | -//                incomeDto.setStudentGuidanceIncome(incomeDto.getStudentGuidanceIncome()
 | 
	
		
			
				|  |  | -//                        .add(row.getMusicGroupCourseFee())
 | 
	
		
			
				|  |  | -//                        .add(row.getVipCourseFee())
 | 
	
		
			
				|  |  | -//                        .add(row.getPracticeCourseFee())
 | 
	
		
			
				|  |  | -//                        .add(row.getTheoryCourseFee()));
 | 
	
		
			
				|  |  | -                //学校课程采买
 | 
	
		
			
				|  |  | -                incomeDto.setCoursePurchaseIncome(incomeDto.getCoursePurchaseIncome()
 | 
	
		
			
				|  |  | -                        .add(row.getCourseSchoolBuyAmount()));
 | 
	
		
			
				|  |  | -                //考级
 | 
	
		
			
				|  |  | -                incomeDto.setExamIncome(incomeDto.getExamIncome()
 | 
	
		
			
				|  |  | -                        .add(row.getDegreeFee()));
 | 
	
		
			
				|  |  | -                //维修费用
 | 
	
		
			
				|  |  | -                incomeDto.setMaintenanceCost(incomeDto.getMaintenanceCost()
 | 
	
		
			
				|  |  | -                        .add(row.getRepairFee()));
 | 
	
		
			
				|  |  | -                //其他服务收入
 | 
	
		
			
				|  |  | -                incomeDto.setOtherServiceIncome(incomeDto.getOtherServiceIncome()
 | 
	
		
			
				|  |  | -                        .add(row.getLeaseFee())
 | 
	
		
			
				|  |  | -                        .add(row.getVisitFee())
 | 
	
		
			
				|  |  | -                        .add(row.getRechargeFee())
 | 
	
		
			
				|  |  | -                        .add(row.getOtherFee())
 | 
	
		
			
				|  |  | -                );
 | 
	
		
			
				|  |  | -                //团购乐器
 | 
	
		
			
				|  |  | -                incomeDto.setGroupPurchaseInstruments(incomeDto.getGroupPurchaseInstruments()
 | 
	
		
			
				|  |  | -                        .add(row.getMusicalFee()));
 | 
	
		
			
				|  |  | -                //零售乐器,计入其他
 | 
	
		
			
				|  |  | -                incomeDto.setOtherIncome(incomeDto.getOtherIncome()
 | 
	
		
			
				|  |  | -                        .add(row.getRetailGoodsFee()));
 | 
	
		
			
				|  |  | -                if(row.getGroupType() == GroupType.GOODS_SELL){
 | 
	
		
			
				|  |  | -                    //零售教辅,计入其他
 | 
	
		
			
				|  |  | -                    incomeDto.setOtherIncome(incomeDto.getOtherIncome()
 | 
	
		
			
				|  |  | -                            .add(row.getTeachingFee()));
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | -                    //团购教辅
 | 
	
		
			
				|  |  | -                    incomeDto.setGroupPurchaseTeachingAids(incomeDto.getGroupPurchaseTeachingAids()
 | 
	
		
			
				|  |  | -                            .add(row.getTeachingFee()));
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                //区分零售月保
 | 
	
		
			
				|  |  | -                if(row.getGroupType() == GroupType.MAINTENANCE){
 | 
	
		
			
				|  |  | -                    //零售月保,计入其他
 | 
	
		
			
				|  |  | -                    incomeDto.setOtherIncome(incomeDto.getOtherIncome()
 | 
	
		
			
				|  |  | -                            .add(row.getMaintenanceFee()));
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | -                    //团购月保
 | 
	
		
			
				|  |  | -                    incomeDto.setInstrumentInsuranceCost(incomeDto.getInstrumentInsuranceCost()
 | 
	
		
			
				|  |  | -                            .add(row.getMaintenanceFee()));
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                //大件乐器
 | 
	
		
			
				|  |  | -                incomeDto.setLargeInstruments(incomeDto.getLargeInstruments()
 | 
	
		
			
				|  |  | -                        .add(row.getLargeMusicalFee()));
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            //学员指导课费
 | 
	
		
			
				|  |  | -            incomeDto.setStudentGuidanceIncome(incomeDto.getStudentGuidanceIncome().add(courseIncome.getOrDefault(organId,BigDecimal.ZERO)));
 | 
	
		
			
				|  |  | -            incomeDto.setCloudCoachIncome(incomeDto.getCloudCoachIncome().add(groupCloudAmount.getOrDefault(organId,BigDecimal.ZERO)));
 | 
	
		
			
				|  |  | -            incomeDto.setSaleCloudCoachIncome(incomeDto.getSaleCloudCoachIncome().add(personalCloudAmount.getOrDefault(organId,BigDecimal.ZERO)));
 | 
	
		
			
				|  |  | -            //服务收入
 | 
	
		
			
				|  |  | -            incomeDto.setServiceIncome(incomeDto.getLargeInstruments()
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getStudentGuidanceIncome())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getCoursePurchaseIncome())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getExamIncome())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getMaintenanceCost())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getInstrumentInsuranceCost())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getOtherServiceIncome())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getCloudCoachIncome())
 | 
	
		
			
				|  |  | -            );
 | 
	
		
			
				|  |  | -            incomeDto.setSalesIncome(incomeDto.getSalesIncome()
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getSaleCloudCoachIncome())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getGroupPurchaseInstruments())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getGroupPurchaseTeachingAids())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getLargeInstruments())
 | 
	
		
			
				|  |  | -                    .add(incomeDto.getOtherIncome())
 | 
	
		
			
				|  |  | -            );
 | 
	
		
			
				|  |  | -            incomeDtos.add(incomeDto);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        List<OperatingTotalIncomeDto> incomeDtos = studentPaymentOrderService.queryOperatingSummaryIncome(params);
 | 
	
		
			
				|  |  |          HSSFWorkbook workbook = getHSSFWorkbook(incomeDtos, ExportEnum.EXPORT_OPERATING_SUMMARY_INCOME);
 | 
	
		
			
				|  |  |          exportManagerDownload(workbook, managerDownload);
 | 
	
		
			
				|  |  |      }
 |