Browse Source

fixed 会员支付折扣设置

fushengqian 1 year ago
parent
commit
c22bf283b7

+ 6 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java

@@ -366,6 +366,9 @@ public class OrderServiceImpl extends ServiceImpl<MtOrderMapper, MtOrder> implem
         if (userGrade != null && userGrade.getDiscount() != null && userGrade.getDiscount() > 0) {
         if (userGrade != null && userGrade.getDiscount() != null && userGrade.getDiscount() > 0) {
             // 会员折扣
             // 会员折扣
             percent = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
             percent = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
+            if (percent.compareTo(new BigDecimal("0")) <= 0) {
+                percent = new BigDecimal("1");
+            }
         }
         }
 
 
         // 如果没有指定店铺,则读取默认的店铺
         // 如果没有指定店铺,则读取默认的店铺
@@ -2059,6 +2062,9 @@ public class OrderServiceImpl extends ServiceImpl<MtOrderMapper, MtOrder> implem
         if (userGrade != null) {
         if (userGrade != null) {
             if (userGrade.getDiscount() > 0) {
             if (userGrade.getDiscount() > 0) {
                 payDiscount = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
                 payDiscount = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
+                if (payDiscount.compareTo(new BigDecimal("0")) <= 0) {
+                    payDiscount = new BigDecimal("1");
+                }
             }
             }
         }
         }
         payPrice = payPrice.multiply(payDiscount).add(deliveryFee);
         payPrice = payPrice.multiply(payDiscount).add(deliveryFee);

+ 2 - 2
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendCommonController.java

@@ -85,9 +85,9 @@ public class BackendCommonController extends BaseController {
         }
         }
         String h5QrCode = "";
         String h5QrCode = "";
         try {
         try {
-            page = env.getProperty("website.url") + "#" + page;
+            String h5Page = env.getProperty("website.url") + "#" + page;
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             ByteArrayOutputStream out = new ByteArrayOutputStream();
-            QRCodeUtil.createQrCode(out, page, 800, 800, "png", "");
+            QRCodeUtil.createQrCode(out, h5Page, 800, 800, "png", "");
             h5QrCode = new String(Base64Util.baseEncode(out.toByteArray()), "UTF-8");
             h5QrCode = new String(Base64Util.baseEncode(out.toByteArray()), "UTF-8");
             h5QrCode = "data:image/jpg;base64," + h5QrCode;
             h5QrCode = "data:image/jpg;base64," + h5QrCode;
         } catch (Exception e) {
         } catch (Exception e) {

+ 3 - 0
fuint-application/src/main/java/com/fuint/module/clientApi/controller/ClientPayController.java

@@ -134,6 +134,9 @@ public class ClientPayController extends BaseController {
             if (userGrade != null) {
             if (userGrade != null) {
                 if (userGrade.getDiscount() > 0) {
                 if (userGrade.getDiscount() > 0) {
                     payDiscount = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
                     payDiscount = new BigDecimal(userGrade.getDiscount()).divide(new BigDecimal("10"), BigDecimal.ROUND_CEILING, 3);
+                    if (payDiscount.compareTo(new BigDecimal("0")) <= 0) {
+                        payDiscount = new BigDecimal("1");
+                    }
                 }
                 }
             }
             }
         }
         }