充值卡充值接口
This commit is contained in:
parent
4be7bbe570
commit
6aa1d542da
@ -127,13 +127,30 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
}
|
||||
// 计算新的余额
|
||||
BigDecimal newBalance = rechargecardUser.getNumber().add(info.getBalance());
|
||||
UserConsumptionDetails userConsumptionDetails= UserConsumptionDetails.builder()
|
||||
.userId(info.getUserId()).deviceNumber(null).cardNumber(info.getCardNumber())
|
||||
.projectId(null).deptId(null).billingType(0).pumpTime(null).unitPrice(null).totalPrice(null)
|
||||
.discount(null).taxAmount(null).amountDue(rechargecardUser.getNumber()).billingPeriodUnit(null).billingPeriodDuration(null)
|
||||
.billingDate(DateUtils.getNowDate()).startTime(null).endTime(null).paymentStatus(2).paymentMethod(rechargecardUser.getStatus())
|
||||
.paymentTime(DateUtils.getNowDate()).status(0).remark(null);
|
||||
|
||||
UserConsumptionDetails userConsumptionDetails = UserConsumptionDetails.builder()
|
||||
.userId(info.getUserId())
|
||||
.deviceNumber(null) // 确保业务逻辑可以处理 null 值
|
||||
.cardNumber(info.getCardNumber())
|
||||
.projectId(null) // 确保业务逻辑可以处理 null 值
|
||||
.deptId(null) // 确保业务逻辑可以处理 null 值
|
||||
.billingType(0)
|
||||
.pumpTime(null) // 确保业务逻辑可以处理 null 值
|
||||
.unitPrice(null) // 确保业务逻辑可以处理 null 值
|
||||
.totalPrice(null) // 确保业务逻辑可以处理 null 值
|
||||
.discount(null) // 确保业务逻辑可以处理 null 值
|
||||
.taxAmount(null) // 确保业务逻辑可以处理 null 值
|
||||
.amountDue(rechargecardUser.getNumber())
|
||||
.billingPeriodUnit(null) // 确保业务逻辑可以处理 null 值
|
||||
.billingPeriodDuration(null) // 确保业务逻辑可以处理 null 值
|
||||
.billingDate(DateUtils.getNowDate()) // 获取当前日期
|
||||
.startTime(null) // 确保业务逻辑可以处理 null 值
|
||||
.endTime(null) // 确保业务逻辑可以处理 null 值
|
||||
.paymentStatus(2)
|
||||
.paymentMethod(rechargecardUser.getStatus())
|
||||
.paymentTime(DateUtils.getNowDate()) // 获取当前日期
|
||||
.status(0)
|
||||
.remark(null) // 确保业务逻辑可以处理 null 值
|
||||
.build();
|
||||
userConsumptionDetailsMapper.insertUserConsumptionDetails(userConsumptionDetails);
|
||||
// 更新用户充值卡信息,包括新的余额
|
||||
info.setBalance(newBalance);
|
||||
|
Loading…
x
Reference in New Issue
Block a user