|
@@ -3,6 +3,7 @@ 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.*;
|
|
|
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.*;
|
|
@@ -86,26 +87,25 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
Date date = new Date();
|
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
|
|
|
//缴费项目已结束,并且没有单独开启缴费的学员,不能修改缴费金额
|
|
|
- if(calender.getStatus() == OVER){
|
|
|
- List<MusicGroupPaymentCalenderDetail> paymentCalenderDetails = calenderDetails.stream().filter(e -> e.getOpenFlag() == YesOrNoEnum.NO).collect(Collectors.toList());
|
|
|
- if(paymentCalenderDetails != null && paymentCalenderDetails.size() > 0){
|
|
|
- throw new BizException("修改失败:存在未开启缴费的学员");
|
|
|
- }
|
|
|
- }
|
|
|
+// if(calender.getStatus() == OVER){
|
|
|
+// List<MusicGroupPaymentCalenderDetail> paymentCalenderDetails = calenderDetails.stream().filter(e -> e.getOpenFlag() == YesOrNoEnum.NO).collect(Collectors.toList());
|
|
|
+// if(paymentCalenderDetails != null && paymentCalenderDetails.size() > 0){
|
|
|
+// throw new BizException("修改失败:存在未开启缴费的学员");
|
|
|
+// }
|
|
|
+// }
|
|
|
Set<Integer> studentIds = new HashSet<>();
|
|
|
calenderDetails.forEach(e->{
|
|
|
if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
|
throw new BizException("修改失败:缴费状态不匹配");
|
|
|
}
|
|
|
- if(expectAmount.doubleValue() != 0){
|
|
|
-
|
|
|
- }
|
|
|
e.setUpdateTime(date);
|
|
|
e.setExpectAmount(expectAmount);
|
|
|
if(expectAmount.doubleValue() > 0){
|
|
|
if((e.getOpen() != null && e.getOpen() == 1) || calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
|
|
|
studentIds.add(e.getUserId());
|
|
|
}
|
|
|
+ }else {
|
|
|
+ e.setPaymentStatus(PAID_COMPLETED);
|
|
|
}
|
|
|
});
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
@@ -157,11 +157,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
//推送消息
|
|
|
if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
- //将0元未缴费学员缴费状态更新为已缴费
|
|
|
- int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(calender.getId());
|
|
|
- calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + j);
|
|
|
- musicGroupPaymentCalenderDao.update(calender);
|
|
|
-
|
|
|
Map<Integer, String> push = new HashMap<>();
|
|
|
for (Integer userId : studentIds) {
|
|
|
push.put(userId, userId + "");
|