|
@@ -209,6 +209,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
private StudentVisitDao studentVisitDao;
|
|
|
@Autowired
|
|
|
private SubjectDao subjectDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentPreRegistrationDao studentPreRegistrationDao;
|
|
|
|
|
|
private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
@@ -338,6 +341,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public boolean preRegister(StudentPreRegistration studentPreRegistration) {
|
|
|
+ Integer userId = studentPreRegistration.getUserId();
|
|
|
+
|
|
|
+ String musicGroupId = studentPreRegistration.getMusicGroupId();
|
|
|
+
|
|
|
+ //查询乐团状态
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ if(musicGroup == null){
|
|
|
+ throw new BizException("乐团信息查询失败");
|
|
|
+ }
|
|
|
+ if(musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY){
|
|
|
+ throw new BizException("乐团当前状态不能预报名");
|
|
|
+ }
|
|
|
+
|
|
|
+ StudentPreRegistration originRegistration = studentPreRegistrationDao.queryByUserId(userId, musicGroupId);
|
|
|
+ if(originRegistration != null){
|
|
|
+ throw new BizException("您已预报名成功,请勿重复提交资料");
|
|
|
+ }
|
|
|
+ Date date = new Date();
|
|
|
+
|
|
|
+ studentPreRegistration.setCreateTime(date);
|
|
|
+
|
|
|
+ studentPreRegistrationDao.update(studentPreRegistration);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map sporadicPay(SporadicPayDto sporadicPayDto) throws Exception {
|
|
|
//获取收费项价格
|
|
@@ -1125,8 +1156,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
MusicGroup musicGroup = saveLog(musicGroupId, MusicGroupStatusEnum.AUDIT);
|
|
|
//记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 报名中)", sysUser.getId(), ""));
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
|
|
|
musicGroupDao.update(musicGroup);
|
|
|
//获取报名缴费项目
|
|
|
MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
|
|
@@ -1449,7 +1480,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
|
|
|
- throw new BizException("乐团当前状态是{},不能延长缴费", musicGroup.getStatus().getMsg());
|
|
|
+ throw new BizException("乐团当前状态是[{}],不能延长缴费", musicGroup.getStatus().getMsg());
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
@@ -1492,8 +1523,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
throw new BizException("乐团找不到");
|
|
|
}
|
|
|
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY && musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
|
|
|
- throw new BizException("乐团当前状态是{},不能延长报名", musicGroup.getStatus().getMsg());
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY || musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
|
|
|
+ throw new BizException("乐团当前状态是[{}],不能延长报名", musicGroup.getStatus().getMsg());
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
@@ -1510,6 +1541,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public boolean extensionPreApplyExpireDate(String musicGroupId, Date expireDate) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ if (musicGroup == null) {
|
|
|
+ throw new BizException("乐团找不到");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
|
|
|
+ throw new BizException("乐团当前状态是[{}],不能延长预报名", musicGroup.getStatus().getMsg());
|
|
|
+ }
|
|
|
+
|
|
|
+ Date date = new Date();
|
|
|
+
|
|
|
+ if (date.after(expireDate)) {
|
|
|
+ throw new BizException("日期设置错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ musicGroup.setPreApplyExpireDate(expireDate);
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "延长预报名时间", sysUser.getId(), ""));
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public boolean applyQuitMusicGroup(String musicGroupId, String reason) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|