|
@@ -179,6 +179,10 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
student.setCurrentClass(studentPreRegistration.getCurrentClass());
|
|
|
studentDao.insert(student);
|
|
|
|
|
|
+ if(user.getOrganId() == 59){
|
|
|
+ updateMemberRank(userId, PeriodEnum.MONTH, 1);
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -481,6 +485,43 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void updateMemberRank(Integer userId, PeriodEnum periodEnum, int times) {
|
|
|
+ Student student = this.get(userId);
|
|
|
+ if (student == null) {
|
|
|
+ throw new BizException("学员信息不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ Date nowDate = new Date();
|
|
|
+
|
|
|
+ if(student.getMembershipStartTime() == null){
|
|
|
+ student.setMembershipStartTime(nowDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(student.getMembershipEndTime().after(nowDate)){
|
|
|
+ nowDate = student.getMembershipEndTime();
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (periodEnum) {
|
|
|
+ case DAY:
|
|
|
+ student.setMembershipEndTime(DateUtil.addDays(nowDate, times));
|
|
|
+ break;
|
|
|
+ case MONTH:
|
|
|
+ case QUARTERLY:
|
|
|
+ case YEAR_HALF:
|
|
|
+ student.setMembershipEndTime(DateUtil.addMonths(nowDate, times));
|
|
|
+ break;
|
|
|
+ case YEAR:
|
|
|
+ student.setMembershipEndTime(DateUtil.addYears(nowDate, times));
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.update(student);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void updateStudentServiceTag(Integer studentId,List<Integer> studentIds,Integer serviceTag) {
|
|
|
studentDao.updateStudentServiceTag(studentId, studentIds, serviceTag);
|
|
|
}
|