|
@@ -382,12 +382,15 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
|
|
|
spod.setCreateTime(date);
|
|
|
spod.setUpdateTime(date);
|
|
|
spod.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
+ spod.setTenantId(tenantId);
|
|
|
studentPaymentOrderDetailList.add(spod);
|
|
|
|
|
|
totalPrice = totalPrice.add(spod.getPrice());
|
|
|
}
|
|
|
|
|
|
+ int i = 0;
|
|
|
for(String goodsIdStr : goodsIdsStr.split(",")){
|
|
|
+ i++;
|
|
|
if(StringUtils.isBlank(goodsIdStr)){
|
|
|
continue;
|
|
|
}
|
|
@@ -408,7 +411,7 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
|
|
|
|
|
|
BigDecimal tempPrice = studentPaymentOrder.getExpectAmount().multiply(goods.getGroupPurchasePrice()).divide(goodsTotalGroupPurchasePrice, BigDecimal.ROUND_DOWN).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
|
- if(totalPrice.add(tempPrice).compareTo(studentPaymentOrder.getExpectAmount()) > 0 || goodsIdsStr.split(",").length == studentPaymentOrderDetailList.size() + 1){
|
|
|
+ if(totalPrice.add(tempPrice).compareTo(studentPaymentOrder.getExpectAmount()) > 0 || goodsIdsStr.split(",").length == i){
|
|
|
studentPaymentOrderDetail.setPrice(studentPaymentOrder.getExpectAmount().subtract(totalPrice));
|
|
|
}else{
|
|
|
studentPaymentOrderDetail.setPrice(tempPrice);
|
|
@@ -726,6 +729,7 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
|
|
|
spod.setCreateTime(nowDate);
|
|
|
spod.setUpdateTime(nowDate);
|
|
|
spod.setPaymentOrderId(studentPaymentOrder.getId());
|
|
|
+ spod.setTenantId(studentPaymentOrder.getTenantId());
|
|
|
studentPaymentOrderDetailList.add(spod);
|
|
|
}
|
|
|
}
|