|
|
@@ -1,71 +1,15 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
-import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
-import com.ym.mec.biz.dal.dto.FeeStudentDto;
|
|
|
-import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
|
|
|
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentSubTotalCourseTimesDto;
|
|
|
-import com.ym.mec.biz.dal.entity.ActivityUserMapper;
|
|
|
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
+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.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderMember;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
-import com.ym.mec.biz.dal.entity.Student;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
|
|
|
-import com.ym.mec.biz.service.ActivityUserMapperService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderMemberService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
@@ -73,6 +17,19 @@ 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 org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
|
|
|
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail> implements MusicGroupPaymentCalenderDetailService {
|
|
|
@@ -115,145 +72,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
return musicGroupPaymentCalenderDetailDao;
|
|
|
}
|
|
|
|
|
|
- /*@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public void updateExpectAmount(BigDecimal expectAmount,BigDecimal expectMemberAmount,String ids) {
|
|
|
- if((expectAmount == null && expectMemberAmount == null) || StringUtils.isEmpty(ids)){
|
|
|
- throw new BizException("参数校验失败");
|
|
|
- }
|
|
|
- if(expectAmount == null){
|
|
|
- expectAmount = BigDecimal.ZERO;
|
|
|
- }
|
|
|
- if(expectMemberAmount == null){
|
|
|
- expectMemberAmount = BigDecimal.ZERO;
|
|
|
- }
|
|
|
- //获取缴费列表
|
|
|
- List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.queryListByIds(ids);
|
|
|
- if(calenderDetails.size() == 0){
|
|
|
- throw new BizException("缴费记录不存在");
|
|
|
- }
|
|
|
- Date date = new Date();
|
|
|
- MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
-
|
|
|
- if(calender.getPaymentAmount().doubleValue() > 0d){
|
|
|
- BigDecimal totalAmount = calender.getPaymentAmount();
|
|
|
- BigDecimal subExpectAmount = expectAmount;
|
|
|
- if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST){
|
|
|
- List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(calender.getBatchNo(), calenderDetails.get(0).getUserId());
|
|
|
- if(studentDetails.size() == 0){
|
|
|
- throw new BizException("修改失败:缴费项目数据异常");
|
|
|
- }
|
|
|
- List<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
- for (int i = 0; i < studentDetails.size(); i++) {
|
|
|
- MusicGroupPaymentCalenderStudentDetail studentDetail = studentDetails.get(i);
|
|
|
- if(i == studentDetails.size() - 1){
|
|
|
- musicGroupPaymentCalenderStudentDetailDao.updateByCourseType(studentDetail.getCourseType(),calender.getBatchNo(),studentIds,subExpectAmount);
|
|
|
- }else {
|
|
|
- BigDecimal divide = studentDetail.getCourseCurrentPrice().divide(totalAmount, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
|
|
|
- BigDecimal courseAmount = divide.multiply(expectAmount).setScale(0, BigDecimal.ROUND_DOWN);
|
|
|
- subExpectAmount = subExpectAmount.subtract(courseAmount);
|
|
|
- musicGroupPaymentCalenderStudentDetailDao.updateByCourseType(studentDetail.getCourseType(),calender.getBatchNo(),studentIds,courseAmount);
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(calender.getId());
|
|
|
- if(courseSettingsList.size() == 0){
|
|
|
- throw new BizException("修改失败:缴费项目数据异常");
|
|
|
- }
|
|
|
- for (int i = 0; i < courseSettingsList.size(); i++) {
|
|
|
- MusicGroupPaymentCalenderCourseSettings courseSettings = courseSettingsList.get(i);
|
|
|
- if(i == courseSettingsList.size() - 1){
|
|
|
- musicGroupPaymentStudentCourseDetailDao.updateByCourseType(courseSettings.getCourseType().getCode(),ids,subExpectAmount);
|
|
|
- }else {
|
|
|
- BigDecimal divide = courseSettings.getCourseCurrentPrice().divide(totalAmount, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
|
|
|
- BigDecimal courseAmount = divide.multiply(expectAmount).setScale(0, BigDecimal.ROUND_DOWN);
|
|
|
- subExpectAmount = subExpectAmount.subtract(courseAmount);
|
|
|
- musicGroupPaymentStudentCourseDetailDao.updateByCourseType(courseSettings.getCourseType().getCode(),ids,courseAmount);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //为了解决学员欠费数量的问题,只要学员没有缴费就可以修改金额
|
|
|
- Set<Integer> studentIds = new HashSet<>();
|
|
|
- for (MusicGroupPaymentCalenderDetail e : calenderDetails) {
|
|
|
- if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
|
- throw new BizException("修改失败:缴费状态不匹配");
|
|
|
- }
|
|
|
- e.setUpdateTime(date);
|
|
|
-// e.setExpectAmount(expectAmount);
|
|
|
-// e.setExpectMemberAmount(expectMemberAmount);
|
|
|
-
|
|
|
- if(expectAmount.doubleValue() > 0 || expectMemberAmount.doubleValue() > 0){
|
|
|
- if((e.getOpen() != null && e.getOpen() == 1) || calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
|
|
|
- studentIds.add(e.getUserId());
|
|
|
- }
|
|
|
- }else {
|
|
|
- // 添加会员有效时长
|
|
|
- if(calender.getMemberRankSettingId() != null){
|
|
|
- CloudTeacherOrder cloudTeacherOrder = new CloudTeacherOrder();
|
|
|
- cloudTeacherOrder.setOrganId(musicGroup.getOrganId());
|
|
|
- cloudTeacherOrder.setType(calender.getMemberPeriod());
|
|
|
- cloudTeacherOrder.setTime(calender.getMemberValidDate());
|
|
|
- //只用会员价格
|
|
|
- cloudTeacherOrder.setAmount(expectMemberAmount);
|
|
|
- cloudTeacherOrder.setStudentId(e.getUserId());
|
|
|
- cloudTeacherOrder.setLevel(calender.getMemberRankSettingId());
|
|
|
- cloudTeacherOrder.setStatus(1);
|
|
|
- if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
|
|
|
- cloudTeacherOrder.setRemark("进行中乐团加学生,缴费金额改为0元");
|
|
|
- }else {
|
|
|
- cloudTeacherOrder.setRemark("乐团续费,缴费金额改为0元");
|
|
|
- }
|
|
|
- cloudTeacherOrder.setMusicGroupId(calender.getMusicGroupId());
|
|
|
- cloudTeacherOrderDao.insert(cloudTeacherOrder);
|
|
|
-// studentService.updateMemberRank(cloudTeacherOrder);
|
|
|
- }
|
|
|
- calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
|
|
|
- e.setPaymentStatus(PAID_COMPLETED);
|
|
|
- if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
|
|
|
- MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(e.getUserId(), calender.getMusicGroupId());
|
|
|
- if (musicGroupStudentFee != null) {
|
|
|
- musicGroupStudentFee.setUpdateTime(date);
|
|
|
- musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
- musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
- musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
- }
|
|
|
- //如果是进行中加学员
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(e.getUserId(), calender.getMusicGroupId());
|
|
|
- studentRegistration.setPaymentStatus(YES);
|
|
|
- studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
- studentRegistrationDao.update(studentRegistration);
|
|
|
-
|
|
|
- //统计变更学员数
|
|
|
- groupEventSource.musicGroupStudentChangeEvent(calender.getMusicGroupId(), StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(e.getUserId())));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- musicGroupPaymentCalenderDao.update(calender);
|
|
|
- musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
|
- //推送消息
|
|
|
- if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
- Map<Integer, String> push = new HashMap<>();
|
|
|
- for (Integer userId : studentIds) {
|
|
|
- push.put(userId, userId + "");
|
|
|
- }
|
|
|
- String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
- String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
|
|
|
- // 发送续费通知
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
|
|
|
- null, 0, memo,"STUDENT",musicGroup.getName());
|
|
|
-
|
|
|
- //获取未缴费且不是0元的学员列表
|
|
|
- Map<Integer,String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calender.getId(),studentIds));
|
|
|
- if(studentMaps.size() > 0){
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
|
|
|
- null, 0, memo, null, musicGroup.getName());
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String openPayment(String ids, Date startPaymentDate, Date deadlinePaymentDate) {
|
|
|
@@ -314,103 +132,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
musicGroupPaymentCalenderDetailDao.refreshUserMusicGroupPaymentStatusTask();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public void batchAdd(Long musicGroupPaymentCalenderId, Set<Integer> userIdList,MusicGroup musicGroup,Boolean autoCreate) {
|
|
|
-
|
|
|
- MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderService.get(musicGroupPaymentCalenderId);
|
|
|
- if(musicGroupPaymentCalender == null){
|
|
|
- throw new BizException("查询缴费信息失败");
|
|
|
- }
|
|
|
- if(musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY){
|
|
|
- throw new BizException("操作失败:报名缴费项不允许添加学员");
|
|
|
- }
|
|
|
- if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.AUDITING
|
|
|
- || musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.REJECT) {
|
|
|
- throw new BizException("当前缴费状态不能添加学生");
|
|
|
- }
|
|
|
-
|
|
|
- //判断学生是否已存在
|
|
|
- Set<Integer> userList = musicGroupPaymentCalenderDetailDao.queryStudentIds(musicGroupPaymentCalenderId);
|
|
|
-
|
|
|
- if(Collections.disjoint(userList, userIdList) == false){
|
|
|
- throw new BizException("操作失败:包含已存在的学员");
|
|
|
- }
|
|
|
-
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
|
|
|
-
|
|
|
- Date date = new Date();
|
|
|
- MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
|
|
|
- List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
|
|
|
- //创建缴费明细
|
|
|
- for(Integer studentId : userIdList){
|
|
|
- musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
- musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
|
|
|
- musicGroupPaymentCalenderDetail.setCreateTime(date);
|
|
|
- if (musicGroupPaymentCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
- musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
- } else {
|
|
|
- musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
- }
|
|
|
- musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
- musicGroupPaymentCalenderDetail.setUserId(studentId);
|
|
|
- musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
|
|
|
- musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
|
|
|
- musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
|
|
|
-
|
|
|
- musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
|
|
|
- }
|
|
|
-
|
|
|
- Map<Integer,Long> userMap = new HashMap<>();
|
|
|
- if (musicGroupPaymentCalenderDetailList.size() > 0) {
|
|
|
- musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
|
|
|
- for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
|
|
|
- userMap.put(cd.getUserId(), cd.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- //更新预计缴费人数
|
|
|
- musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());
|
|
|
- if (musicGroupPaymentCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
- musicGroupPaymentCalender.setActualNum(musicGroupPaymentCalender.getActualNum() + userIdList.size());
|
|
|
- }
|
|
|
- musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
- musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
|
|
|
-
|
|
|
- List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
|
|
|
- MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
|
|
|
- if(courseSettingsList.size() > 0){
|
|
|
- //创建学生课排课分钟数
|
|
|
- for(Integer studentId : userIdList){
|
|
|
- for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
|
|
|
- if (courseSettings.getIsStudentOptional() == true || courseSettings.getCourseTotalMinuties() == null || courseSettings.getCourseTotalMinuties() == 0) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
|
|
|
- musicGroupPaymentStudentCourseDetail.setCreateTime(date);
|
|
|
- musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
|
|
|
- musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(userMap.get(studentId));
|
|
|
- musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseOriginalPrice(courseSettings.getCourseOriginalPrice());
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseCurrentPrice(courseSettings.getCourseCurrentPrice());
|
|
|
- musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
|
|
|
- musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
|
|
|
- musicGroupPaymentStudentCourseDetail.setUserId(studentId);
|
|
|
- musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(musicGroupPaymentStudentCourseDetailList.size() > 0){
|
|
|
- musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
|
|
|
- }
|
|
|
- if(!autoCreate){
|
|
|
- //给学员推送缴费通知
|
|
|
- if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN){
|
|
|
- musicGroupPaymentCalenderService.pushWaitRenewMessage(musicGroupPaymentCalenderId,musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId()),userIdList);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -590,6 +311,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
|
|
|
for(Integer studentId : userIdList){
|
|
|
for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
|
|
|
+ if (courseSettings.getCourseTotalMinuties() == null || courseSettings.getCourseTotalMinuties() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
|
|
|
musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
|
|
|
musicGroupPaymentStudentCourseDetail.setCreateTime(date);
|