修改充值配置金额类型为BigDecimal
This commit is contained in:
@@ -46,8 +46,8 @@ public class PayPaymentOrderServiceImpl extends ServiceImpl<PayPaymentOrderDao,
|
||||
PayPaymentOrderEntity payPaymentOrderEntity = new PayPaymentOrderEntity();
|
||||
payPaymentOrderEntity.setUserId(user.getId());
|
||||
payPaymentOrderEntity.setOrderId(payXxxOrderId);
|
||||
payPaymentOrderEntity.setRealAmount(new BigDecimal(bookBuyConfigEntity.getRealMoney()));
|
||||
payPaymentOrderEntity.setRechargeAmount(new BigDecimal(bookBuyConfigEntity.getMoney()));
|
||||
payPaymentOrderEntity.setRealAmount(bookBuyConfigEntity.getRealMoney());
|
||||
payPaymentOrderEntity.setRechargeAmount(bookBuyConfigEntity.getMoney());
|
||||
payPaymentOrderEntity.setRechargeChannel(bookBuyConfigEntity.getQudao());
|
||||
payPaymentOrderEntity.setRechargeStatus("success");
|
||||
payPaymentOrderEntity.setSuccessTime(new Date());
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -36,15 +37,15 @@ public class BookBuyConfigEntity implements Serializable {
|
||||
/**
|
||||
* 真实价格
|
||||
*/
|
||||
private String realMoney;
|
||||
private BigDecimal realMoney;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private String money;
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
private String givejf;
|
||||
private BigDecimal givejf;
|
||||
/**
|
||||
* vip开通月份
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user