|
@@ -26,6 +26,7 @@ import org.apache.commons.beanutils.BeanUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -49,6 +50,9 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
|
+import org.springframework.util.Assert;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
|
|
public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
|
|
@@ -59,46 +63,32 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
|
|
|
|
-
|
|
|
|
|
|
+ private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
|
|
private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
|
|
private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
|
|
private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
|
|
private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupSchoolTermStudentCourseDetailDao musicGroupSchoolTermStudentCourseDetailDao;
|
|
private MusicGroupSchoolTermStudentCourseDetailDao musicGroupSchoolTermStudentCourseDetailDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IdGeneratorService idGeneratorService;
|
|
private IdGeneratorService idGeneratorService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ClassGroupService classGroupService;
|
|
private ClassGroupService classGroupService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupDao musicGroupDao;
|
|
private MusicGroupDao musicGroupDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ClassGroupDao classGroupDao;
|
|
private ClassGroupDao classGroupDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CourseScheduleDao courseScheduleDao;
|
|
private CourseScheduleDao courseScheduleDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
|
|
private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private TeacherAttendanceDao teacherAttendanceDao;
|
|
private TeacherAttendanceDao teacherAttendanceDao;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -127,7 +117,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
@Autowired
|
|
@Autowired
|
|
private GroupEventSource groupEventSource;
|
|
private GroupEventSource groupEventSource;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
private StudentPaymentOrderDao studentPaymentOrderDao;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -139,7 +128,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
@Autowired
|
|
@Autowired
|
|
private CloudTeacherOrderDao cloudTeacherOrderDao;
|
|
private CloudTeacherOrderDao cloudTeacherOrderDao;
|
|
@Autowired
|
|
@Autowired
|
|
- private MusicGroupPaymentCalenderBaseService musicGroupPaymentCalenderBaseService;
|
|
|
|
|
|
+ private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
|
|
|
|
+ @Resource(name = "musicRepairService")
|
|
|
|
+ private MusicGroupPaymentCalenderBaseService musicRepairService;
|
|
|
|
+ @Resource(name = "memberCalenderService")
|
|
|
|
+ private MusicGroupPaymentCalenderBaseService memberCalenderService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
|
|
public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
|
|
@@ -462,20 +455,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
|
|
|
|
//课程费用列表
|
|
//课程费用列表
|
|
- List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
|
|
|
|
- .getMusicGroupPaymentCalenderCourseSettingsList();
|
|
|
|
-
|
|
|
|
- if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
|
|
|
|
- MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
|
|
|
|
- .getMusicGroupOrganizationCourseSettingId());
|
|
|
|
- for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
- if (courseSettings != null) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
|
- }
|
|
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
|
|
|
|
|
|
//如果是跨团班级合并,保存用户缴费详情
|
|
//如果是跨团班级合并,保存用户缴费详情
|
|
List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
|
|
List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
|
|
@@ -488,7 +468,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
// 如果是进行中加学生
|
|
// 如果是进行中加学生
|
|
if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
- addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings,musicGroup);
|
|
|
|
|
|
+ addStudent(musicGroupPaymentCalender, musicGroupPaymentCalender
|
|
|
|
+ .getMusicGroupPaymentCalenderCourseSettingsList(),musicGroup);
|
|
}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
|
|
}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
|
|
//如果是跨团班级合并,添加学员
|
|
//如果是跨团班级合并,添加学员
|
|
musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
|
|
musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
|
|
@@ -544,13 +525,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
|
|
public String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
|
|
|
|
+ if(musicGroupPaymentBaseCalender == null){
|
|
|
|
+ throw new BizException("参数校验异常");
|
|
|
|
+ }
|
|
|
|
+ if(musicGroupPaymentBaseCalender.getCalenderActivityList() == null
|
|
|
|
+ && musicGroupPaymentBaseCalender.getCalenderMember() == null
|
|
|
|
+ && musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList() == null
|
|
|
|
+ && musicGroupPaymentBaseCalender.getMusicRepair() == null){
|
|
|
|
+ throw new BizException("请选择一个缴费项目");
|
|
|
|
+ }
|
|
|
|
|
|
String musicGroupId = musicGroupPaymentBaseCalender.getMusicGroupId();
|
|
String musicGroupId = musicGroupPaymentBaseCalender.getMusicGroupId();
|
|
-
|
|
|
|
- PaymentType paymentType = musicGroupPaymentBaseCalender.getPaymentType();
|
|
|
|
-
|
|
|
|
- PayUserType payUserType = musicGroupPaymentBaseCalender.getPayUserType();
|
|
|
|
-
|
|
|
|
MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
|
|
MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
|
|
if (musicGroup == null) {
|
|
if (musicGroup == null) {
|
|
throw new BizException("乐团查询失败,请检查参数");
|
|
throw new BizException("乐团查询失败,请检查参数");
|
|
@@ -584,95 +569,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
String batchNo = idGeneratorService.generatorId() + "";
|
|
String batchNo = idGeneratorService.generatorId() + "";
|
|
|
|
|
|
- // 获取设置的课程收费标准
|
|
|
|
-// List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
|
|
|
|
-
|
|
|
|
- //会员原价
|
|
|
|
-// BigDecimal memberPaymentAmount = BigDecimal.ZERO;
|
|
|
|
BigDecimal originalMemberPaymentAmount = BigDecimal.ZERO;
|
|
BigDecimal originalMemberPaymentAmount = BigDecimal.ZERO;
|
|
- if (payUserType == SCHOOL) {
|
|
|
|
|
|
+ if (musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL) {
|
|
status = AUDITING;
|
|
status = AUDITING;
|
|
} else {
|
|
} else {
|
|
- status = musicGroupPaymentCalenderBaseService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
|
-// if(musicGroupPaymentCalenderCourseSettingsList != null){
|
|
|
|
-// if (paymentType == MUSIC_APPLY || paymentType == MUSIC_RENEW) {
|
|
|
|
-// // 当前缴费的课程费用
|
|
|
|
-// Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
|
|
|
|
-// Collectors
|
|
|
|
-// .toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
|
|
|
|
-//
|
|
|
|
-// // 查询默认课程费用
|
|
|
|
-// Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId();
|
|
|
|
-// Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
|
|
|
|
-// .queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
|
|
|
|
-// .stream()
|
|
|
|
-// .collect(
|
|
|
|
-// Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
|
|
|
|
-// MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
|
|
|
|
-//
|
|
|
|
-// // 相同类型的课程如果修改了课程费用,需要走审批
|
|
|
|
-// for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
|
|
|
|
-// if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
|
|
|
|
-// status = AUDITING;
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// } else if (paymentType == PaymentType.ADD_COURSE || paymentType == PaymentType.ADD_STUDENT) {
|
|
|
|
-// PaymentCalenderStatusEnum dtoStatus = musicGroupPaymentCalenderDto.getStatus();
|
|
|
|
-// if(dtoStatus != null && dtoStatus == AUDITING){
|
|
|
|
-// status = AUDITING;
|
|
|
|
-// }else {
|
|
|
|
-// // 如果是课程收费,判断是否审核
|
|
|
|
-// for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
|
-// OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
|
|
|
|
-// musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
|
|
|
|
-// if (defaultUnitPrice == null) {
|
|
|
|
-// throw new BizException("请先设置分部课程类型单价");
|
|
|
|
-// }
|
|
|
|
-// if (courseSettings.getCourseTotalMinuties() != 0) {
|
|
|
|
-//
|
|
|
|
-// if (defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties())).setScale(0, BigDecimal.ROUND_HALF_UP)
|
|
|
|
-// .compareTo(courseSettings.getCourseCurrentPrice()) != 0) {
|
|
|
|
-//
|
|
|
|
-// status = AUDITING;
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
-// } else {
|
|
|
|
-// status = AUDITING;
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
|
|
|
|
-// status = musicGroupPaymentCalenderDto.getStatus();
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// if(musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
|
|
|
|
-// //会员价格是否变动
|
|
|
|
-// MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), musicGroupPaymentCalenderDto.getMemberRankSettingId());
|
|
|
|
-// if(memberFee == null){
|
|
|
|
-// throw new BizException("操作失败:请配置当前分部会员收费标准");
|
|
|
|
-// }
|
|
|
|
-// switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
|
|
|
|
-// case 1 :
|
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// break;
|
|
|
|
-// case 6 :
|
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// break;
|
|
|
|
-// case 12 :
|
|
|
|
-// memberPaymentAmount = memberFee.getGroupPurchaseYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// originalMemberPaymentAmount = memberFee.getOriginalYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-// break;
|
|
|
|
-// default:
|
|
|
|
-// throw new BizException("请选择正确的会员有效期");
|
|
|
|
-// }
|
|
|
|
-// if(memberPaymentAmount.compareTo(musicGroupPaymentCalenderDto.getMemberPaymentAmount()) != 0){
|
|
|
|
-// status = AUDITING;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ status = memberCalenderService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
|
+ if(status != AUDITING){
|
|
|
|
+ status = ((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
|
+ }
|
|
|
|
+ if(status != AUDITING){
|
|
|
|
+ status = musicRepairService.checkComponentAmount(musicGroupPaymentBaseCalender);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
@@ -681,29 +588,38 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
|
|
musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId());
|
|
musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId());
|
|
- BigDecimal totalPaymentAmount = BigDecimal.ZERO;
|
|
|
|
musicGroupPaymentCalender.setPayUserType(musicGroupPaymentBaseCalender.getPayUserType());
|
|
musicGroupPaymentCalender.setPayUserType(musicGroupPaymentBaseCalender.getPayUserType());
|
|
musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentBaseCalender.getStartPaymentDate());
|
|
musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentBaseCalender.getStartPaymentDate());
|
|
musicGroupPaymentCalender.setOperator(sysUser.getId());
|
|
musicGroupPaymentCalender.setOperator(sysUser.getId());
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
|
|
+ musicGroupPaymentCalender.setPaymentType(musicGroupPaymentBaseCalender.getPaymentType());
|
|
|
|
+
|
|
|
|
+ BigDecimal totalPaymentAmount = BigDecimal.ZERO;
|
|
|
|
+ totalPaymentAmount = totalPaymentAmount.add(memberCalenderService.getActualAmount(musicGroupPaymentBaseCalender));
|
|
|
|
+ totalPaymentAmount = totalPaymentAmount.add(((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).getActualAmount(musicGroupPaymentBaseCalender));
|
|
|
|
+ totalPaymentAmount = totalPaymentAmount.add(musicRepairService.getActualAmount(musicGroupPaymentBaseCalender));
|
|
|
|
+ totalPaymentAmount = totalPaymentAmount.add(((MusicGroupPaymentCalenderActivityServiceImpl)musicGroupPaymentCalenderActivityService).getActualAmount(musicGroupPaymentBaseCalender));
|
|
|
|
+ musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
|
|
|
|
+
|
|
|
|
+ //会员缴费信息
|
|
CalenderMemberDto calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
|
|
CalenderMemberDto calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
|
|
if(calenderMember != null){
|
|
if(calenderMember != null){
|
|
//设置会员缴费金额、级别以及有效期
|
|
//设置会员缴费金额、级别以及有效期
|
|
- totalPaymentAmount.add(calenderMember.getActualAmount());
|
|
|
|
musicGroupPaymentCalender.setMemberPaymentAmount(calenderMember.getActualAmount());
|
|
musicGroupPaymentCalender.setMemberPaymentAmount(calenderMember.getActualAmount());
|
|
musicGroupPaymentCalender.setMemberRankSettingId(calenderMember.getMemberRankSettingId());
|
|
musicGroupPaymentCalender.setMemberRankSettingId(calenderMember.getMemberRankSettingId());
|
|
musicGroupPaymentCalender.setMemberValidDate(calenderMember.getMemberNum());
|
|
musicGroupPaymentCalender.setMemberValidDate(calenderMember.getMemberNum());
|
|
musicGroupPaymentCalender.setMemberPeriod(calenderMember.getPeriodEnum());
|
|
musicGroupPaymentCalender.setMemberPeriod(calenderMember.getPeriodEnum());
|
|
|
|
+ musicGroupPaymentCalender.setMemberOptionalFlag(calenderMember.getOptionalFlag());
|
|
}
|
|
}
|
|
- //课程费用列表
|
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
|
|
|
|
- .getMusicGroupPaymentCalenderCourseSettingsList();
|
|
|
|
- if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
|
|
|
|
- totalPaymentAmount.add(currentMusicGroupPaymentCalenderCourseSettings.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
|
|
|
+ //乐保缴费信息
|
|
|
|
+ MusicRepairDto musicRepair = musicGroupPaymentBaseCalender.getMusicRepair();
|
|
|
|
+ if(musicRepair != null){
|
|
|
|
+ musicGroupPaymentCalender.setMusicRepairNum(musicRepair.getNum());
|
|
|
|
+ musicGroupPaymentCalender.setMusicRepairActualPrice(musicRepair.getActualAmount());
|
|
|
|
+ musicGroupPaymentCalender.setMusicRepairOptionalFlag(musicRepair.getOptionalFlag());
|
|
}
|
|
}
|
|
- musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
|
|
|
|
|
|
|
|
// BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
|
|
// BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
|
|
// if(musicGroupPaymentCalenderCourseSettingsList != null){
|
|
// if(musicGroupPaymentCalenderCourseSettingsList != null){
|
|
@@ -732,9 +648,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
// }
|
|
// }
|
|
|
|
|
|
//缴费截止日期默认三天后
|
|
//缴费截止日期默认三天后
|
|
- if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
|
|
|
|
- musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
|
|
- }
|
|
|
|
|
|
+// if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
|
|
|
|
+// musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
|
|
+// }
|
|
|
|
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
@@ -750,20 +666,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
|
|
|
|
- if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
|
|
|
|
- MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
|
|
|
|
- .getMusicGroupOrganizationCourseSettingId());
|
|
|
|
- for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
- if (courseSettings != null) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
|
- }
|
|
|
|
|
|
+ //课程费用列表
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
|
|
|
|
+ //活动费用列表
|
|
|
|
+ musicGroupPaymentCalenderActivityService.batchInsert(musicGroupPaymentBaseCalender,musicGroupPaymentCalender.getId());
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
// 如果是报名,需要修改乐团状态
|
|
- if (paymentType == MUSIC_APPLY) {
|
|
|
|
|
|
+ if (musicGroupPaymentBaseCalender.getPaymentType() == MUSIC_APPLY) {
|
|
if (status != AUDITING) {
|
|
if (status != AUDITING) {
|
|
musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
// 记录操作日志
|
|
// 记录操作日志
|
|
@@ -797,7 +706,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
|
|
BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
|
|
//收费标准名称
|
|
//收费标准名称
|
|
String name = musicGroupPaymentCalenderDao.getCalenderSettingsName(id);
|
|
String name = musicGroupPaymentCalenderDao.getCalenderSettingsName(id);
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(id);
|
|
|
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(id);
|
|
Map<String, Object> result = new HashMap<>(4);
|
|
Map<String, Object> result = new HashMap<>(4);
|
|
result.put("musicGroupPaymentCalenderCourseSettings", musicGroupPaymentCalenderCourseSettings);
|
|
result.put("musicGroupPaymentCalenderCourseSettings", musicGroupPaymentCalenderCourseSettings);
|
|
if(calender.getMemberRankSettingId() != null){
|
|
if(calender.getMemberRankSettingId() != null){
|
|
@@ -859,7 +768,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
List<Long> calenderIds = musicGroupPaymentCalenderList.stream().map(MusicGroupPaymentCalender :: getId).collect(Collectors.toList());
|
|
List<Long> calenderIds = musicGroupPaymentCalenderList.stream().map(MusicGroupPaymentCalender :: getId).collect(Collectors.toList());
|
|
//删除原来数据
|
|
//删除原来数据
|
|
musicGroupPaymentCalenderDao.delByIds(calenderIds);
|
|
musicGroupPaymentCalenderDao.delByIds(calenderIds);
|
|
- musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
status = PaymentCalenderStatusEnum.NO;
|
|
status = PaymentCalenderStatusEnum.NO;
|
|
|
|
|
|
@@ -1131,17 +1040,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
}
|
|
}
|
|
|
|
|
|
- if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
|
|
|
|
- MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
|
|
|
|
- .getMusicGroupOrganizationCourseSettingId());
|
|
|
|
- for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
- if (courseSettings != null) {
|
|
|
|
- musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
|
|
|
|
- }
|
|
|
|
|
|
+ //课程费用列表
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
|
|
}
|
|
}
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
// 如果是报名,需要修改乐团状态
|
|
@@ -1457,7 +1357,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//获取收费标准
|
|
//获取收费标准
|
|
- calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
|
|
|
+ calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
//获取跨团合班学员缴费详情
|
|
//获取跨团合班学员缴费详情
|
|
calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
return calenderAuditDetailDto;
|
|
return calenderAuditDetailDto;
|
|
@@ -1561,7 +1461,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
musicGroupPaymentCalender.setExpectNum(1);
|
|
musicGroupPaymentCalender.setExpectNum(1);
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings,musicGroup);
|
|
addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings,musicGroup);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1609,7 +1509,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
String classGroupIdStr = calender.getAttribute1();
|
|
String classGroupIdStr = calender.getAttribute1();
|
|
if (StringUtils.isNotBlank(classGroupIdStr)) {
|
|
if (StringUtils.isNotBlank(classGroupIdStr)) {
|
|
classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
- musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
|
|
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
|
|
}
|
|
}
|
|
MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
if(musicGroupStudentClassAdjust != null){
|
|
if(musicGroupStudentClassAdjust != null){
|
|
@@ -1835,7 +1735,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
List<Long> calenderIds = new ArrayList<Long>();
|
|
List<Long> calenderIds = new ArrayList<Long>();
|
|
calenderIds.add(id);
|
|
calenderIds.add(id);
|
|
- musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
+ musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
|
|
|
//如果乐团是“费用审核”,则需要修改状态
|
|
//如果乐团是“费用审核”,则需要修改状态
|
|
MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|