修改虚拟币记录

This commit is contained in:
wuchunlei
2024-12-05 15:53:59 +08:00
parent 0240b6fa94
commit e908760c71
12 changed files with 120 additions and 125 deletions

View File

@@ -212,9 +212,9 @@ public class AliPayServiceImpl implements AliPayService {
if("point".equals(subject)){
// 插入花生币 变动记录
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(Integer.valueOf(body));
MyUserEntity userEntity = userService.getById(order.getUserId());
//充值送积分
if (bookBuyConfigEntity != null && !"0".equals(bookBuyConfigEntity.getGivejf())) {
MyUserEntity userEntity = userService.getById(order.getUserId());
userEntity.setJf(userEntity.getJf().add(new BigDecimal(bookBuyConfigEntity.getGivejf())));
userService.updateById(userEntity);
JfTransactionDetails jfTransactionDetails = new JfTransactionDetails();
@@ -227,33 +227,11 @@ public class AliPayServiceImpl implements AliPayService {
jfTransactionDetailsDao.insert(jfTransactionDetails);
}
String realMoney = bookBuyConfigEntity.getRealMoney();
Integer money = Integer.valueOf(realMoney);
userService.rechargeHSPoint(Integer.valueOf(customerid),money);
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
transactionDetailsEntity.setUserId(Integer.valueOf(customerid));
transactionDetailsEntity.setChangeAmount(new BigDecimal(money));
transactionDetailsEntity.setOrderType("充值");
transactionDetailsEntity.setRelationId(oldPayZfbOrderEntity.getId().intValue());
transactionDetailsEntity.setRemark("支付宝充值:"+oldPayZfbOrderEntity.getRelevanceoid());
MyUserEntity user = userService.getById(Integer.valueOf(customerid));
BigDecimal peanutCoin = user.getPeanutCoin();
transactionDetailsEntity.setUserBalance(peanutCoin);
transactionDetailsEntity.setUserName(user.getNickname());
transactionDetailsEntity.setTel(user.getTel());
transactionDetailsService.save(transactionDetailsEntity);
// 插入 花生币 充值记录
PayPaymentOrderEntity payPaymentOrderEntity = new PayPaymentOrderEntity();
payPaymentOrderEntity.setUserId(Integer.valueOf(customerid));
payPaymentOrderEntity.setOrderId(String.valueOf(oldPayZfbOrderEntity.getId()));
payPaymentOrderEntity.setRealAmount(new BigDecimal(bookBuyConfigEntity.getRealMoney()));
payPaymentOrderEntity.setRechargeAmount(new BigDecimal(bookBuyConfigEntity.getMoney()));
payPaymentOrderEntity.setRechargeChannel(bookBuyConfigEntity.getQudao());
payPaymentOrderEntity.setRechargeStatus("success");
payPaymentOrderEntity.setSuccessTime(new Date());
payPaymentOrderEntity.setUserName(user.getNickname());
payPaymentOrderEntity.setTel(user.getTel());
payPaymentOrderService.save(payPaymentOrderEntity);
userService.rechargeHSPoint(userEntity,Integer.valueOf(realMoney));
//插入虚拟币消费记录
transactionDetailsService.rechargeRecord(userEntity,realMoney,oldPayZfbOrderEntity.getId().intValue(),"支付宝",order.getOrderSn());
//插入花生币充值记录
payPaymentOrderService.insertDetail(userEntity,bookBuyConfigEntity,oldPayZfbOrderEntity.getId().intValue());
buyOrderService.updateOrderStatus(Integer.valueOf(customerid),oldPayZfbOrderEntity.getRelevanceoid(),"2");
}
if ("order".equals(subject)) {