From 818f57f0a4a1000f0b5af3e1d26079abcf25f131 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 30 十二月 2021 09:12:01 +0800
Subject: [PATCH] 优化优惠券抵扣

---
 service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java
index d50a38d..8ee7076 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java
@@ -24,6 +24,7 @@
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.exception.ListenerExecuteException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -203,11 +204,11 @@
         deductionAmount = totalAccountAmount.subtract(new BigDecimal(deductionAmount)).doubleValue();
         if(deductionAmount < 0){
             reqJson.put("deductionAmount",totalAccountAmount.doubleValue());
-            reqJson.put("selectUserAccount",accountDtos);
+            reqJson.put("selectUserAccount",BeanConvertUtil.beanCovertJSONArray(accountDtos));
             return totalAccountAmount.doubleValue();
         }
         reqJson.put("deductionAmount",deductionAmount);
-        reqJson.put("selectUserAccount",accountDtos);
+        reqJson.put("selectUserAccount",BeanConvertUtil.beanCovertJSONArray(accountDtos));
         return deductionAmount;
     }
 
@@ -218,7 +219,7 @@
 
         if (couponList == null || couponList.size() < 1) {
             paramObj.put("couponPrice", couponPrice.doubleValue());
-            paramObj.put("couponUserDtos", new ArrayList<CouponUserDto>()); //杩欓噷鑰冭檻绌�
+            paramObj.put("couponUserDtos", new JSONArray()); //杩欓噷鑰冭檻绌�
             return couponPrice.doubleValue();
         }
         for (int couponIndex = 0; couponIndex < couponList.size(); couponIndex++) {
@@ -238,7 +239,7 @@
             }
         }
         paramObj.put("couponPrice", couponPrice.doubleValue());
-        paramObj.put("couponUserDtos", couponUserDtos);
+        paramObj.put("couponUserDtos", BeanConvertUtil.beanCovertJSONArray(couponUserDtos) );
         return couponPrice.doubleValue();
     }
 
@@ -271,7 +272,7 @@
             discountPrice = discountPrice.add(new BigDecimal(computeDiscountDto.getDiscountPrice()));
         }
         paramObj.put("discountPrice",discountPrice.doubleValue());
-        paramObj.put("computeDiscountDtos", computeDiscountDtos);
+        paramObj.put("computeDiscountDtos", BeanConvertUtil.beanCovertJSONArray(computeDiscountDtos));
         return discountPrice.doubleValue();
     }
 }

--
Gitblit v1.8.0