|
@@ -1353,20 +1353,22 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
for (int i = 0; i < goodsOrderItemVOS.size(); i++) {
|
|
|
GoodsOrderItemVO goodsVo = goodsOrderItemVOS.get(i);
|
|
|
Goods goods = goodsSnMap.get(goodsVo.getProductSn());
|
|
|
- StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
|
|
|
- detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
|
|
|
- detail.setGoodsIdList(goods.getId().toString());
|
|
|
- detail.setPrice(goodsVo.getRealAmount());
|
|
|
- detail.setRemitFee(BigDecimal.ZERO);
|
|
|
- detail.setPaymentOrderId(paymentOrderId);
|
|
|
- orderDetails.add(detail);
|
|
|
+ for (int j = 0; j < goodsVo.getProductQuantity(); j++) {
|
|
|
+ StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
|
|
|
+ detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
|
|
|
+ detail.setGoodsIdList(goods.getId().toString());
|
|
|
+ detail.setPrice(goodsVo.getRealAmount());
|
|
|
+ detail.setRemitFee(BigDecimal.ZERO);
|
|
|
+ detail.setPaymentOrderId(paymentOrderId);
|
|
|
+ orderDetails.add(detail);
|
|
|
+ }
|
|
|
|
|
|
+ BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
|
|
|
SellOrder sellOrder = new SellOrder();
|
|
|
sellOrder.setOrganId(organId);
|
|
|
sellOrder.setTransNo(transNo);
|
|
|
sellOrder.setOrderId(paymentOrderId);
|
|
|
sellOrder.setOrderNo(orderNo);
|
|
|
- BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
|
|
|
sellOrder.setExpectAmount(goodsVo.getRealAmount());
|
|
|
if(goodsOrderItemVOS.size() - 1 == i){
|
|
|
sellOrder.setBalanceAmount(subjectBalance);
|
|
@@ -1374,6 +1376,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
//获取比例
|
|
|
BigDecimal ratioAmount = totalAmount.divide(studentGoodsSellDto.getExpectAmount(), 6, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal multiply = balancePaymentAmount.multiply(ratioAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ subjectBalance = subjectBalance.subtract(multiply);
|
|
|
sellOrder.setBalanceAmount(multiply);
|
|
|
}
|
|
|
sellOrder.setActualAmount(totalAmount.subtract(sellOrder.getBalanceAmount()));
|