|
@@ -1,41 +1,10 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
|
|
-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.Date;
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.HashSet;
|
|
|
|
|
-import java.util.Iterator;
|
|
|
|
|
-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.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.SysConfigDao;
|
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.FeeStudentDto;
|
|
import com.ym.mec.biz.dal.dto.FeeStudentDto;
|
|
|
import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
|
|
@@ -45,6 +14,17 @@ import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
|
|
+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.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
|
|
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail> implements MusicGroupPaymentCalenderDetailService {
|
|
public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail> implements MusicGroupPaymentCalenderDetailService {
|
|
@@ -146,41 +126,17 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
if(calenderDetails.size() == 0){
|
|
if(calenderDetails.size() == 0){
|
|
|
return "操作失败,没有可以开启缴费的学员";
|
|
return "操作失败,没有可以开启缴费的学员";
|
|
|
}
|
|
}
|
|
|
-// Long musicGroupPaymentCalenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
|
|
|
|
|
-// MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalenderId);
|
|
|
|
|
-// Date startPaymentDate = calender.getStartPaymentDate();
|
|
|
|
|
-// Date deadlinePaymentDate = calender.getDeadlinePaymentDate();
|
|
|
|
|
int length = ids.split(",").length;
|
|
int length = ids.split(",").length;
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
- /*Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
|
|
|
|
|
- MusicGroupPaymentCalenderDetail next;
|
|
|
|
|
- while(iterator.hasNext()){
|
|
|
|
|
- next = iterator.next();
|
|
|
|
|
- Integer countOpenPayment = musicGroupPaymentCalenderDetailDao.countOpenPayment(next.getMusicGroupId(), next.getUserId());
|
|
|
|
|
- if(countOpenPayment > 0){
|
|
|
|
|
- iterator.remove();
|
|
|
|
|
- }
|
|
|
|
|
- *//*int count1 = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),startPaymentDate,deadlinePaymentDate);
|
|
|
|
|
- int count = musicGroupPaymentCalenderDetailDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),next.getUserId());
|
|
|
|
|
- if(count > 0 || count1 > 0){
|
|
|
|
|
- iterator.remove();
|
|
|
|
|
- }*//*
|
|
|
|
|
- }*/
|
|
|
|
|
- /*if(calenderDetails.size() == 0){
|
|
|
|
|
- return "操作失败,学员有未完成的订单";
|
|
|
|
|
- }*/
|
|
|
|
|
Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
|
|
Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
|
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
|
calenderDetails.forEach(e->{
|
|
calenderDetails.forEach(e->{
|
|
|
e.setUpdateTime(date);
|
|
e.setUpdateTime(date);
|
|
|
e.setOpen(1);
|
|
e.setOpen(1);
|
|
|
-// e.setPaymentStatus(PROCESSING);
|
|
|
|
|
e.setStartPaymentDate(date);
|
|
e.setStartPaymentDate(date);
|
|
|
e.setDeadlinePaymentDate(date);
|
|
e.setDeadlinePaymentDate(date);
|
|
|
});
|
|
});
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
|
- //修改学员缴费状态为未缴费
|
|
|
|
|
-// musicGroupStudentFeeDao.setNoPayment(calenderDetails);
|
|
|
|
|
Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
//推送消息
|
|
//推送消息
|
|
|
if (studentIds.size() > 0) {
|
|
if (studentIds.size() > 0) {
|