|
@@ -74,11 +74,11 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
throw new BizException("请选择专业级别");
|
|
throw new BizException("请选择专业级别");
|
|
}
|
|
}
|
|
|
|
|
|
- if(examRegistration.getOrganId() == null){
|
|
|
|
|
|
+ if (examRegistration.getOrganId() == null) {
|
|
throw new BizException("机构id不能为空");
|
|
throw new BizException("机构id不能为空");
|
|
}
|
|
}
|
|
Organization organization = organizationDao.get(examRegistration.getOrganId());
|
|
Organization organization = organizationDao.get(examRegistration.getOrganId());
|
|
- if(organization == null){
|
|
|
|
|
|
+ if (organization == null) {
|
|
throw new BizException("机构不存在");
|
|
throw new BizException("机构不存在");
|
|
}
|
|
}
|
|
Date nowDate = new Date();
|
|
Date nowDate = new Date();
|
|
@@ -104,7 +104,6 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
examRegistration.setTheoryLevelFee(theoryLevelFee);
|
|
examRegistration.setTheoryLevelFee(theoryLevelFee);
|
|
examRegistration.setCreateTime(nowDate);
|
|
examRegistration.setCreateTime(nowDate);
|
|
examRegistration.setUpdateTime(nowDate);
|
|
examRegistration.setUpdateTime(nowDate);
|
|
- examRegistrationDao.insert(examRegistration);
|
|
|
|
|
|
|
|
ExamRegistrationPayment examIngOrder = examRegistrationPaymentService.getExamIngOrder(examinationBasic.getId(), examRegistration.getStudentId());
|
|
ExamRegistrationPayment examIngOrder = examRegistrationPaymentService.getExamIngOrder(examinationBasic.getId(), examRegistration.getStudentId());
|
|
if (examIngOrder != null) {
|
|
if (examIngOrder != null) {
|
|
@@ -113,6 +112,11 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
if (examRegistrationPaymentService.update(examIngOrder) <= 0) {
|
|
if (examRegistrationPaymentService.update(examIngOrder) <= 0) {
|
|
throw new BizException("未支付订单关闭失败");
|
|
throw new BizException("未支付订单关闭失败");
|
|
}
|
|
}
|
|
|
|
+ ExamRegistration examReg = examRegistrationDao.get(examIngOrder.getExamRegistrationId());
|
|
|
|
+ examRegistration.setId(examReg.getId());
|
|
|
|
+ examRegistrationDao.update(examRegistration);
|
|
|
|
+ } else {
|
|
|
|
+ examRegistrationDao.insert(examRegistration);
|
|
}
|
|
}
|
|
|
|
|
|
ExamRegistrationPayment examRegistrationPayment = new ExamRegistrationPayment();
|
|
ExamRegistrationPayment examRegistrationPayment = new ExamRegistrationPayment();
|
|
@@ -161,10 +165,10 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
pageInfo.setTotal(count);
|
|
pageInfo.setTotal(count);
|
|
params.put("offset", pageInfo.getOffset());
|
|
params.put("offset", pageInfo.getOffset());
|
|
dataList = this.getDAO().queryPage(params);
|
|
dataList = this.getDAO().queryPage(params);
|
|
- List<Integer> examIds = dataList.stream().filter(e->Objects.nonNull(e.getOrganId())).map(ExamRegistration::getExaminationBasicId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> examIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getExaminationBasicId).collect(Collectors.toList());
|
|
Map<Integer, String> examIdNameMap = this.getMap("examination_basic", "id_", "name_", examIds, Integer.class, String.class);
|
|
Map<Integer, String> examIdNameMap = this.getMap("examination_basic", "id_", "name_", examIds, Integer.class, String.class);
|
|
|
|
|
|
- List<Integer> organIds = dataList.stream().filter(e->Objects.nonNull(e.getOrganId())).map(ExamRegistration::getOrganId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> organIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getOrganId).collect(Collectors.toList());
|
|
Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
|
|
Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
|
|
|
|
|
|
List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
@@ -252,18 +256,18 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void updateExamRegistration(ExamRegistration examRegistration) {
|
|
public void updateExamRegistration(ExamRegistration examRegistration) {
|
|
- if(Objects.isNull(examRegistration.getId())){
|
|
|
|
|
|
+ if (Objects.isNull(examRegistration.getId())) {
|
|
throw new BizException("请指定学员报名信息");
|
|
throw new BizException("请指定学员报名信息");
|
|
}
|
|
}
|
|
ExamRegistration er = examRegistrationDao.get(examRegistration.getId().longValue());
|
|
ExamRegistration er = examRegistrationDao.get(examRegistration.getId().longValue());
|
|
- if(Objects.isNull(er)) {
|
|
|
|
|
|
+ if (Objects.isNull(er)) {
|
|
throw new BizException("学员报名信息不存在");
|
|
throw new BizException("学员报名信息不存在");
|
|
}
|
|
}
|
|
- if(!StudentRegistrationStatusEnum.AUDIT_WAIT.equals(er.getStatus())){
|
|
|
|
|
|
+ if (!StudentRegistrationStatusEnum.AUDIT_WAIT.equals(er.getStatus())) {
|
|
throw new BizException("审核状态错误");
|
|
throw new BizException("审核状态错误");
|
|
}
|
|
}
|
|
- if(!StudentRegistrationStatusEnum.AUDIT_PASS.equals(examRegistration.getStatus())
|
|
|
|
- &&!StudentRegistrationStatusEnum.AUDIT_REJECT.equals(examRegistration.getStatus())){
|
|
|
|
|
|
+ if (!StudentRegistrationStatusEnum.AUDIT_PASS.equals(examRegistration.getStatus())
|
|
|
|
+ && !StudentRegistrationStatusEnum.AUDIT_REJECT.equals(examRegistration.getStatus())) {
|
|
throw new BizException("审核状态错误");
|
|
throw new BizException("审核状态错误");
|
|
}
|
|
}
|
|
examRegistrationDao.update(examRegistration);
|
|
examRegistrationDao.update(examRegistration);
|