|
@@ -29,6 +29,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -55,6 +56,9 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
|
|
|
@Autowired
|
|
|
private DegreeService degreeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SubjectService subjectService;
|
|
|
+
|
|
|
@Override
|
|
|
public BaseDAO<Integer, DegreeRegistration> getDAO() {
|
|
|
return degreeRegistrationDao;
|
|
@@ -111,7 +115,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
|
|
|
if(money.compareTo(degreeRegistration.getPrice())!=0){
|
|
|
throw new BizException("商品价格不符");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Integer userId = degreeRegistration.getUserId();
|
|
|
String channelType = "";
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
@@ -120,7 +124,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
|
|
|
studentPaymentOrder.setOrderNo(orderNo);
|
|
|
studentPaymentOrder.setType(OrderTypeEnum.DEGREE_REGISTRATION);
|
|
|
studentPaymentOrder.setExpectAmount(money);
|
|
|
-
|
|
|
+
|
|
|
if(degreeRegistration.isUseBalance()){
|
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
|
if (userCashAccount == null) {
|
|
@@ -262,6 +266,24 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
|
|
|
degreeRegistration.setVipTeacherName(vipTeacherMapper.get(degreeRegistration.getUserId()));
|
|
|
degreeRegistration.setNormalTeacherName(teacherMapper.get(degreeRegistration.getUserId()));
|
|
|
}
|
|
|
+ // 设置声部
|
|
|
+ Set<Integer> subjectIdSet = dataList.stream().map(o -> o.getSubjectId()).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ List<Subject> subjectList = subjectService.findBySubjectByIdList(new ArrayList<>(subjectIdSet));
|
|
|
+
|
|
|
+ // id 分组
|
|
|
+ Map<Integer, Subject> subjectMap = subjectList.stream().collect(Collectors.toMap(Subject::getId, Function.identity()));
|
|
|
+ for (DegreeRegistration degreeRegistration : dataList) {
|
|
|
+ if (degreeRegistration.getSubjectId() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Subject subject = subjectMap.get(degreeRegistration.getSubjectId());
|
|
|
+ if (subject != null) {
|
|
|
+ degreeRegistration.setSubjectName(subject.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
DegreeRegistration degree = degreeRegistrationDao.getTotalAmount(params);
|
|
|
pageInfo.setApplyNum(degreeRegistrationDao.countApplyNum(params));
|
|
|
pageInfo.setTotalAmount(degree.getMoney());
|