1.新增设备商户ID

2.debug:智能电量套餐金额计算错误
This commit is contained in:
磷叶 2024-10-16 18:05:00 +08:00
parent 78577db9b3
commit 0071b2c242
2 changed files with 3 additions and 2 deletions

View File

@ -170,6 +170,7 @@ public class Device extends BaseEntity
private BigDecimal remainTime;
@ApiModelProperty("所属用户ID")
@JsonView(DeviceView.SuitList.class)
private Long userId;
@Excel(name = "起步时长")

View File

@ -1406,10 +1406,10 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
private BigDecimal calcSmartCountAmount(TransactionBillVO order, BigDecimal totalEle) {
BigDecimal startEle = order.getSuitStartEle();
BigDecimal usedEle = totalEle.subtract(startEle); // 已使用的电量
BigDecimal suitTotalEle = transactionBillConverter.toRechargeEle(order); // 套餐总电量
BigDecimal suitEle = new BigDecimal(order.getSuitTime()); // 套餐每周期的电量
// 计算总使用的周期数不满足一个周期也算一个周期
BigDecimal totalRound = usedEle.divide(suitTotalEle, 0, RoundingMode.UP);
BigDecimal totalRound = usedEle.divide(suitEle, 0, RoundingMode.UP);
if (totalRound.compareTo(BigDecimal.ZERO) <= 0 ) {
totalRound = BigDecimal.ONE;
}