|
@@ -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.*;
|
|
@@ -98,20 +99,19 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
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);
|
|
|
//推送消息
|
|
|
- /*if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
+ if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
String musicGroupId = calenderDetails.get(0).getMusicGroupId();
|
|
|
Map<Integer, String> push = new HashMap<>();
|
|
|
for (Integer userId : studentIds) {
|
|
@@ -130,7 +130,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
|
|
|
null, 0, memo, null, musicGroup.getName());
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -146,8 +146,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
}
|
|
|
int length = ids.split(",").length;
|
|
|
Date date = new Date();
|
|
|
-// Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
|
|
|
-// MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderId);
|
|
|
+ Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
|
|
|
+ MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderId);
|
|
|
calenderDetails.forEach(e->{
|
|
|
e.setUpdateTime(date);
|
|
|
e.setOpen(1);
|
|
@@ -157,7 +157,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
|
Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
//推送消息
|
|
|
- /*if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
+ if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
|
Map<Integer, String> push = new HashMap<>();
|
|
|
for (Integer userId : studentIds) {
|
|
|
push.put(userId, userId + "");
|
|
@@ -174,7 +174,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
|
|
|
null, 0, memo, null, musicGroup.getName());
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
StringBuffer append = new StringBuffer("操作成功: 成功开启缴费").append(studentIds.size()).append("条,失败").append(length - studentIds.size()).append("条");
|
|
|
return append.toString();
|
|
|
}
|
|
@@ -408,9 +408,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
|
|
|
|
|
|
Long musicGroupPaymentCalenderId = null;
|
|
|
-
|
|
|
for(MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenderList){
|
|
|
-
|
|
|
+ int paymentNum = 0;
|
|
|
+
|
|
|
musicGroupPaymentCalenderId = musicGroupPaymentCalender.getId();
|
|
|
|
|
|
if(musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY){
|
|
@@ -453,6 +453,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
|
|
|
if (musicGroupPaymentCalenderDetail.getExpectAmount().compareTo(new BigDecimal(0)) == 0) {
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
+ paymentNum++;
|
|
|
} else {
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
}
|
|
@@ -474,6 +475,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
//更新预计缴费人数
|
|
|
musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
+ musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + paymentNum);
|
|
|
musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
|
|
|
|
|
|
MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
|