|
@@ -612,27 +612,39 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void auditPass(Long calenderId,String auditMemo) {
|
|
|
- MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
|
- Date date = new Date();
|
|
|
- //如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
|
- 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);
|
|
|
+ public void auditPass(String batchNo,String auditMemo) {
|
|
|
+ List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
+ if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
|
|
|
+ throw new BizException("缴费项目不存在");
|
|
|
}
|
|
|
- musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
- musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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 (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- int count = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),calenderId);
|
|
|
+ if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
+ //统计乐团还在审核中或者审核被拒的缴费
|
|
|
+ int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
|
|
|
if(count == 0){
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
musicGroup.setUpdateTime(date);
|
|
|
musicGroupDao.update(musicGroup);
|
|
@@ -646,35 +658,38 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
|
|
|
}
|
|
|
- }else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
- musicGroupPaymentCalender.setExpectNum(1);
|
|
|
- List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
|
|
|
- addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
|
|
|
}
|
|
|
- musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
+ musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void auditRefuse(Long calenderId,String auditMemo) {
|
|
|
- MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
|
+ public void auditRefuse(String batchNo,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("缴费项目不存在");
|
|
|
+ }
|
|
|
Date date = new Date();
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
|
- musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
- musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
- musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
|
|
|
+ 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.DRAFT);
|
|
|
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(), ""));
|
|
|
}
|
|
|
+ musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
}
|
|
|
|
|
|
//推送待续费通知
|