|
@@ -38,6 +38,9 @@ import java.math.BigDecimal;
|
|
|
import java.math.BigInteger;
|
|
|
import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
import java.util.function.Consumer;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.function.Predicate;
|
|
@@ -417,7 +420,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
if (paymentType == PaymentType.ADD_STUDENT) {
|
|
|
musicGroupPaymentCalender.setPayUserType(STUDENT);
|
|
|
-// musicGroupPaymentCalender.setIsGiveMusicNetwork(false);
|
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
|
musicGroupPaymentCalender.setExpectNum(1);
|
|
|
}
|
|
@@ -434,10 +436,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
// 设置批次号
|
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
|
- //设置会员缴费金额、级别以及有效期
|
|
|
-// musicGroupPaymentCalender.setMemberPaymentAmount(musicGroupPaymentCalenderDto.getMemberPaymentAmount());
|
|
|
-// musicGroupPaymentCalender.setMemberRankSettingId(musicGroupPaymentCalenderDto.getMemberRankSettingId());
|
|
|
-// musicGroupPaymentCalender.setMemberValidDate(musicGroupPaymentCalenderDto.getMemberValidDate());
|
|
|
musicGroupPaymentCalenderDto.setBatchNo(batchNo);
|
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
|
|
|
@@ -544,13 +542,27 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
throw new BizException("创建失败,已经存在缴费信息");
|
|
|
}
|
|
|
}
|
|
|
+ //进行中加学员拓展信息
|
|
|
+ CalenderAddStudent calenderAddStudent = musicGroupPaymentBaseCalender.getCalenderAddStudent();
|
|
|
+ MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
|
+ //判断缴费项目类型
|
|
|
if(musicGroup.getStatus() == MusicGroupStatusEnum.PRE_BUILD_FEE){
|
|
|
musicGroupPaymentBaseCalender.setPaymentType(MUSIC_APPLY);
|
|
|
}else {
|
|
|
- if(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId() != null){
|
|
|
- musicGroupPaymentBaseCalender.setPaymentType(MUSIC_RENEW);
|
|
|
+ if(calenderAddStudent != null && calenderAddStudent.getStudentIds() != null){
|
|
|
+ musicGroupPaymentBaseCalender.setPaymentType(ADD_STUDENT);
|
|
|
+ //预计缴费人数
|
|
|
+ musicGroupPaymentCalender.setAttribute1(calenderAddStudent.getClassGroupIds());
|
|
|
+ musicGroupPaymentCalender.setStudentIds(calenderAddStudent.getStudentIds().toString());
|
|
|
+ musicGroupPaymentCalender.setExpectNum(1);
|
|
|
+ //校验是否可以加学员
|
|
|
+ checkAddStudent(calenderAddStudent,musicGroup);
|
|
|
}else {
|
|
|
- musicGroupPaymentBaseCalender.setPaymentType(ADD_COURSE);
|
|
|
+ if(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId() != null){
|
|
|
+ musicGroupPaymentBaseCalender.setPaymentType(MUSIC_RENEW);
|
|
|
+ }else {
|
|
|
+ musicGroupPaymentBaseCalender.setPaymentType(ADD_COURSE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
musicGroupPaymentBaseCalender.setMusicGroup(musicGroup);
|
|
@@ -594,7 +606,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
- MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentBaseCalender.getDeadlinePaymentDate());
|
|
|
musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
|
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
@@ -605,7 +616,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalender.setPaymentType(musicGroupPaymentBaseCalender.getPaymentType());
|
|
|
-// musicGroupPaymentCalender.setPaymentAmount(courseActualAmount);
|
|
|
musicGroupPaymentCalender.setCurrentTotalAmount(actualTotalAmount);
|
|
|
musicGroupPaymentCalender.setOriginalTotalAmount(originalTotalAmount);
|
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
@@ -679,10 +689,48 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(),new SysUserRoleEnum[]{ORGAN_MANAGER},
|
|
|
null,null,MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT,organization.getName(), musicGroup.getName());
|
|
|
+ }else {
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
+ addStudent(musicGroupPaymentCalender, musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList(),musicGroup);
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
+ this.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender,true);
|
|
|
+ // 学生加到班级
|
|
|
+ classGroupService.addStudentToClassGroupAndCourseArranging(calenderAddStudent.getStudentIds(), calenderAddStudent.getClassGroupIds(),
|
|
|
+ batchNo, musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList(),musicGroup);
|
|
|
+ ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
|
+ CompletableFuture.runAsync(()->{
|
|
|
+ imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
|
|
|
+ },executor);
|
|
|
+ executor.shutdown();
|
|
|
+ }
|
|
|
}
|
|
|
return batchNo;
|
|
|
}
|
|
|
|
|
|
+ //校验缴费项目进行中加学员
|
|
|
+ public void checkAddStudent(CalenderAddStudent calenderAddStudent,MusicGroup musicGroup){
|
|
|
+ //获取缴费状态在审核中或者已拒绝的缴费项目的学员
|
|
|
+ Integer userId = calenderAddStudent.getStudentIds();
|
|
|
+ if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
+ //该学员是否在其他的会员团
|
|
|
+ boolean hasMemberGroup = studentRegistrationDao.checkHasMemberGroup(musicGroup.getId(),userId);
|
|
|
+ if(hasMemberGroup){
|
|
|
+ throw new BizException("操作失败:学员已在其他系统收费乐团中,不可报名该乐团请联系教务老师");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String studentIds = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroup.getId(),null);
|
|
|
+ if(StringUtils.isNotEmpty(studentIds)){
|
|
|
+ if(studentIds.contains(userId.toString())){
|
|
|
+ throw new BizException("创建缴费失败:所选学员有待审核或已拒绝的缴费项目");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroup.getId());
|
|
|
+ if(musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0){
|
|
|
+ throw new BizException("创建缴费失败:已存在缴费项目");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public Map<String, Object> getCalenderDetail(Map<String, Object> result,Long calenderId){
|
|
|
//课程
|
|
|
result.put("course", musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(calenderId));
|