Forráskód Böngészése

Merge branch 'grade_feature' into test

周箭河 4 éve
szülő
commit
ba7f101c94

+ 7 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -149,6 +149,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private GroupEventSource groupEventSource;
     @Autowired
     private WebFeignService webFeignService;
+    @Autowired
+    private StudentService studentService;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -330,21 +332,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
 
         Organization organization = organizationDao.get(studentRegistration.getOrganId());
-        if(organization.getGradeType().equals(GradeTypeEnum.SIX_PLUS)){
-            for (SixPlusGradeEnum value : SixPlusGradeEnum.values()) {
-                if(value.getCode().equals(studentRegistration.getCurrentGradeNum())){
-                    studentRegistration.setCurrentGrade(value.getDesc());
-                    break;
-                }
-            }
-        }else {
-            for (FivePlusGradeEnum value : FivePlusGradeEnum.values()) {
-                if(value.getCode().equals(studentRegistration.getCurrentGradeNum())){
-                    studentRegistration.setCurrentGrade(value.getDesc());
-                    break;
-                }
-            }
-        }
+        String studentGrade = studentService.getStudentGrade(organization.getGradeType(), studentRegistration.getCurrentGradeNum());
+        studentRegistration.setCurrentGrade(studentGrade);
 
         if (hasReg != null) {
             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
@@ -1390,6 +1379,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         student.setParentsName(studentRegistration.getParentsName());
         student.setIdCardNo(studentRegistration.getIdCardNo());
         student.setGender(studentRegistration.getGender());
+        Organization organization = organizationDao.get(studentRegistration.getOrganId());
+        String studentGrade = studentService.getStudentGrade(organization.getGradeType(), studentRegistration.getCurrentGradeNum());
+        studentRegistration.setCurrentGrade(studentGrade);
         update(studentRegistration);
         studentRegistrationDao.updateUser(student.getUserId(),student.getName(), student.getParentsName(), student.getIdCardNo(), student.getGender(),studentRegistration.getCertificateType());
         //更新年级信息