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