修改充值配置金额类型为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

@@ -132,14 +132,14 @@ public class AppController {
// 插入花生币 变动记录
BookBuyConfigEntity bookBuyConfigEntity = this.bookBuyConfigService.getById(Integer.valueOf(body));
MyUserEntity userEntity = userService.getById(Integer.valueOf(customerid));
String realMoney = bookBuyConfigEntity.getMoney();
userService.rechargeHSPoint(userEntity, Integer.valueOf(realMoney));
BigDecimal realMoney = bookBuyConfigEntity.getMoney();
userService.rechargeHSPoint(userEntity, realMoney.intValue());
//插入虚拟币消费记录
transactionDetailsService.rechargeRecord(userEntity,realMoney,order.getId(),"苹果",order.getOrderid());
transactionDetailsService.rechargeRecord(userEntity,realMoney.toString(),order.getId(),"苹果",order.getOrderid());
//插入花生币充值记录
payPaymentOrderService.insertDetail(userEntity,bookBuyConfigEntity,order.getTransactionId());
buyOrderService.updateOrderStatus(Integer.valueOf(customerid), dto.getOrderId(), "2");
order.setMoney(Integer.valueOf(bookBuyConfigEntity.getRealMoney()));
order.setMoney(bookBuyConfigEntity.getRealMoney().intValue());
order.setUsername(userEntity.getName());
orderService.saveOrUpdate(order);
return Result.ok0();

View File

@@ -126,7 +126,7 @@ public class OrderServiceImpl extends ServiceImpl<PayIOSOrderMapper,IosPayOrderE
vo.setUsername(user.getName());
}
BookBuyConfigEntity bookBuyConfigEntity = this.bookBuyConfigService.getById(Integer.valueOf(null == order.getProductID() ? "0" : order.getProductID()));
vo.setRealMoney(null == bookBuyConfigEntity ? "0" : bookBuyConfigEntity.getRealMoney());
vo.setRealMoney(null == bookBuyConfigEntity ? "0" : bookBuyConfigEntity.getRealMoney().toString());
BuyOrder orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrder>().eq("order_sn", order.getOrderid()));
if (null != orderEntity) {

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");

View File

@@ -300,22 +300,22 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(buyorder);
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.parseInt(realMoney));
BigDecimal realMoney = bookBuyConfigEntity.getRealMoney();
userService.rechargeHSPoint(userEntity, realMoney.intValue());
//插入虚拟币消费记录
transactionDetailsService.rechargeRecord(userEntity,realMoney,buy_order_id.getId().intValue(),"微信",order.getOrderSn());
transactionDetailsService.rechargeRecord(userEntity,realMoney.toString(),buy_order_id.getId().intValue(),"微信",order.getOrderSn());
//插入花生币充值记录
payPaymentOrderService.insertDetail(userEntity,bookBuyConfigEntity,buy_order_id.getId().toString());
buyOrderService.updateOrderStatus(order.getUserId(), order.getOrderSn(), "2");