|
@@ -408,7 +408,10 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
}
|
|
|
studentPaymentOrderDetail.setGoodsIdList(goodsIdStr);
|
|
|
|
|
|
- BigDecimal tempPrice = studentPaymentOrder.getExpectAmount().multiply(goods.getGroupPurchasePrice()).divide(totalGroupPurchasePrice, BigDecimal.ROUND_DOWN).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ BigDecimal tempPrice = BigDecimal.ZERO;
|
|
|
+ if(totalGroupPurchasePrice.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ tempPrice = studentPaymentOrder.getExpectAmount().multiply(goods.getGroupPurchasePrice()).divide(totalGroupPurchasePrice, BigDecimal.ROUND_DOWN).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ }
|
|
|
|
|
|
if(totalPrice.add(tempPrice).compareTo(studentPaymentOrder.getExpectAmount()) > 0 || goodsIdsStr.split(",").length == studentPaymentOrderDetailList.size() + 1){
|
|
|
studentPaymentOrderDetail.setPrice(studentPaymentOrder.getExpectAmount().subtract(totalPrice));
|
|
@@ -742,7 +745,10 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
}
|
|
|
studentPaymentOrderDetail.setGoodsIdList(goodsIdStr);
|
|
|
|
|
|
- BigDecimal tempPrice = studentPaymentOrder.getExpectAmount().subtract(repairPrice).multiply(goods.getGroupPurchasePrice()).divide(totalGroupPurchasePrice, BigDecimal.ROUND_DOWN).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ BigDecimal tempPrice = BigDecimal.ZERO;
|
|
|
+ if(totalGroupPurchasePrice.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ tempPrice = studentPaymentOrder.getExpectAmount().subtract(repairPrice).multiply(goods.getGroupPurchasePrice()).divide(totalGroupPurchasePrice, BigDecimal.ROUND_DOWN).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
+ }
|
|
|
|
|
|
if(totalPrice.add(tempPrice).compareTo(studentPaymentOrder.getExpectAmount()) > 0 || goodsIds.split(",").length == studentPaymentOrderDetailList.size()){
|
|
|
studentPaymentOrderDetail.setPrice(studentPaymentOrder.getExpectAmount().subtract(totalPrice));
|