|
@@ -3,29 +3,23 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.IndexDataQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
-import com.ym.mec.common.filters.TenantIdThreadLocal;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
-
|
|
|
-import io.swagger.models.auth.In;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -34,12 +28,10 @@ import java.math.BigDecimal;
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ym.mec.biz.dal.enums.IndexDataType.*;
|
|
|
-import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
|
|
|
import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
|
|
|
|
|
|
@Service
|
|
@@ -153,7 +145,7 @@ 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));
|
|
|
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(FINANCE_PAY.getCode())||dataTypes.contains(FINANCE_BALANCE_AMOUNT.getCode())||dataTypes.contains(FINANCE_AMOUNT.getCode()) && organIds != null){
|
|
|
+ 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()));
|
|
@@ -176,12 +168,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
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(PRACTICE_GROUP_COURSE.getCode())){
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.MUSIC_GROUP_COURSE.getCode())) {
|
|
|
+ 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());
|
|
|
typeDateMap.put(MUSIC_GROUP_COURSE,musicCourseData);
|
|
|
}
|
|
|
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_COURSE.getCode())) {
|
|
|
+ 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());
|
|
|
Map<Integer, Map<String, Integer>> organCategoryCourseMap = new HashMap<>();
|
|
@@ -196,7 +188,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
typeDateMap.put(VIP_GROUP_COURSE,vipCourseData);
|
|
|
}
|
|
|
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_ONLINE_COURSE.getCode())) {
|
|
|
+ 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());
|
|
|
Map<Integer, Map<String, Integer>> organOnlineCategoryCourseMap = new HashMap<>();
|
|
@@ -211,7 +203,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
typeDateMap.put(VIP_GROUP_ONLINE_COURSE,vipOnlineCourseData);
|
|
|
}
|
|
|
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_OFFLINE_COURSE.getCode())) {
|
|
|
+ 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());
|
|
|
Map<Integer, Map<String, Integer>> organOfflineCategoryCourseMap = new HashMap<>();
|
|
@@ -226,7 +218,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
typeDateMap.put(VIP_GROUP_OFFLINE_COURSE,vipOfflineCourseData);
|
|
|
}
|
|
|
|
|
|
- if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.PRACTICE_GROUP_COURSE.getCode())) {
|
|
|
+ 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());
|
|
|
typeDateMap.put(PRACTICE_GROUP_COURSE,practiceCourses);
|
|
|
}
|
|
@@ -683,15 +675,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(), quitGroupNum));
|
|
|
|
|
|
//乐团学员会员到期首页提醒
|
|
|
- List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
|
|
|
- IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
|
|
|
- Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
- Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
- noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
|
|
|
- noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
|
|
|
- noClassMusicGroupStudentInfo.setNum2(userIds.size());
|
|
|
- noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
|
|
|
- twoChild.add(noClassMusicGroupStudentInfo);
|
|
|
+// List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
|
|
|
+// IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
|
|
|
+// Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
+// Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+// noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
|
|
|
+// noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
|
|
|
+// noClassMusicGroupStudentInfo.setNum2(userIds.size());
|
|
|
+// noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
|
|
|
+// twoChild.add(noClassMusicGroupStudentInfo);
|
|
|
two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
|
|
|
two.setResult(twoChild);
|
|
|
all.add(two);
|
|
@@ -1065,19 +1057,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
result.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
|
|
|
|
|
|
//乐团学员会员即将到期首页提醒
|
|
|
- String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
|
|
|
- if (StringUtils.isEmpty(configValue)) {
|
|
|
- configValue = "15";
|
|
|
- }
|
|
|
- List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
|
|
|
- Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
- Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
- IndexErrInfoDto infoDto = new IndexErrInfoDto();
|
|
|
- infoDto.setErrorType(IndexErrorType.MEMBER_STUDENT_INFO);
|
|
|
- infoDto.setNum(musicGroupIdList.size());
|
|
|
- infoDto.setNum2(userIds.size());
|
|
|
- infoDto.setDesc(IndexErrorType.MEMBER_STUDENT_INFO.getMsg());
|
|
|
- result.add(infoDto);
|
|
|
+// String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
|
|
|
+// if (StringUtils.isEmpty(configValue)) {
|
|
|
+// configValue = "15";
|
|
|
+// }
|
|
|
+// List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
|
|
|
+// Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
|
|
|
+// Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+// IndexErrInfoDto infoDto = new IndexErrInfoDto();
|
|
|
+// infoDto.setErrorType(IndexErrorType.MEMBER_STUDENT_INFO);
|
|
|
+// infoDto.setNum(musicGroupIdList.size());
|
|
|
+// infoDto.setNum2(userIds.size());
|
|
|
+// infoDto.setDesc(IndexErrorType.MEMBER_STUDENT_INFO.getMsg());
|
|
|
+// result.add(infoDto);
|
|
|
|
|
|
//乐团展演计划提醒
|
|
|
List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organIds);
|