Преглед изворни кода

处理分期付款的问题。

yujia пре 8 година
родитељ
комит
4522372b51

+ 7 - 5
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentServiceImpl.java

@@ -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);

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js

@@ -462,7 +462,7 @@ define(['app/app'], function(app) {
 					$scope.installmentBox = false
 				}
 				$scope.purchase.purchaseHistory = angular.fromJson($scope.purchase.statushistory);
-				$scope.purchase.currentTotal = $scope.purchase.price;
+				$scope.purchase.currentTotal = $scope.purchase.price + $scope.purchase.fare;
 				if ($scope.purchase.jsonRule){
 					$scope.rule = angular.fromJson($scope.purchase.jsonRule);
 				}