|
@@ -2,13 +2,16 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
|
|
|
import static com.ym.mec.biz.dal.enums.GroupType.GOODS_SELL;
|
|
|
+import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
|
|
|
import static com.ym.mec.biz.dal.enums.OrderDetailTypeEnum.*;
|
|
|
import static com.ym.mec.biz.dal.enums.OrderDetailTypeEnum.ORGAN_SHARE_PROFIT;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Consumer;
|
|
|
import java.util.function.Function;
|
|
|
+import java.util.function.Supplier;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -627,7 +630,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public List<SellOrder> initSellOrder(StudentPaymentOrder order, String musicGroupId, List<Integer> goodsIds, KitGroupPurchaseTypeEnum kitGroupPurchaseType,
|
|
|
- BigDecimal totalBalance, BigDecimal expectTotalAmount, BigDecimal couponRemitAmount, BigDecimal actualTotalAmount,Boolean saveFlag) {
|
|
|
+ BigDecimal totalBalance, BigDecimal expectTotalAmount, BigDecimal couponRemitAmount,
|
|
|
+ BigDecimal actualTotalAmount, Boolean saveFlag) {
|
|
|
//可用优惠券金额
|
|
|
BigDecimal subCouponRemitAmount = couponRemitAmount;
|
|
|
//可用总金额
|
|
@@ -669,7 +673,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
BigDecimal actualAmount;
|
|
|
|
|
|
if (goodsTotalPrice.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- goodsRatioAmount = nowGoods.getGroupPurchasePrice().divide(goodsTotalPrice, 6, RoundingMode.HALF_UP);
|
|
|
+ goodsRatioAmount = order.getGroupType() == MUSIC ?nowGoods.getGroupPurchasePrice():nowGoods.getDiscountPrice()
|
|
|
+ .divide(goodsTotalPrice, 6, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
if(i == goodies.size() - 1){
|
|
|
expectAmount = subExpectTotalAmount;
|
|
@@ -768,7 +773,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public List<SellOrder> initSellOrder(StudentPaymentOrder order, String musicGroupId, List<Integer> goodsIds, KitGroupPurchaseTypeEnum kitGroupPurchaseType,Boolean saveFlag) {
|
|
|
+ public List<SellOrder> initSellOrder(StudentPaymentOrder order, String musicGroupId, List<Integer> goodsIds,
|
|
|
+ KitGroupPurchaseTypeEnum kitGroupPurchaseType,Boolean saveFlag) {
|
|
|
BigDecimal totalBalance = order.getBalancePaymentAmount();
|
|
|
if (totalBalance == null) {
|
|
|
totalBalance = BigDecimal.ZERO;
|
|
@@ -776,7 +782,8 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
|
|
|
BigDecimal expectTotalAmount = order.getExpectAmount();
|
|
|
BigDecimal couponRemitAmount = order.getCouponRemitFee();
|
|
|
BigDecimal actualTotalAmount = order.getActualAmount();
|
|
|
- return this.initSellOrder(order, musicGroupId, goodsIds, kitGroupPurchaseType, totalBalance, expectTotalAmount, couponRemitAmount, actualTotalAmount,saveFlag==null?true:saveFlag);
|
|
|
+ return this.initSellOrder(order, musicGroupId, goodsIds, kitGroupPurchaseType, totalBalance, expectTotalAmount,
|
|
|
+ couponRemitAmount, actualTotalAmount,saveFlag==null?true:saveFlag);
|
|
|
}
|
|
|
|
|
|
public Map<String, BigDecimal> calcSellAmount(StudentPaymentOrder order,BigDecimal cloudBalanceIncome,BigDecimal cloudIncome) {
|