|
@@ -1,30 +1,38 @@
|
|
package com.ym.mec.biz.service.impl;
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import static com.ym.mec.biz.dal.enums.GroupType.LIVE;
|
|
|
|
-import static com.ym.mec.biz.dal.enums.GroupType.VIP;
|
|
|
|
-import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
|
|
|
|
-import static java.math.BigDecimal.*;
|
|
|
|
-
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
-import java.time.LocalDate;
|
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
-import java.util.*;
|
|
|
|
-import java.util.function.Function;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
-import com.ym.mec.biz.dal.dto.*;
|
|
|
|
import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
|
|
import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
|
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
|
+import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.mapper.LiveGroupPlusMapper;
|
|
import com.ym.mec.biz.dal.mapper.LiveGroupPlusMapper;
|
|
|
|
+import com.ym.mec.biz.dal.page.*;
|
|
import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
|
|
import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
|
|
import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
|
|
import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
|
|
|
|
+import com.ym.mec.biz.event.source.SendSeoMessageSource;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
|
|
+import com.ym.mec.common.constant.CommonConstants;
|
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
|
+import com.ym.mec.common.dal.BaseDAO;
|
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
|
+import com.ym.mec.common.service.IdGeneratorService;
|
|
|
|
+import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
|
+import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
|
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
|
+import com.ym.mec.util.date.DateConvertor;
|
|
|
|
+import com.ym.mec.util.date.DateUtil;
|
|
|
|
+import com.ym.mec.util.string.MessageFormatter;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -40,31 +48,17 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
-import com.ym.mec.auth.api.entity.SysUser;
|
|
|
|
-import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
|
|
|
|
-import com.ym.mec.biz.dal.page.ActivityUserQueryInfo;
|
|
|
|
-import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
|
|
|
|
-import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
|
|
|
|
-import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
|
|
|
|
-import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
|
|
|
|
-import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
|
|
|
|
-import com.ym.mec.biz.event.source.SendSeoMessageSource;
|
|
|
|
-import com.ym.mec.common.constant.CommonConstants;
|
|
|
|
-import com.ym.mec.common.controller.BaseController;
|
|
|
|
-import com.ym.mec.common.dal.BaseDAO;
|
|
|
|
-import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
|
-import com.ym.mec.common.exception.BizException;
|
|
|
|
-import com.ym.mec.common.page.PageInfo;
|
|
|
|
-import com.ym.mec.common.service.IdGeneratorService;
|
|
|
|
-import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
|
-import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
|
-import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
|
-import com.ym.mec.util.collection.MapUtil;
|
|
|
|
-import com.ym.mec.util.date.DateConvertor;
|
|
|
|
-import com.ym.mec.util.date.DateUtil;
|
|
|
|
-import com.ym.mec.util.string.MessageFormatter;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+import static com.ym.mec.biz.dal.enums.GroupType.VIP;
|
|
|
|
+import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
|
|
|
|
+import static java.math.BigDecimal.ROUND_DOWN;
|
|
|
|
+import static java.math.BigDecimal.ZERO;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> implements VipGroupService {
|
|
public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> implements VipGroupService {
|
|
@@ -456,8 +450,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
// 学生购买价格,老师课薪设置校验
|
|
// 学生购买价格,老师课薪设置校验
|
|
VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto = vipGroup.getVipGroupApplyBaseInfo();
|
|
VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto = vipGroup.getVipGroupApplyBaseInfo();
|
|
|
|
|
|
- if (Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
|
|
|
|
- && Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())) {
|
|
|
|
|
|
+ if (Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice()) && Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())) {
|
|
throw new BizException("请设置课程单价");
|
|
throw new BizException("请设置课程单价");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -508,25 +501,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
// VIP课参数校验
|
|
// VIP课参数校验
|
|
if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(groupType)) {
|
|
if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(groupType)) {
|
|
-
|
|
|
|
// 校验VIP课参数
|
|
// 校验VIP课参数
|
|
vipGroupRequestParamValid(vipGroup, vipGroupApplyBaseInfoDto, totalClassTimes, firstCourseSchedule, latestCourseSchedule);
|
|
vipGroupRequestParamValid(vipGroup, vipGroupApplyBaseInfoDto, totalClassTimes, firstCourseSchedule, latestCourseSchedule);
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// LIVE课参数校验
|
|
// LIVE课参数校验
|
|
if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
|
|
if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
|
|
-
|
|
|
|
ImLiveBroadcastRoomDto liveRoom = vipGroup.getLiveBroadcastRoom();
|
|
ImLiveBroadcastRoomDto liveRoom = vipGroup.getLiveBroadcastRoom();
|
|
if (Objects.isNull(liveRoom) || Objects.isNull(liveRoom.getRoomConfig())) {
|
|
if (Objects.isNull(liveRoom) || Objects.isNull(liveRoom.getRoomConfig())) {
|
|
throw new BizException("直播间参数错误");
|
|
throw new BizException("直播间参数错误");
|
|
}
|
|
}
|
|
-
|
|
|
|
if (StringUtils.isAnyBlank(liveRoom.getRoomTitle(), liveRoom.getLiveRemark(), liveRoom.getOs())
|
|
if (StringUtils.isAnyBlank(liveRoom.getRoomTitle(), liveRoom.getLiveRemark(), liveRoom.getOs())
|
|
|| Objects.isNull(liveRoom.getUseScene())) {
|
|
|| Objects.isNull(liveRoom.getUseScene())) {
|
|
throw new BizException("直播间参数错误");
|
|
throw new BizException("直播间参数错误");
|
|
}
|
|
}
|
|
-
|
|
|
|
// 直播间默认方案
|
|
// 直播间默认方案
|
|
String liveClient = sysConfigDao.findConfigValue("live_client");
|
|
String liveClient = sysConfigDao.findConfigValue("live_client");
|
|
liveRoom.setServiceProvider(liveClient);
|
|
liveRoom.setServiceProvider(liveClient);
|
|
@@ -567,22 +555,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
//计算课程相关费用信息
|
|
//计算课程相关费用信息
|
|
if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(groupType)) {
|
|
if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(groupType)) {
|
|
// 计算老师课薪
|
|
// 计算老师课薪
|
|
- costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto, vipGroupApplyBaseInfoDto.getUserId(), null);
|
|
|
|
- }
|
|
|
|
- if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
|
|
|
|
- costInfo.put("totalPrice",
|
|
|
|
- vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().multiply(new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum())));
|
|
|
|
|
|
+ costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto, vipGroupApplyBaseInfoDto.getUserId());
|
|
|
|
+ }else if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
|
|
|
|
+ costInfo.put("totalPrice",vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().multiply(new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum())));
|
|
|
|
+ costInfo.put("originalTotalPrice",vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().multiply(new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum())));
|
|
}
|
|
}
|
|
|
|
|
|
vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
|
|
vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
|
|
-
|
|
|
|
vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
|
|
vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
|
|
- //如果默认课酬与实际课酬不匹配则需要审批
|
|
|
|
-// if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary()) < 0){
|
|
|
|
-// vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
|
|
|
|
-// }
|
|
|
|
|
|
|
|
vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.getOrDefault("totalPrice", ZERO));
|
|
vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.getOrDefault("totalPrice", ZERO));
|
|
|
|
+ vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.getOrDefault("originalTotalPrice", ZERO));
|
|
if (CollectionUtils.isEmpty(vscps)) {
|
|
if (CollectionUtils.isEmpty(vscps)) {
|
|
vscps = new ArrayList<>();
|
|
vscps = new ArrayList<>();
|
|
for (Integer canBuyStudentId : canBuyStudentIds) {
|
|
for (Integer canBuyStudentId : canBuyStudentIds) {
|
|
@@ -1295,11 +1278,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
if (!ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())) {
|
|
if (!ActivityCourseType.FREE_VIP.equals(vipGroup.getVipGroupApplyBaseInfo().getActivityCourseType())) {
|
|
//计算课程相关费用信息
|
|
//计算课程相关费用信息
|
|
- Map<String, BigDecimal> costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto,
|
|
|
|
- vipGroupApplyBaseInfoDto.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto,vipGroupApplyBaseInfoDto.getUserId());
|
|
BigDecimal teacherSalary = costInfo.get("offlineTeacherSalary");
|
|
BigDecimal teacherSalary = costInfo.get("offlineTeacherSalary");
|
|
//是否是赠送课程
|
|
//是否是赠送课程
|
|
- ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(), "VIP", null);
|
|
|
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(), vipGroupApplyBaseInfoDto.getGroupType(), null);
|
|
if (activityUserMapper != null) {
|
|
if (activityUserMapper != null) {
|
|
if (vipGroupApplyBaseInfoDto.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
if (vipGroupApplyBaseInfoDto.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
teacherSalary = costInfo.get("giveOfflineTeacherSalary");
|
|
teacherSalary = costInfo.get("giveOfflineTeacherSalary");
|
|
@@ -2200,8 +2182,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public <K extends VipGroup> Map<String, BigDecimal> countVipGroupPredictFee1(K vipGroup,
|
|
public <K extends VipGroup> Map<String, BigDecimal> countVipGroupPredictFee1(K vipGroup,
|
|
- Integer teacherId,
|
|
|
|
- Long courseId) {
|
|
|
|
|
|
+ Integer teacherId) {
|
|
if (Objects.isNull(teacherId)) {
|
|
if (Objects.isNull(teacherId)) {
|
|
throw new BizException("请指定教师");
|
|
throw new BizException("请指定教师");
|
|
}
|
|
}
|
|
@@ -2232,6 +2213,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
VipGroupSalarySettlementTypeDto giveVipOfflineSalarySettlement = null;
|
|
VipGroupSalarySettlementTypeDto giveVipOfflineSalarySettlement = null;
|
|
BigDecimal discount = new BigDecimal(100);
|
|
BigDecimal discount = new BigDecimal(100);
|
|
BigDecimal totalPrice = null;
|
|
BigDecimal totalPrice = null;
|
|
|
|
+ BigDecimal originalTotalPrice = null;
|
|
if (vipGroup.getVipGroupActivityId() != null) {
|
|
if (vipGroup.getVipGroupActivityId() != null) {
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
discount = vipGroupActivity.getDiscount();
|
|
discount = vipGroupActivity.getDiscount();
|
|
@@ -2243,10 +2225,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
if(vipGroupActivity.getFixedCourseNumFlag()){
|
|
if(vipGroupActivity.getFixedCourseNumFlag()){
|
|
totalPrice = vipGroupActivity.getMarketPrice();
|
|
totalPrice = vipGroupActivity.getMarketPrice();
|
|
|
|
+ originalTotalPrice = vipGroupActivity.getOriginalPrice();
|
|
vipGroup.setTotalPrice(totalPrice);
|
|
vipGroup.setTotalPrice(totalPrice);
|
|
|
|
+ vipGroup.setOriginalTotalPrice(originalTotalPrice);
|
|
}
|
|
}
|
|
//是否是赠送课程
|
|
//是否是赠送课程
|
|
- ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
|
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), vipGroup.getGroupType(), null);
|
|
if (activityUserMapper != null) {
|
|
if (activityUserMapper != null) {
|
|
if (vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
if (vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
@@ -2272,13 +2256,16 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
//课程购买费用计算
|
|
//课程购买费用计算
|
|
totalPrice = onlineVipGroupCharge.add(offlineVipGroupCharge);
|
|
totalPrice = onlineVipGroupCharge.add(offlineVipGroupCharge);
|
|
|
|
+ originalTotalPrice = totalPrice;
|
|
totalPrice = totalPrice.multiply(discount).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
|
|
totalPrice = totalPrice.multiply(discount).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
vipGroup.setTotalPrice(totalPrice.setScale(0, BigDecimal.ROUND_CEILING));
|
|
vipGroup.setTotalPrice(totalPrice.setScale(0, BigDecimal.ROUND_CEILING));
|
|
|
|
+ vipGroup.setOriginalTotalPrice(originalTotalPrice);
|
|
}
|
|
}
|
|
results.put("totalPrice", vipGroup.getTotalPrice());
|
|
results.put("totalPrice", vipGroup.getTotalPrice());
|
|
|
|
+ results.put("originalTotalPrice", vipGroup.getOriginalTotalPrice());
|
|
|
|
|
|
- int normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(VIP, vipGroup.getId().toString());
|
|
|
|
|
|
+ int normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(vipGroup.getGroupType(), vipGroup.getId().toString());
|
|
|
|
|
|
//教师线下单课酬计算
|
|
//教师线下单课酬计算
|
|
BigDecimal teacherOfflineSalary = BigDecimal.ZERO;
|
|
BigDecimal teacherOfflineSalary = BigDecimal.ZERO;
|
|
@@ -2764,7 +2751,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), order,
|
|
studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), order,
|
|
vipGroup.getId().toString(), null);
|
|
vipGroup.getId().toString(), null);
|
|
//获取班级实际人数
|
|
//获取班级实际人数
|
|
- Integer studentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(groupType, classGroup.getMusicGroupId());
|
|
|
|
|
|
+ Integer studentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(vipGroup.getGroupType(), classGroup.getMusicGroupId());
|
|
//课程组人数已满,变更状态
|
|
//课程组人数已满,变更状态
|
|
if (studentNum.equals(classGroup.getExpectStudentNum())) {
|
|
if (studentNum.equals(classGroup.getExpectStudentNum())) {
|
|
vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
@@ -2781,7 +2768,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
List<TeacherAttendance> teacherAttendances = new ArrayList<>();
|
|
List<TeacherAttendance> teacherAttendances = new ArrayList<>();
|
|
//创建课酬信息
|
|
//创建课酬信息
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
- Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
//创建教师课程薪水记录
|
|
//创建教师课程薪水记录
|
|
CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
|
|
CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
|
|
@@ -2860,8 +2847,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
String organIdsString = StringUtils.join(hashSet, ",");
|
|
String organIdsString = StringUtils.join(hashSet, ",");
|
|
vipGroup.setOrganIdList(organIdsString);
|
|
vipGroup.setOrganIdList(organIdsString);
|
|
vipGroupDao.update(vipGroup);
|
|
vipGroupDao.update(vipGroup);
|
|
- }else {
|
|
|
|
- vipGroupDao.updateStudentIdList(vipGroup.getId(),userId);
|
|
|
|
}
|
|
}
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
|
|
//插入缴费明细
|
|
//插入缴费明细
|
|
@@ -2898,8 +2883,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
Map<Integer, String> map = new HashMap<>(1);
|
|
Map<Integer, String> map = new HashMap<>(1);
|
|
map.put(userId, userId.toString());
|
|
map.put(userId, userId.toString());
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, messageTypeEnum, map, null, 0, "2", "STUDENT",
|
|
|
|
- vipGroup.getName());
|
|
|
|
|
|
+ String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
|
+
|
|
|
|
+ String pushUrl = baseApiUrl + "/#/myOrder";
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
|
|
|
|
+ messageTypeEnum, map, null, 0, "8?" + pushUrl, "STUDENT",vipGroup.getName());
|
|
try {
|
|
try {
|
|
contractService.transferVipGroupCoursesContract(userId, vipGroup.getId(), order.getType());
|
|
contractService.transferVipGroupCoursesContract(userId, vipGroup.getId(), order.getType());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -3437,10 +3425,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
|
|
classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
|
|
}
|
|
}
|
|
|
|
|
|
- Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
|
|
BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
|
|
BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
|
|
//是否是赠送课程
|
|
//是否是赠送课程
|
|
- ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
|
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), vipGroup.getGroupType(), null);
|
|
if (activityUserMapper != null) {
|
|
if (activityUserMapper != null) {
|
|
if (vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
if (vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())) {
|
|
teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
|
|
teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
|
|
@@ -4054,7 +4042,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
courseScheduleService.batchAddCourseSchedule(vipGroupApplyDto.getCourseSchedules());
|
|
courseScheduleService.batchAddCourseSchedule(vipGroupApplyDto.getCourseSchedules());
|
|
|
|
|
|
- Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
|
|
BigDecimal offlineTeacherSalary = map.get("offlineTeacherSalary");
|
|
BigDecimal offlineTeacherSalary = map.get("offlineTeacherSalary");
|
|
//是否是赠送课程
|
|
//是否是赠送课程
|
|
ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
@@ -4193,7 +4181,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
if (courseNum == 0) {
|
|
if (courseNum == 0) {
|
|
courseScheduleService.batchAddCourseSchedule(courseSchedules);
|
|
courseScheduleService.batchAddCourseSchedule(courseSchedules);
|
|
|
|
|
|
- Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
|
|
BigDecimal offlineTeacherSalary = salaryMap.get("offlineTeacherSalary");
|
|
BigDecimal offlineTeacherSalary = salaryMap.get("offlineTeacherSalary");
|
|
//是否是赠送课程
|
|
//是否是赠送课程
|
|
ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
@@ -4520,7 +4508,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
List<TeacherAttendance> teacherAttendances = new ArrayList<>();
|
|
List<TeacherAttendance> teacherAttendances = new ArrayList<>();
|
|
//创建课酬信息
|
|
//创建课酬信息
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
|
|
- Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
|
|
|
|
|
|
+ Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
for (CourseSchedule courseSchedule : courseSchedules) {
|
|
//创建教师课程薪水记录
|
|
//创建教师课程薪水记录
|
|
CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
|
|
CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
|
|
@@ -4589,6 +4577,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
vipGroup.getName(), null, null, vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
|
|
vipGroup.getName(), null, null, vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
|
|
imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
|
|
imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
|
|
imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
|
|
imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
|
|
|
|
+ classGroupDao.update(classGroup);
|
|
}
|
|
}
|
|
vipGroupDao.update(vipGroup);
|
|
vipGroupDao.update(vipGroup);
|
|
}
|
|
}
|
|
@@ -4694,6 +4683,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("未找到此课程");
|
|
throw new BizException("未找到此课程");
|
|
}
|
|
}
|
|
VipGroupPayInfoDto vipGroupPayInfo = new VipGroupPayInfoDto();
|
|
VipGroupPayInfoDto vipGroupPayInfo = new VipGroupPayInfoDto();
|
|
|
|
+ if("LIVE".equals(vipGroup.getGroupType())){
|
|
|
|
+ ImLiveBroadcastRoomDto roomDto = JSON.parseObject(vipGroup.getLiveConfigJson(), ImLiveBroadcastRoomDto.class);
|
|
|
|
+ String subjectId = roomDto.getSubjectId();
|
|
|
|
+ Subject subject = subjectDao.get(Integer.parseInt(subjectId));
|
|
|
|
+ //乐理不提醒
|
|
|
|
+ if(!subject.getParentSubjectId().equals(30)){
|
|
|
|
+ Student student = studentDao.get(userId);
|
|
|
|
+ if(!student.getSubjectIdList().equals(subjectId)){
|
|
|
|
+ vipGroupPayInfo.setAlertSubjectFlag(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
vipGroupPayInfo.setTenantId(vipGroup.getTenantId());
|
|
vipGroupPayInfo.setTenantId(vipGroup.getTenantId());
|
|
vipGroupPayInfo.setVipGroupId(vipGroup.getId().intValue());
|
|
vipGroupPayInfo.setVipGroupId(vipGroup.getId().intValue());
|
|
vipGroupPayInfo.setViipGroupName(vipGroup.getName());
|
|
vipGroupPayInfo.setViipGroupName(vipGroup.getName());
|
|
@@ -4734,7 +4735,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
queryInfo.setExpireFlag(true);
|
|
queryInfo.setExpireFlag(true);
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
MapUtil.populateMap(params, queryInfo);
|
|
MapUtil.populateMap(params, queryInfo);
|
|
- // VIP小课、直播课
|
|
|
|
|
|
+ // VIP小课
|
|
List<StudentVipGroupShowListDto> vipGroups = vipGroupDao.findVipGroups(params);
|
|
List<StudentVipGroupShowListDto> vipGroups = vipGroupDao.findVipGroups(params);
|
|
// 直播课
|
|
// 直播课
|
|
vipGroups.addAll(vipGroupDao.findLiveGroups(params));
|
|
vipGroups.addAll(vipGroupDao.findLiveGroups(params));
|
|
@@ -4933,7 +4934,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
@Override
|
|
@Override
|
|
public void liveCourseRemind() {
|
|
public void liveCourseRemind() {
|
|
// 查询30分钟内要开始的并且没有直播通知的直播课
|
|
// 查询30分钟内要开始的并且没有直播通知的直播课
|
|
- List<CourseSchedule> courseSchedules = courseScheduleDao.liveCourseRemind();
|
|
|
|
|
|
+ List<CourseSchedule> courseSchedules = courseScheduleDao.liveCourseRemind(30);
|
|
|
|
|
|
if (CollectionUtils.isEmpty(courseSchedules)) {
|
|
if (CollectionUtils.isEmpty(courseSchedules)) {
|
|
return;
|
|
return;
|