|
@@ -317,11 +317,17 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
List<Long> paymentOrderIdList = studentPaymentOrderList.stream().map(t -> t.getId()).collect(Collectors.toList());
|
|
|
|
|
|
- if(paymentOrderIdList == null || paymentOrderIdList.size() == 0){
|
|
|
+ subjectChange = subjectChangeMap.get(studentRegistration.getUserId());
|
|
|
+
|
|
|
+ if((paymentOrderIdList == null || paymentOrderIdList.size() == 0) && subjectChange == null){
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.getWithIds(paymentOrderIdList);
|
|
|
+ List<StudentPaymentOrderDetail> orderDetailList = new ArrayList<StudentPaymentOrderDetail>();
|
|
|
+
|
|
|
+ if(paymentOrderIdList != null && paymentOrderIdList.size() > 0) {
|
|
|
+ orderDetailList = studentPaymentOrderDetailDao.getWithIds(paymentOrderIdList);
|
|
|
+ }
|
|
|
|
|
|
Map<OrderDetailTypeEnum,BigDecimal> userOrderTypeMap = new HashMap<OrderDetailTypeEnum, BigDecimal>();;
|
|
|
|
|
@@ -333,9 +339,23 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
boolean isCalculatedOfAccessories = false;
|
|
|
|
|
|
- subjectChange = subjectChangeMap.get(studentRegistration.getUserId());
|
|
|
+ if(orderDetailList.size() == 0) {
|
|
|
+ if(subjectChange != null){
|
|
|
+ if(subjectChange.getChangeMusical() != null){
|
|
|
+ kitGroupPurchaseType = subjectChange.getKitGroupPurchaseType();
|
|
|
+ musicalId = subjectChange.getChangeMusical() + "";
|
|
|
+ userOrderTypeMap.put(OrderDetailTypeEnum.MUSICAL, subjectChange.getChangeMusicalPrice());
|
|
|
+ orderTotalAmount = orderTotalAmount.add(subjectChange.getChangeMusicalPrice());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(subjectChange.getChangeAccessories())) {
|
|
|
+ accessoriesId = accessoriesId.append(subjectChange.getChangeAccessories());
|
|
|
+ userOrderTypeMap.put(OrderDetailTypeEnum.ACCESSORIES, subjectChange.getChangeAccessoriesPrice());
|
|
|
+ orderTotalAmount = orderTotalAmount.add(subjectChange.getChangeAccessoriesPrice());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- for(StudentPaymentOrderDetail spod : orderDetailList){
|
|
|
+ for(StudentPaymentOrderDetail spod : orderDetailList) {
|
|
|
|
|
|
if (spod.getType() == OrderDetailTypeEnum.COURSE || spod.getType() == OrderDetailTypeEnum.HIGH_ONLINE_COURSE
|
|
|
|| spod.getType() == OrderDetailTypeEnum.SINGLE || spod.getType() == OrderDetailTypeEnum.VIP
|
|
@@ -354,7 +374,8 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
kitGroupPurchaseType = subjectChange.getKitGroupPurchaseType();
|
|
|
musicalId = subjectChange.getChangeMusical() + "";
|
|
|
spod.setPrice(subjectChange.getChangeMusicalPrice());
|
|
|
- }else{
|
|
|
+ spod.setRemitFee(BigDecimal.ZERO);
|
|
|
+ } else {
|
|
|
kitGroupPurchaseType = spod.getKitGroupPurchaseType();
|
|
|
musicalId = spod.getGoodsIdList();
|
|
|
//musicalAmount = musicalAmount.add(spod.getPrice());
|
|
@@ -368,6 +389,7 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
accessoriesId = accessoriesId.append(subjectChange.getChangeAccessories()).append(",");
|
|
|
//accessoriesAmount = accessoriesAmount.add(subjectChange.getChangeAccessoriesPrice());
|
|
|
spod.setPrice(subjectChange.getChangeAccessoriesPrice());
|
|
|
+ spod.setRemitFee(BigDecimal.ZERO);
|
|
|
}else{
|
|
|
accessoriesId = accessoriesId.append(spod.getGoodsIdList()).append(",");
|
|
|
//accessoriesAmount = accessoriesAmount.add(spod.getPrice());
|