|
@@ -91,8 +91,19 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
examRegistration.setStatus(StudentRegistrationStatusEnum.PAY_WAIT);
|
|
|
examRegistration.setLevelFee(examSubjectSong.getRegistrationFee());
|
|
|
examRegistration.setTheoryLevelFee(theoryLevelFee);
|
|
|
+ examRegistration.setCreateTime(nowDate);
|
|
|
+ examRegistration.setUpdateTime(nowDate);
|
|
|
examRegistrationDao.insert(examRegistration);
|
|
|
|
|
|
+ ExamRegistrationPayment examIngOrder = examRegistrationPaymentService.getExamIngOrder(examinationBasic.getId(), examRegistration.getSubjectId());
|
|
|
+ if (examIngOrder != null) {
|
|
|
+ examIngOrder.setTransStatus(TransStatusEnum.CLOSE);
|
|
|
+ examIngOrder.setMemo("用户主动放弃支付");
|
|
|
+ if (examRegistrationPaymentService.update(examIngOrder) <= 0) {
|
|
|
+ throw new BizException("未支付订单关闭失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ExamRegistrationPayment examRegistrationPayment = new ExamRegistrationPayment();
|
|
|
examRegistrationPayment.setTenantId(examinationBasic.getTenantId());
|
|
|
examRegistrationPayment.setExamRegistrationId(examRegistration.getId().longValue());
|
|
@@ -105,6 +116,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
examRegistrationPayment.setUpdateTime(nowDate);
|
|
|
examRegistrationPaymentService.insert(examRegistrationPayment);
|
|
|
|
|
|
+ HashMap<String, Object> rpMap = new HashMap<>();
|
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
Map<String, Object> payMap = payService.getPayMap(
|
|
|
amount,
|
|
@@ -117,7 +129,9 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
examRegistrationPayment.setTransNo((String) payMap.get("routingMerNos"));
|
|
|
examRegistrationPayment.setPayType((String) payMap.get("type"));
|
|
|
examRegistrationPaymentService.update(examRegistrationPayment);
|
|
|
- return payMap;
|
|
|
+ rpMap.put("examRegister", examRegistration);
|
|
|
+ rpMap.put("payMap", payMap);
|
|
|
+ return rpMap;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -135,13 +149,18 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = this.getDAO().queryPage(params);
|
|
|
- List<Integer> organIds = dataList.stream().map(ExamRegistration::getOrganId).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);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
List<Integer> subjectIds = dataList.stream().map(ExamRegistration::getSubjectId).collect(Collectors.toList());
|
|
|
Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
|
|
|
for (ExamRegistration examRegistration : dataList) {
|
|
|
- examRegistration.getOrganization().setName(organIdNameMap.get(examRegistration.getOrganId()));
|
|
|
- examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getStudentId()));
|
|
|
+ examRegistration.setOrganization(new Organization(examRegistration.getOrganId(), organIdNameMap.get(examRegistration.getOrganId())));
|
|
|
+ examRegistration.getSubject().setName(subjectIdNameMap.get(examRegistration.getSubjectId()));
|
|
|
+ examRegistration.setExaminationBasic(new ExaminationBasic(examRegistration.getExaminationBasicId(), examIdNameMap.get(examRegistration.getExaminationBasicId())));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -243,6 +262,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
if (examinationBasic == null || !examinationBasic.getStatus().equals(ExamStatusEnum.APPLYING)) {
|
|
|
throw new BizException("项目不在报名中,请核对");
|
|
|
}
|
|
|
+ Map<String, Object> rpMap = new HashMap<>();
|
|
|
String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
|
|
|
Map<String, Object> payMap = payService.getPayMap(
|
|
|
order.getTransAmount(),
|
|
@@ -255,6 +275,9 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
|
|
|
order.setTransNo((String) payMap.get("routingMerNos"));
|
|
|
order.setPayType((String) payMap.get("type"));
|
|
|
examRegistrationPaymentService.update(order);
|
|
|
- return payMap;
|
|
|
+ ExamRegistration examRegistration = examRegistrationDao.get(order.getExamRegistrationId());
|
|
|
+ rpMap.put("examRegister", examRegistration);
|
|
|
+ rpMap.put("payMap", payMap);
|
|
|
+ return rpMap;
|
|
|
}
|
|
|
}
|