yonge 3 years ago
parent
commit
57f22f1eb4

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudTeacherOrderServiceImpl.java

@@ -4,7 +4,9 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.CloudTeacherOrderDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.PeriodEnum;
 import com.ym.mec.biz.service.CloudTeacherOrderService;
+import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
@@ -29,6 +31,9 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
     private CourseScheduleDao courseScheduleDao;
     @Autowired
     private CloudTeacherDao cloudTeacherDao;
+    
+    @Autowired
+    private StudentService studentService;
 
 
     @Override
@@ -81,6 +86,25 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
         Date startTime = null;
         Date endTime = null;
         Date endBaseTime = null;
+        
+        PeriodEnum periodEnum = PeriodEnum.MONTH;
+		switch (cloudTeacherOrder.getType()) {
+		case 1:
+			periodEnum = PeriodEnum.DAY;
+			break;
+		case 2:
+			periodEnum = PeriodEnum.MONTH;
+			break;
+		case 3:
+			periodEnum = PeriodEnum.YEAR;
+			break;
+
+		default:
+			break;
+		}
+        //更新student表信息
+        studentService.updateMemberRank(cloudTeacherOrder.getStudentId(), cloudTeacherOrder.getLevel(), periodEnum, cloudTeacherOrder.getTime());
+        
         if (cloudTeacher == null) {
             cloudTeacher = new CloudTeacher();
             startTime = DateUtil.trunc(nowDate);