Browse Source

修改61活动学员排课次数

zouxuan 4 years ago
parent
commit
5882566f97

+ 8 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ActivityCourseDetailDto.java

@@ -3,6 +3,8 @@ package com.ym.mec.biz.dal.dto;
 import com.alibaba.fastjson.annotation.JSONField;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
+
 public class ActivityCourseDetailDto {
     @JSONField(serialize=false)
     private Integer userId;
@@ -19,7 +21,11 @@ public class ActivityCourseDetailDto {
     @ApiModelProperty(value = "乐理课", required = false)
     private Integer musicTheory = 0;
 
-    private Integer musicTheoryPrice = 0;
+    private BigDecimal musicTheoryPrice;
+
+    public void setMusicTheoryPrice(BigDecimal musicTheoryPrice) {
+        this.musicTheoryPrice = musicTheoryPrice;
+    }
 
     public Integer getUserId() {
         return userId;
@@ -29,7 +35,7 @@ public class ActivityCourseDetailDto {
         this.userId = userId;
     }
 
-    public Integer getMusicTheoryPrice() {
+    public BigDecimal getMusicTheoryPrice() {
         return musicTheoryPrice;
     }
 

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -100,6 +100,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     private CloudTeacherOrderService cloudTeacherOrderService;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private OrganizationDegreeCourseFeeDao organizationDegreeCourseFeeDao;
 
     @Override
     public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -914,6 +916,15 @@ public class StudentManageServiceImpl implements StudentManageService {
         if(!activityCourseDetailDto.getMusicTheory().equals(0) && !activityCourseDetailDto.getMusicTheory().equals(1)){
             throw new BizException("修改失败:排课次数异常");
         }
+        SysUser sysUser = sysUserFeignService.queryUserById(student.getUserId());
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        OrganizationDegreeCourseFee degreeCourseFee = organizationDegreeCourseFeeDao.getByOrganId(sysUser.getOrganId());
+        if(degreeCourseFee == null){
+            throw new BizException("学员所在分部未配置考级价格");
+        }
+        activityCourseDetailDto.setMusicTheoryPrice(degreeCourseFee.getTheory());
         student.setActivityCourseDetail(JSON.toJSONString(activityCourseDetailDto));
         studentDao.update(student);
     }