|
@@ -1,7 +1,7 @@
|
|
package com.ym.mec.biz.service.impl;
|
|
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.PayUserType.STUDENT;
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
|
|
|
|
|
|
+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.NON_PAYMENT;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
|
|
import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
|
|
import com.ym.mec.common.page.PageInfo;
|
|
import com.ym.mec.common.page.PageInfo;
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
import com.ym.mec.common.page.QueryInfo;
|
|
|
|
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -84,17 +85,21 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
}
|
|
}
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
|
|
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("修改失败:存在未开启缴费的学员");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
Set<Integer> studentIds = new HashSet<>();
|
|
Set<Integer> studentIds = new HashSet<>();
|
|
calenderDetails.forEach(e->{
|
|
calenderDetails.forEach(e->{
|
|
if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
- throw new BizException("修改失败,缴费状态不匹配");
|
|
|
|
|
|
+ throw new BizException("修改失败:缴费状态不匹配");
|
|
}
|
|
}
|
|
if(expectAmount.doubleValue() != 0){
|
|
if(expectAmount.doubleValue() != 0){
|
|
|
|
|
|
}
|
|
}
|
|
- /*if(expectAmount.doubleValue() == 0){
|
|
|
|
- e.setPaymentStatus(PAID_COMPLETED);
|
|
|
|
- }*/
|
|
|
|
e.setUpdateTime(date);
|
|
e.setUpdateTime(date);
|
|
e.setExpectAmount(expectAmount);
|
|
e.setExpectAmount(expectAmount);
|
|
if(expectAmount.doubleValue() > 0){
|
|
if(expectAmount.doubleValue() > 0){
|
|
@@ -103,16 +108,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- /*if(expectAmount.doubleValue() == 0){
|
|
|
|
- //如果是设置为0元
|
|
|
|
- MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
|
|
|
|
- if(calender.getType() == ONLINE){
|
|
|
|
- //剩余网管课可购买次数加一
|
|
|
|
- musicGroupStudentFeeDao.remainNetworkClassTimesAdd(ids);
|
|
|
|
- }
|
|
|
|
- //缴费完成
|
|
|
|
- musicGroupStudentFeeDao.setPaidCompleted(calenderDetails);
|
|
|
|
- }*/
|
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
//推送消息
|
|
//推送消息
|
|
if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
|
|
@@ -135,7 +130,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
null, 0, memo, null, musicGroup.getName());
|
|
null, 0, memo, null, musicGroup.getName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|