瀏覽代碼

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

zouxuan 3 年之前
父節點
當前提交
491ff8bc8f
共有 1 個文件被更改,包括 24 次插入12 次删除
  1. 24 12
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

+ 24 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -535,6 +535,15 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                                         MusicGroupApplyGoodsDto goodsDto,
                                         RegisterPayDto registerPayDto,
                                         CouponPayParam couponPayParam) throws Exception {
+    	
+        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
+        
+        if(musicGroup == null){
+        	throw new BizException("乐团[{}]信息查询失败", studentRegistration.getMusicGroupId());
+        }
+        
+        boolean isGiveAccessories = musicGroup.getIsGiveAccessories() == null ? false : musicGroup.getIsGiveAccessories();
+        
         Date date = new Date();
         List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
         //乐器及打包辅件
@@ -559,17 +568,21 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderDetail4goodsGroup.setType(type);
 
                 BigDecimal goodsPrice = new BigDecimal(0);
-                if (studentRegistration.getOrganId() == 55 && (newCourses == null || newCourses.size() == 0) && !registerPayDto.getBuyCloudTeacher()) {
-                    //取商品零售价
-                    if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {
-                        List<Goods> goodsList = goodsDao.findGoodsByIds(goodsGroup.getGoodsIdList());
-                        for (Goods goods : goodsList) {
-                            goodsPrice = goodsPrice.add(goods.getDiscountPrice());
-                        }
-                    }
-                } else {
-                    goodsPrice = goodsGroup.getPrice();
-                }
+                
+				if (!(type == OrderDetailTypeEnum.ACCESSORIES && (isGiveAccessories && registerPayDto.getBuyCloudTeacher()))) {
+
+	                if (studentRegistration.getOrganId() == 55 && (newCourses == null || newCourses.size() == 0) && !registerPayDto.getBuyCloudTeacher()) {
+	                    //取商品零售价
+	                    if (StringUtils.isNotBlank(goodsGroup.getGoodsIdList())) {
+	                        List<Goods> goodsList = goodsDao.findGoodsByIds(goodsGroup.getGoodsIdList());
+	                        for (Goods goods : goodsList) {
+	                            goodsPrice = goodsPrice.add(goods.getDiscountPrice());
+	                        }
+	                    }
+	                } else {
+	                    goodsPrice = goodsGroup.getPrice();
+	                }
+				}
                 studentPaymentOrderDetail4goodsGroup.setPrice(goodsPrice);
                 studentPaymentOrderDetail4goodsGroup.setGoodsIdList(goodsGroup.getGoodsIdList());
                 studentPaymentOrderDetail4goodsGroup.setCreateTime(date);
@@ -652,7 +665,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentPaymentOrderDetailList.add(maintenanceOrderDetail);
             }
         }
-        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
 
         //云教练/云教练+  todo  团练宝
         if (registerPayDto.getBuyCloudTeacher()) {