|
@@ -1002,7 +1002,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if(StringUtils.isNotEmpty(studentIds)){
|
|
|
SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(studentIds));
|
|
|
calenderAuditDetailDto.setPhone(sysUser.getPhone());
|
|
|
- calenderAuditDetailDto.setPhone(sysUser.getUsername());
|
|
|
+ calenderAuditDetailDto.setUsername(sysUser.getUsername());
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -1081,111 +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);
|
|
|
}
|
|
|
- for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
- //将0元未缴费学员缴费状态更新为已缴费
|
|
|
- int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
|
|
|
- musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
|
|
|
- }
|
|
|
- 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);
|
|
|
}
|
|
|
|
|
|
//推送待续费通知
|