|
@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType.ONLINE;
|
|
|
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 static com.ym.mec.biz.dal.enums.PaymentStatusEnum.OPEN;
|
|
|
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail> implements MusicGroupPaymentCalenderDetailService {
|
|
@@ -61,7 +62,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
throw new BizException("缴费记录不存在");
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
- calenderDetails.forEach(e->{
|
|
|
+ MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
|
|
|
+ Set<Integer> studentIds = new HashSet<>();
|
|
|
+ calenderDetails.forEach(e->{
|
|
|
if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
|
throw new BizException("修改失败,缴费状态不匹配");
|
|
|
}
|
|
@@ -73,6 +76,11 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
}*/
|
|
|
e.setUpdateTime(date);
|
|
|
e.setExpectAmount(expectAmount);
|
|
|
+ if(expectAmount.doubleValue() > 0){
|
|
|
+ if((e.getOpen() != null && e.getOpen() == 1) || calender.getPaymentStatus() == OPEN){
|
|
|
+ studentIds.add(e.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
/*if(expectAmount.doubleValue() == 0){
|
|
|
//如果是设置为0元
|
|
@@ -85,11 +93,11 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
musicGroupStudentFeeDao.setPaidCompleted(calenderDetails);
|
|
|
}*/
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
|
- if(expectAmount.doubleValue() > 0){
|
|
|
- String musicGroupId = calenderDetails.get(0).getMusicGroupId();
|
|
|
- Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+// if(expectAmount.doubleValue() > 0){
|
|
|
+// Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
//推送消息
|
|
|
if (studentIds.size() > 0) {
|
|
|
+ String musicGroupId = calenderDetails.get(0).getMusicGroupId();
|
|
|
Map<Integer, String> push = new HashMap<>();
|
|
|
for (Integer userId : studentIds) {
|
|
|
push.put(userId, userId + "");
|
|
@@ -100,7 +108,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
// 发送续费通知
|
|
|
sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
|
|
|
}
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
@Override
|