|
@@ -2312,23 +2312,25 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentLastChange = subjectChangeDao.getStudentLastChange(userId, musicGroupId);
|
|
|
}
|
|
|
|
|
|
- for (StudentPaymentOrderDetail detail : orderDetailList) {
|
|
|
+ if (studentLastChange != null) {
|
|
|
+ if (isRefundInstrumentFee) {
|
|
|
+ amount = amount.add(studentLastChange.getChangeMusicalPrice());
|
|
|
+ }
|
|
|
|
|
|
- // 退乐器费用
|
|
|
- if (isRefundInstrumentFee && detail.getType() == OrderDetailTypeEnum.MUSICAL) {
|
|
|
- if (studentLastChange != null && studentLastChange.getOriginalOrderId() != null && studentLastChange.getOriginalOrderId() == detail.getPaymentOrderId().intValue()) {
|
|
|
- amount = amount.add(studentLastChange.getChangeMusicalPrice());
|
|
|
- } else {
|
|
|
+ if (isRefundTeachingAssistantsFee) {
|
|
|
+ amount = amount.add(studentLastChange.getChangeAccessoriesPrice());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (StudentPaymentOrderDetail detail : orderDetailList) {
|
|
|
+
|
|
|
+ // 退乐器费用
|
|
|
+ if (isRefundInstrumentFee && detail.getType() == OrderDetailTypeEnum.MUSICAL) {
|
|
|
amount = amount.add(detail.getPrice()).subtract(detail.getRemitFee());
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- // 退教辅费用
|
|
|
- if (isRefundTeachingAssistantsFee
|
|
|
- && (detail.getType() == OrderDetailTypeEnum.ACCESSORIES || detail.getType() == OrderDetailTypeEnum.TEACHING)) {
|
|
|
- if (studentLastChange != null && studentLastChange.getOriginalOrderId() != null && studentLastChange.getOriginalOrderId() == detail.getPaymentOrderId().intValue()) {
|
|
|
- amount = amount.add(studentLastChange.getChangeAccessoriesPrice());
|
|
|
- } else {
|
|
|
+ // 退教辅费用
|
|
|
+ if (isRefundTeachingAssistantsFee
|
|
|
+ && (detail.getType() == OrderDetailTypeEnum.ACCESSORIES || detail.getType() == OrderDetailTypeEnum.TEACHING)) {
|
|
|
amount = amount.add(detail.getPrice()).subtract(detail.getRemitFee());
|
|
|
}
|
|
|
}
|