充值送积分

This commit is contained in:
wuchunlei
2024-11-08 16:51:29 +08:00
parent d16264103b
commit 0810035f58
6 changed files with 51 additions and 1 deletions

View File

@@ -197,6 +197,20 @@ public class AliPayServiceImpl implements AliPayService {
if("point".equals(subject)){
// 插入花生币 变动记录
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(Integer.valueOf(body));
//充值送积分
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();
jfTransactionDetails.setUserId(userEntity.getId());
jfTransactionDetails.setChangeAmount(new BigDecimal(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();
Integer money = Integer.valueOf(realMoney);
userService.rechargeHSPoint(Integer.valueOf(customerid),money);

View File

@@ -267,6 +267,20 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
PayWechatOrderEntity buy_order_id = payWechatOrderService.getBaseMapper().selectOne(new QueryWrapper<PayWechatOrderEntity>().eq("order_sn", order.getOrderSn()));
Integer buyorder = buy_order_id.getBuyOrderId();
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(buyorder);
//充值送积分
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();
jfTransactionDetails.setUserId(userEntity.getId());
jfTransactionDetails.setChangeAmount(new BigDecimal(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();
int money = Integer.parseInt(realMoney);
userService.rechargeHSPoint(order.getUserId(), money);