|
@@ -39,6 +39,7 @@ import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
import com.ym.mec.biz.dal.dto.CalenderPushDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
|
|
@@ -55,10 +56,12 @@ 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;
|
|
|
import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
|
|
|
+import com.ym.mec.biz.service.ClassGroupService;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.biz.service.SysMessageService;
|
|
@@ -100,6 +103,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ClassGroupService classGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
@Autowired
|
|
|
private MusicGroupBuildLogDao musicGroupBuildLogDao;
|
|
@@ -263,6 +269,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
// 学生加到班级
|
|
|
String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
|
|
|
+ if(StringUtils.isNotBlank(classGroupIdStr)){
|
|
|
+ for(String classGroupId : classGroupIdStr.split(",")){
|
|
|
+ ClassGroup classGroup = classGroupService.get(Integer.parseInt(classGroupId));
|
|
|
+ if(classGroup == null){
|
|
|
+ throw new BizException("根据班级编号查询不到对应的班级");
|
|
|
+ }
|
|
|
+ classGroupService.addStudent(classGroup, Integer.parseInt(studentId), GroupType.MUSIC);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -418,9 +433,72 @@ 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.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
+ 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(StringUtils.isNotBlank(classGroupIdStr)){
|
|
|
+ for(String classGroupId : classGroupIdStr.split(",")){
|
|
|
+ ClassGroup classGroup = classGroupService.get(Integer.parseInt(classGroupId));
|
|
|
+ if(classGroup == null){
|
|
|
+ throw new BizException("根据班级编号查询不到对应的班级");
|
|
|
+ }
|
|
|
+ classGroupService.addStudent(classGroup, Integer.parseInt(studentId), GroupType.MUSIC);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
-
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
|
|
|
if(countAuditReject == 0){
|