|
@@ -282,13 +282,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
|
|
|
case 1 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentMonthFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
case 6 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentHalfYearFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
case 12 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentYearFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
default:
|
|
|
throw new BizException("请选择正确的会员有效期");
|
|
@@ -392,10 +392,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
//校验缴费有效期冲突
|
|
|
if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
|
|
|
- int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
|
|
|
- musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
- if (count > 0) {
|
|
|
- throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
|
+ if(musicGroupPaymentCalender.getPaymentValidStartDate() != null){
|
|
|
+ int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
|
|
|
+ musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
+ if (count > 0) {
|
|
|
+ throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -580,6 +582,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
// musicGroupPaymentCalenderCourseSettingsList = new ArrayList<>();
|
|
|
// }
|
|
|
|
|
|
+ //会员原价
|
|
|
+ BigDecimal memberPaymentAmount = BigDecimal.ZERO;
|
|
|
if (payUserType == SCHOOL) {
|
|
|
status = AUDITING;
|
|
|
} else {
|
|
@@ -660,22 +664,21 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderStudentDetailDao.batchInsert(calenderStudentDetails,batchNo);
|
|
|
}
|
|
|
}
|
|
|
- if(status != AUDITING && musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
|
|
|
+ if(musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
|
|
|
//会员价格是否变动
|
|
|
MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), musicGroupPaymentCalenderDto.getMemberRankSettingId());
|
|
|
if(memberFee == null){
|
|
|
throw new BizException("操作失败:请配置当前分部会员收费标准");
|
|
|
}
|
|
|
- BigDecimal memberPaymentAmount;
|
|
|
switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
|
|
|
case 1 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentMonthFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
case 6 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentHalfYearFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
case 12 :
|
|
|
- memberPaymentAmount = memberFee.getCurrentYearFee();
|
|
|
+ memberPaymentAmount = memberFee.getCurrentYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
default:
|
|
|
throw new BizException("请选择正确的会员有效期");
|
|
@@ -704,12 +707,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
|
musicGroupPaymentCalender.setAttribute1(musicGroupPaymentCalenderDto.getAttribute1());
|
|
|
musicGroupPaymentCalender.setAttribute2(musicGroupPaymentCalenderDto.getAttribute2());
|
|
|
+ musicGroupPaymentCalender.setOriginalMemberPaymentAmount(memberPaymentAmount);
|
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentDateRange.getDeadlinePaymentDate());
|
|
|
musicGroupPaymentCalender.setIsGiveMusicNetwork(musicGroupPaymentCalenderDto.getIsGiveMusicNetwork());
|
|
|
musicGroupPaymentCalender.setMemo(musicGroupPaymentCalenderDto.getMemo());
|
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
|
musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId());
|
|
|
- BigDecimal totalPaymentAmount = musicGroupPaymentCalender.getMemberPaymentAmount();
|
|
|
+ BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMemberPaymentAmount();
|
|
|
if(musicGroupPaymentCalenderCourseSettingsList != null){
|
|
|
List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
|
|
|
musicGroupPaymentCalenderCourseSettingsList.size());
|
|
@@ -753,7 +757,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
|
|
|
-
|
|
|
musicGroupPaymentCalender.setPaymentPattern(musicGroupPaymentCalenderDto.getPaymentPattern());
|
|
|
musicGroupPaymentCalender.setPaymentValidEndDate(musicGroupPaymentDateRange.getPaymentValidEndDate());
|
|
|
musicGroupPaymentCalender.setPaymentValidStartDate(musicGroupPaymentDateRange.getPaymentValidStartDate());
|
|
@@ -781,10 +784,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
|
}
|
|
|
if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
|
|
|
- int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
|
|
|
- musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
- if (count > 0) {
|
|
|
- throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
|
+ if(musicGroupPaymentCalender.getPaymentValidStartDate() != null){
|
|
|
+ int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
|
|
|
+ musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
+ if (count > 0) {
|
|
|
+ throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -807,6 +812,11 @@ 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);
|
|
|
List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
|
|
|
.getMusicGroupPaymentCalenderCourseSettingsList();
|
|
@@ -987,7 +997,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
}
|
|
|
//如果是系统收费乐团
|
|
|
- if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
+ /*if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
//获取会员收费排课的课程
|
|
|
List<RemainCourseTypeDurationDto> durationDtos = courseScheduleDao.queryRemainCourseTypeDuration(musicGroupPaymentCalender.getAttribute1(), 1);
|
|
|
if(durationDtos != null && durationDtos.size() > 0){
|
|
@@ -1006,7 +1016,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
|
|
|
musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
if(musicGroupPaymentStudentCourseDetailList.size() > 0){
|
|
|
musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
|
|
|
}
|