|
@@ -2,8 +2,7 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_COURSE;
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_STUDENT;
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
|
|
@@ -26,6 +25,7 @@ import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.service.*;
|
|
@@ -46,25 +46,11 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
|
|
|
-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;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
|
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.MusicGroupPaymentCalenderStudentDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
|
|
|
-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.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
|
|
@@ -433,6 +419,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
Set<Integer> list2 = Arrays.stream(ints).boxed().collect(Collectors.toSet());
|
|
|
musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender.getId(),list2);
|
|
|
}
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
+ int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
|
|
|
+ musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
|
|
|
+ musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -744,6 +734,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
//如果是跨团班级合并,添加学员
|
|
|
musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails());
|
|
|
}
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
+ int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
|
|
|
+ musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
|
|
|
+ musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
}
|
|
|
|
|
|
if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
|
|
@@ -832,6 +826,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
|
|
|
//如果是进行中加学生
|
|
|
Date date = new Date();
|
|
@@ -859,6 +855,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
|
|
|
|
|
|
musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
|
|
|
+ //如果是0元那么更新fee表和studentRegistration表
|
|
|
+ if(totalPrice.doubleValue() == 0d){
|
|
|
+ MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
|
|
|
+ if (musicGroupStudentFee != null) {
|
|
|
+ musicGroupStudentFee.setUpdateTime(date);
|
|
|
+ musicGroupStudentFee.setLatestPaidTime(date);
|
|
|
+ musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
+ musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
|
|
|
+ musicGroupStudentFeeDao.update(musicGroupStudentFee);
|
|
|
+ }
|
|
|
+ //如果是进行中加学员
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
|
|
|
+ studentRegistration.setPaymentStatus(YES);
|
|
|
+ studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
+ studentRegistrationDao.update(studentRegistration);
|
|
|
+ }
|
|
|
|
|
|
// 学生加课程明细
|
|
|
for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
|
|
@@ -980,11 +992,24 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
MusicGroupPaymentCalenderAuditDetailDto calenderAuditDetailDto = new MusicGroupPaymentCalenderAuditDetailDto();
|
|
|
MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(batchNo);
|
|
|
calenderAuditDetailDto.setAuditDto(auditDto);
|
|
|
- //获取收费标准
|
|
|
- calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
//获取缴费周期
|
|
|
List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
|
|
|
+ MusicGroupPaymentCalender paymentCalender = groupPaymentCalenders.get(0);
|
|
|
+ if(paymentCalender.getPaymentType() == ADD_STUDENT){
|
|
|
+ try {
|
|
|
+ String studentIds = groupPaymentCalenders.get(0).getStudentIds();
|
|
|
+ if(StringUtils.isNotEmpty(studentIds)){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(studentIds));
|
|
|
+ calenderAuditDetailDto.setPhone(sysUser.getPhone());
|
|
|
+ calenderAuditDetailDto.setUsername(sysUser.getUsername());
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //获取收费标准
|
|
|
+ calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
//获取跨团合班学员缴费详情
|
|
|
calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
|
return calenderAuditDetailDto;
|
|
@@ -1056,106 +1081,118 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void auditPass(String batchNo,String auditMemo) {
|
|
|
- List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
- if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
|
|
|
- throw new BizException("缴费项目不存在");
|
|
|
- }
|
|
|
+ public void auditPass(String batchNs,String auditMemo) {
|
|
|
+ String[] split = batchNs.split(",");
|
|
|
Date date = new Date();
|
|
|
- for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
- //如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
|
- if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
- }else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
- }else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
- }else {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
+ for (String batchNo : split) {
|
|
|
+ List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
+ if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
|
|
|
+ throw new BizException("缴费项目不存在");
|
|
|
}
|
|
|
- musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
- musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
+ for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
+ //如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
|
+ if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
+ }else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
+ }else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
+ }else {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
+ }
|
|
|
+ musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
+ musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
- musicGroupPaymentCalender.setExpectNum(1);
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
- addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
|
|
|
- }
|
|
|
- }
|
|
|
- MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
|
- //如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
- if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- //统计乐团还在审核中或者审核被拒的缴费
|
|
|
- int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
|
|
|
- if(count == 0){
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
|
- musicGroup.setUpdateTime(date);
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null || sysUser.getId() == null){
|
|
|
- throw new BizException("请重新登录");
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
+ musicGroupPaymentCalender.setExpectNum(1);
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
|
|
|
+ addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
|
|
|
}
|
|
|
- //记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
|
|
|
}
|
|
|
- } else if (calender.getPaymentType() == ADD_STUDENT) {
|
|
|
- // 学生加到班级
|
|
|
- String classGroupIdStr = calender.getAttribute1();
|
|
|
- if (StringUtils.isNotBlank(classGroupIdStr)) {
|
|
|
- classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
|
- musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
+ MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
|
+ //如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
+ if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
+ //统计乐团还在审核中或者审核被拒的缴费
|
|
|
+ int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
|
|
|
+ if(count == 0){
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null || sysUser.getId() == null){
|
|
|
+ throw new BizException("请重新登录");
|
|
|
+ }
|
|
|
+ //记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
|
|
|
+ }
|
|
|
+ } else if (calender.getPaymentType() == ADD_STUDENT) {
|
|
|
+ // 学生加到班级
|
|
|
+ String classGroupIdStr = calender.getAttribute1();
|
|
|
+ if (StringUtils.isNotBlank(classGroupIdStr)) {
|
|
|
+ classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
|
+ musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
|
|
|
+ }
|
|
|
+ MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
+ if(musicGroupStudentClassAdjust != null){
|
|
|
+ //如果是合班缴费
|
|
|
+ autoClassGroupAdjust(musicGroupStudentClassAdjust);
|
|
|
+ }else {
|
|
|
+ imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
|
|
|
+ }
|
|
|
+ }else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
|
|
|
+ //删除和解冻班级,课程信息
|
|
|
+ MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
+ List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
|
|
|
+ List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
|
|
|
+ List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
|
+ List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
|
+ //如果是跨团班级合并,添加学员
|
|
|
+ musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
|
+ classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
|
|
|
+ ,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
|
|
|
}
|
|
|
- MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
- if(musicGroupStudentClassAdjust != null){
|
|
|
- //如果是合班缴费
|
|
|
- autoClassGroupAdjust(musicGroupStudentClassAdjust);
|
|
|
- }else {
|
|
|
- imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
|
|
|
+ for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
+ int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
|
|
|
+ musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
|
|
|
}
|
|
|
- }else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
|
|
|
- //删除和解冻班级,课程信息
|
|
|
- MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
- List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
|
|
|
- List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
|
|
|
- List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
|
- List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
|
- //如果是跨团班级合并,添加学员
|
|
|
- musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
|
|
|
- classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
|
|
|
- ,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
|
|
|
+ musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
}
|
|
|
- musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void auditRefuse(String batchNo,String auditMemo) {
|
|
|
+ public void auditRefuse(String batchNs,String auditMemo) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if(sysUser == null || sysUser.getId() == null){
|
|
|
throw new BizException("请重新登录");
|
|
|
}
|
|
|
- List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
- if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
|
|
|
- throw new BizException("缴费项目不存在");
|
|
|
- }
|
|
|
+ String[] split = batchNs.split(",");
|
|
|
Date date = new Date();
|
|
|
- for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
|
- musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
- musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
- }
|
|
|
- MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
|
- //如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
- if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
|
- musicGroup.setUpdateTime(date);
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
- //记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
|
|
|
+ for (String batchNo : split) {
|
|
|
+ List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
+ if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
|
|
|
+ throw new BizException("缴费项目不存在");
|
|
|
+ }
|
|
|
+ for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
|
+ musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
+ musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
+ }
|
|
|
+ MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
|
+ //如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
+ if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
+ //记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
|
|
|
+ }
|
|
|
+ musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
}
|
|
|
- musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
}
|
|
|
|
|
|
//推送待续费通知
|
|
@@ -1218,6 +1255,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
// “未开始”更新至“进行中”
|
|
|
mgpc.setUpdateTime(date);
|
|
|
mgpc.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
+ int i = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(mgpc.getId());
|
|
|
+ mgpc.setActualNum((mgpc.getActualNum()==null?0:mgpc.getActualNum()) + i);
|
|
|
updateMusicGroupPaymentCalenderList.add(mgpc);
|
|
|
if(mgpc.getPayUserType() == STUDENT){
|
|
|
//推送待续费通知
|