修改充值配置金额类型为BigDecimal

This commit is contained in:
wuchunlei
2025-06-11 09:43:19 +08:00
parent 15b3732d36
commit 01bbe60254
6 changed files with 23 additions and 22 deletions

View File

@@ -219,22 +219,22 @@ public class AliPayServiceImpl implements AliPayService {
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(Integer.valueOf(body));
MyUserEntity userEntity = userService.getById(order.getUserId());
//充值送积分
if (bookBuyConfigEntity != null && !"0".equals(bookBuyConfigEntity.getGivejf())) {
userEntity.setJf(userEntity.getJf().add(new BigDecimal(bookBuyConfigEntity.getGivejf())));
if (bookBuyConfigEntity != null && bookBuyConfigEntity.getGivejf().compareTo(BigDecimal.ZERO)>0) {
userEntity.setJf(userEntity.getJf().add(bookBuyConfigEntity.getGivejf()));
userService.updateById(userEntity);
JfTransactionDetails jfTransactionDetails = new JfTransactionDetails();
jfTransactionDetails.setUserId(userEntity.getId());
jfTransactionDetails.setChangeAmount(new BigDecimal(bookBuyConfigEntity.getGivejf()));
jfTransactionDetails.setChangeAmount(bookBuyConfigEntity.getGivejf());
jfTransactionDetails.setActType(0);
jfTransactionDetails.setUserBalance(userEntity.getJf());
jfTransactionDetails.setRelationId(order.getOrderId());
jfTransactionDetails.setRemark("充币送积分:"+bookBuyConfigEntity.getDescription()+",订单号:"+order.getOrderSn());
jfTransactionDetailsDao.insert(jfTransactionDetails);
}
String realMoney = bookBuyConfigEntity.getRealMoney();
userService.rechargeHSPoint(userEntity,Integer.valueOf(realMoney));
BigDecimal realMoney = bookBuyConfigEntity.getRealMoney();
userService.rechargeHSPoint(userEntity,realMoney.intValue());
//插入虚拟币消费记录
transactionDetailsService.rechargeRecord(userEntity,realMoney,oldPayZfbOrderEntity.getId().intValue(),"支付宝",order.getOrderSn());
transactionDetailsService.rechargeRecord(userEntity,realMoney.toString(),oldPayZfbOrderEntity.getId().intValue(),"支付宝",order.getOrderSn());
//插入花生币充值记录
payPaymentOrderService.insertDetail(userEntity,bookBuyConfigEntity,oldPayZfbOrderEntity.getId().toString());
buyOrderService.updateOrderStatus(Integer.valueOf(customerid),oldPayZfbOrderEntity.getRelevanceoid(),"2");