From 46563efd16315221de276a14a5df60e764f284b2 Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Thu, 18 May 2023 19:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/dal/dataobject/recharge/PhoneRecordDO.java | 2 +- .../shop/service/order/impl/StoreOrderServiceImpl.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/PhoneRecordDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/PhoneRecordDO.java index 4fff21412..cbf3205b7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/PhoneRecordDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/PhoneRecordDO.java @@ -28,7 +28,7 @@ public class PhoneRecordDO extends BaseDO { /** * 主键 */ - @TableId + @TableId(type = IdType.ASSIGN_ID) private Long id; /** * 用户id diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index ebe288fc5..8b0a8ea83 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.shop.service.order.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.PhoneUtil; import cn.hutool.core.util.StrUtil; @@ -1281,15 +1282,15 @@ public class StoreOrderServiceImpl extends ServiceImpl"); // 验证相关参数-金额 String outTradeNo = result.getOutTradeNo(); // 用户支付金额 - Integer payerTotal = result.getAmount().getPayerTotal() / 100; + BigDecimal payerTotal = NumberUtil.div(result.getAmount().getPayerTotal()+"","100",2); // 处理相关逻辑 RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getOrderId, outTradeNo)); - if (new BigDecimal(payerTotal).compareTo(orderDO.getPayPrice()) != 0) { + if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) { log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal); return Boolean.FALSE; } @@ -1332,7 +1333,8 @@ public class StoreOrderServiceImpl extends ServiceImpl