luolinsong hai 1 semana
pai
achega
6451c8f173

+ 9 - 6
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java

@@ -299,12 +299,15 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
 
     @Override
     public Map<String, BigDecimal> calculateTotalAmount(FsStorePaymentParam fsStorePayment) {
-        FsStorePaymentAmountVO  fsStorePaymentAmountVO =fsStorePaymentMapper.calculateTotalAmount(fsStorePayment);
-        BigDecimal totalPaymentAmount = fsStorePaymentAmountVO.getTotalPaymentAmount() == null
-                ? BigDecimal.ZERO : fsStorePaymentAmountVO.getTotalPaymentAmount();
-        BigDecimal totalRefundAmount = fsStorePaymentAmountVO.getTotalRefundAmount() == null
-                ? BigDecimal.ZERO : fsStorePaymentAmountVO.getTotalRefundAmount();
-
+        FsStorePaymentAmountVO fsStorePaymentAmountVO = fsStorePaymentMapper.calculateTotalAmount(fsStorePayment);
+        BigDecimal totalPaymentAmount = BigDecimal.ZERO;
+        BigDecimal totalRefundAmount = BigDecimal.ZERO;
+        if (StringUtils.isNotNull(fsStorePaymentAmountVO)) {
+            totalPaymentAmount = fsStorePaymentAmountVO.getTotalPaymentAmount() == null
+                    ? BigDecimal.ZERO : fsStorePaymentAmountVO.getTotalPaymentAmount();
+            totalRefundAmount = fsStorePaymentAmountVO.getTotalRefundAmount() == null
+                    ? BigDecimal.ZERO : fsStorePaymentAmountVO.getTotalRefundAmount();
+        }
         Map<String, BigDecimal> resultMap = new HashMap<>();
         resultMap.put("totalPaymentAmount", totalPaymentAmount);
         resultMap.put("totalRefundAmount", totalRefundAmount);