|
@@ -560,23 +560,26 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
|
|
|
|
|
|
Date now = new Date();
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
|
|
|
- //获取分布默认的课程类型单价
|
|
|
-// MusicGroup musicGroup = musicGroupDao.findByClassGroupId(classGroupId.intValue());
|
|
|
-// Map<String, BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(), musicGroup.getOrganId()));
|
|
|
|
|
|
BigDecimal divide = masterTotalPrice.divide(new BigDecimal(classGroupNotStartCourse.size()), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal decimal = divide.multiply(new BigDecimal(classGroupNotStartCourse.size()));
|
|
|
|
|
|
//生成班级关联
|
|
|
for (Integer studentId : studentIds) {
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroupId.intValue());
|
|
|
- classGroupStudentMapper.setUserId(studentId);
|
|
|
- classGroupStudentMapper.setCreateTime(now);
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
- classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
- classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ ClassGroupStudentMapper classGroupStudent = classGroupStudentMapperDao.findClassGroupStudent(classGroupId.intValue(), studentId);
|
|
|
+ if(classGroupStudent != null){
|
|
|
+ classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapperDao.update(classGroupStudent);
|
|
|
+ }else {
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroupId.intValue());
|
|
|
+ classGroupStudentMapper.setUserId(studentId);
|
|
|
+ classGroupStudentMapper.setCreateTime(now);
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
+ classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ }
|
|
|
//生成课程关联
|
|
|
for (int i = 0; i < classGroupNotStartCourse.size(); i++) {
|
|
|
CourseSchedule courseSchedule = classGroupNotStartCourse.get(i);
|