瀏覽代碼

Merge remote-tracking branch 'origin/20221010' into 20221010

zouxuan 2 年之前
父節點
當前提交
ba10e9d7b7

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -110,7 +110,7 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
             BigDecimal waitRemitFee = couponRemitFee;
             //已使用减免金额
             BigDecimal useRemitFee = BigDecimal.ZERO;
-            List<StudentPaymentOrderDetail> collect = studentPaymentOrderDetailList.stream().filter(e -> e.getPrice().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
+            List<StudentPaymentOrderDetail> collect = studentPaymentOrderDetailList.stream().filter(e -> (e.getPrice().compareTo(BigDecimal.ZERO) > 0 && e.getType() != OrderDetailTypeEnum.ORGAN_SHARE_PROFIT)).collect(Collectors.toList());
             if (collect.size() == 0) {
                 throw new BizException("订单金额异常");
             }
@@ -571,9 +571,11 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
                         && !(o.getType() == MAINTENANCE)
                         && !(o.getType() == CLOUD_TEACHER)
                         && !(o.getType() == CLOUD_TEACHER_PLUS)
+                        && !(o.getType() == ORGAN_SHARE_PROFIT)
                         && !(o.getType() == ACCESSORIES))
                 .map(o -> o.getPrice().subtract(o.getRemitFee() == null ? BigDecimal.ZERO : o.getRemitFee()))
                 .reduce(BigDecimal.ZERO, BigDecimal::add);
+        
         if (studentRegistration.getTemporaryCourseFee() != null) {
             studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
         }

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -709,6 +709,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                 order.setPayingStatus(2);
             }
             if (order.getOrderDetailList() == null) continue;
+            
+            BigDecimal organShareProfit = BigDecimal.ZERO;
             for (StudentPaymentOrderDetail studentPaymentOrderDetail : order.getOrderDetailList()) {
                 if (studentPaymentOrderDetail.getGoodsList() == null) continue;
 
@@ -724,6 +726,21 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                 if (studentPaymentOrderDetail.getType() == OrderDetailTypeEnum.CLOUD_TEACHER || studentPaymentOrderDetail.getType() == OrderDetailTypeEnum.CLOUD_TEACHER_PLUS) {
                     studentPaymentOrderDetail.setCloudTeacherOrderDto(cloudTeacherOrderService.queryOrderInfoByOrderId(studentPaymentOrderDetail.getPaymentOrderId()));
                 }
+                
+                if (studentPaymentOrderDetail.getType() == OrderDetailTypeEnum.ORGAN_SHARE_PROFIT){
+                	organShareProfit = organShareProfit.add(studentPaymentOrderDetail.getPrice());
+                }
+            }
+            
+            StudentPaymentOrderDetail spod = null;
+            Iterator<StudentPaymentOrderDetail> iterator = order.getOrderDetailList().iterator();
+            while(iterator.hasNext()){
+            	spod = iterator.next();
+            	if(spod.getType() == OrderDetailTypeEnum.MUSICAL){
+            		spod.setPrice(spod.getPrice().add(organShareProfit));
+            	}else if(spod.getType() == OrderDetailTypeEnum.ORGAN_SHARE_PROFIT){
+            		iterator.remove();
+            	}
             }
         }
         return orders;