|
@@ -31,6 +31,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
@@ -49,6 +50,7 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatus
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
import com.ym.mec.biz.dal.entity.Organization;
|
|
@@ -92,6 +94,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
|
|
|
|
|
|
@Autowired
|
|
|
+ private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
|
|
|
@Autowired
|
|
@@ -206,6 +211,60 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
} else {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
+
|
|
|
+ //如果是进行中加学生
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
+ String studentIdStr = musicGroupPaymentCalender.getStudentIds();
|
|
|
+ if (StringUtils.isNoneBlank(studentIdStr)) {
|
|
|
+ //计算总费用
|
|
|
+ BigDecimal totalPrice = new BigDecimal(0);
|
|
|
+ for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
|
|
|
+ totalPrice = totalPrice.add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
|
|
|
+ MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
|
|
|
+
|
|
|
+ for (String studentId : studentIdStr.split(",")) {
|
|
|
+ // 学生加到calenderDetail
|
|
|
+ MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
+ musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
+ musicGroupPaymentCalenderDetail.setCreateTime(date);
|
|
|
+ musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
|
|
|
+ musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
+ musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
+ musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
|
|
|
+ musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
|
|
|
+ musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
|
|
|
+
|
|
|
+ musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
|
|
|
+
|
|
|
+ // 学生加课程明细
|
|
|
+ for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
|
|
|
+ if (courseSettings.getIsStudentOptional() == true) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
|
|
|
+ musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
|
|
|
+ musicGroupPaymentStudentCourseDetail.setCreateTime(date);
|
|
|
+ musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
|
|
|
+ musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
|
|
|
+ musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
|
|
|
+ musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
|
|
|
+ musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
|
|
|
+
|
|
|
+ musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(musicGroupPaymentStudentCourseDetailList.size() > 0){
|
|
|
+ musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 学生加到班级
|
|
|
+ String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
@@ -233,7 +292,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
.getMusicGroupOrganizationCourseSettingId());
|
|
|
for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
- musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
+ if (courseSettings != null) {
|
|
|
+ musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
+ }
|
|
|
}
|
|
|
musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
|
|
|
}
|