|
@@ -111,7 +111,6 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
|
|
|
studentPaymentRouteOrderDao.insert(studentPaymentRouteOrder);
|
|
|
|
|
|
if (studentPaymentRouteOrderDto.getGoodies() != null && studentPaymentRouteOrderDto.getGoodies().size() > 0) {
|
|
|
- List<SellOrder> sellOrders = new ArrayList<>();
|
|
|
BigDecimal hasRouteAmount = BigDecimal.ZERO;
|
|
|
BigDecimal goodsTotalPrice = BigDecimal.ZERO;
|
|
|
|
|
@@ -159,11 +158,12 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
|
|
|
if (complementPrice.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
sellOrderActualAmount = complementGoodsPrice.get(sellOrder.getGoodsId()).multiply(new BigDecimal(sellOrder.getNum())).multiply(actualAmount).divide(complementPrice, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
- hasRouteSellOrderActualAmount = hasRouteSellOrderActualAmount.add(sellOrderActualAmount);
|
|
|
goodsNum = goodsNum - sellOrder.getNum();
|
|
|
if (goodsNum <= 0) {
|
|
|
sellOrderActualAmount = actualAmount.subtract(hasRouteSellOrderActualAmount);
|
|
|
}
|
|
|
+ hasRouteSellOrderActualAmount = hasRouteSellOrderActualAmount.add(sellOrderActualAmount);
|
|
|
+
|
|
|
sellOrder.setSellTime(studentPaymentRouteOrderDto.getPayTime());
|
|
|
sellOrder.setOrganId(studentPaymentRouteOrderDto.getOrganId());
|
|
|
sellOrder.setCooperationOrganId(studentPaymentRouteOrderDto.getSchoolId());
|
|
@@ -180,10 +180,9 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
|
|
|
sellOrder.setCreateIme(nowDate);
|
|
|
sellOrder.setUpdateTime(nowDate);
|
|
|
sellOrder.setType(SellTypeEnum.SCHOOL_BUY);
|
|
|
- sellOrders.add(sellOrder);
|
|
|
}
|
|
|
}
|
|
|
- sellOrderDao.batchInsert(sellOrders);
|
|
|
+ sellOrderDao.batchInsert(sellOrderList);
|
|
|
}
|
|
|
return studentPaymentRouteOrderDto;
|
|
|
}
|