|
|
@@ -171,7 +171,7 @@ public class InstallmentServiceImpl implements InstallmentService{
|
|
|
throw new IllegalOperatorException("此订单不存在,请重新确认信息");
|
|
|
|
|
|
installment.setOrderId(order.getId());
|
|
|
- installment.setPrice(purchase.getPrice());
|
|
|
+ installment.setPrice(purchase.getEnsurePrice());
|
|
|
installment.setInstallmentDetails(installmentDetails);
|
|
|
|
|
|
oldInstallment.getInstallmentDetails().clear();
|
|
|
@@ -275,14 +275,16 @@ public class InstallmentServiceImpl implements InstallmentService{
|
|
|
|
|
|
Installment installment = installmentDao.findByPurchaseId(purchase.getId());
|
|
|
|
|
|
- Double total = purchase.getPrice();
|
|
|
+ Double total = purchase.getEnsurePrice();
|
|
|
Double installTotal = installment.getPrice();
|
|
|
Double dvalue = 0d;
|
|
|
|
|
|
if (NumberUtil.compare(total, installTotal) == 1) {
|
|
|
InstallmentDetail installmentDetail = installmentDetailDao.findByInstallmentIdAndDetno(installment.getId(), installment.getCount().shortValue());
|
|
|
- installmentDetail.setPrice(NumberUtil.pricesScaleTwo(total - installTotal + installmentDetail.getPrice()));
|
|
|
- installmentDetailDao.save(installmentDetail);
|
|
|
+ if (installmentDetail != null) {
|
|
|
+ installmentDetail.setPrice(NumberUtil.pricesScaleTwo(total - installTotal + installmentDetail.getPrice()));
|
|
|
+ installmentDetailDao.save(installmentDetail);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -316,7 +318,7 @@ public class InstallmentServiceImpl implements InstallmentService{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- installment.setPrice(purchase.getPrice());
|
|
|
+ installment.setPrice(purchase.getEnsurePrice());
|
|
|
installment.setCount(installment.getInstallmentDetails().size());
|
|
|
|
|
|
return installmentDao.save(installment);
|