|
@@ -2398,17 +2398,14 @@ public class ExportServiceImpl implements ExportService {
|
|
|
}
|
|
|
//订单详情去除余额部分
|
|
|
calculateOrderDetailActualAmount(basicOrder.getExpectAmount(),basicOrder.getBalancePaymentAmount(),detailList);
|
|
|
- Consumer<StudentPaymentOrderDetail> con;
|
|
|
if(basicOrder.getServiceAmount().compareTo(BigDecimal.ZERO) > 0){
|
|
|
//计算服务收入
|
|
|
- con = (orderDetail)->this.setServiceFee(basicOrder,orderDetail,userFirstVipMap);
|
|
|
- }else if(basicOrder.getSaleAmount().compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ detailList.stream().forEach(e->this.setServiceFee(basicOrder,e,userFirstVipMap));
|
|
|
+ }
|
|
|
+ if(basicOrder.getSaleAmount().compareTo(BigDecimal.ZERO) > 0){
|
|
|
//计算销售收入
|
|
|
- con = (orderDetail)->this.setSaleFee(basicOrder,orderDetail);
|
|
|
- }else {
|
|
|
- return;
|
|
|
+ detailList.stream().forEach(e->this.setSaleFee(basicOrder,e));
|
|
|
}
|
|
|
- detailList.stream().forEach(con);
|
|
|
}
|
|
|
|
|
|
//按商品订单计算收入
|
|
@@ -2572,6 +2569,8 @@ public class ExportServiceImpl implements ExportService {
|
|
|
BigDecimal actualAmount = subTotalAmount;
|
|
|
for (int i = 0; i < detailList.size(); i++) {
|
|
|
StudentPaymentOrderDetail detail = detailList.get(i);
|
|
|
+ //扣去内部库存分润出去的金额
|
|
|
+ detail.setPrice(detail.getPrice().subtract(detail.getIncome()));
|
|
|
BigDecimal ratio = detail.getPrice().divide(expectAmount,8,BigDecimal.ROUND_DOWN);
|
|
|
BigDecimal price = actualAmount.multiply(ratio).setScale(2,BigDecimal.ROUND_DOWN);
|
|
|
if(i == detailList.size() - 1){
|