Selaa lähdekoodia

乐团乐器提供方式增加减免课程费用
乐团增加可选课程费用

周箭河 5 vuotta sitten
vanhempi
commit
b3ba45305d

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -497,13 +497,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             if (musicGroup.getCourseForm() == null) {
                 throw new BizException("可选课程不存在");
             }
-            Map<String, String> courseForm = JSON.parseObject(musicGroup.getCourseForm(), Map.class);
+            JSONObject courseForm = JSON.parseObject(musicGroup.getCourseForm());
             for (String courseKey : registerPayDto.getCourseKeys()) {
                 if (courseForm.get(courseKey) == null) {
                     throw new BizException("可选课程不存在");
                 }
                 CourseFormDto courseFormDto = new CourseFormDto();
-                JSONObject jsonObject = JSON.parseObject(musicGroup.getCourseForm());
+                JSONObject jsonObject = JSON.parseObject(courseForm.getString(courseKey));
                 orderAmount = orderAmount.add(jsonObject.getBigDecimal("value"));
                 courseFormDto.setType(courseKey);
                 courseFormDto.setPrice(jsonObject.getBigDecimal("value"));
@@ -703,13 +703,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             if (musicGroup.getCourseForm() == null) {
                 throw new BizException("可选课程不存在");
             }
-            Map<String, String> courseForm = JSON.parseObject(musicGroup.getCourseForm(), Map.class);
+            JSONObject courseForm = JSON.parseObject(musicGroup.getCourseForm());
             for (String courseKey : registerPayDto.getCourseKeys()) {
                 if (courseForm.get(courseKey) == null) {
                     throw new BizException("可选课程不存在");
                 }
                 CourseFormDto courseFormDto = new CourseFormDto();
-                JSONObject jsonObject = JSON.parseObject(musicGroup.getCourseForm());
+                JSONObject jsonObject = JSON.parseObject(courseForm.getString(courseKey));
                 orderAmount = orderAmount.add(jsonObject.getBigDecimal("value"));
                 courseFormDto.setType(courseKey);
                 courseFormDto.setPrice(jsonObject.getBigDecimal("value"));