日志调整

This commit is contained in:
dengwc 2024-03-13 14:20:12 +08:00
parent fcd162d4cb
commit 8856f73a74
2 changed files with 9 additions and 7 deletions

View File

@ -62,7 +62,7 @@ public class LogService {
}
/**
* 清空一天中可能剩余的日志信息
* 保存redis可能剩余的日志信息
*/
@Transactional
@Async

View File

@ -62,17 +62,19 @@ public class BPMParamFactory {
if (standardTotalPrice == null) {
standardTotalPrice = "0";
}
//预估入住天数
Duration duration = Duration.between(byLegId.getStartTime(), byLegId.getEndTime());
long days = duration.toDays(); // 获取天数差异
BigDecimal bigStandardPrice = new BigDecimal(standardTotalPrice);
//获取差旅标准金额
standardPrice = bigStandardPrice.divide(new BigDecimal(days), 3, RoundingMode.HALF_UP);
//预估入住天数
int days = DaysUtil.calculateNightsBetweenDates(LocalDate.from(byLegId.getStartTime()), LocalDate.from(byLegId.getEndTime()));
if (days > 0) {
//获取差旅标准金额
standardPrice = bigStandardPrice.divide(new BigDecimal(days), 3, RoundingMode.HALF_UP);
} else {
standardPrice = bigStandardPrice;
}
}
//金额计算
BigDecimal bigTotalPrice = new BigDecimal(orderDetail.getPrice() == null ? "0" : orderDetail.getPrice());//获取酒店需要支付的总价格
int actualDays = DaysUtil.calculateNightsBetweenDates(LocalDate.from(orderDetail.getStartTime()), LocalDate.from(orderDetail.getEndTime()));
BigDecimal result = bigTotalPrice.subtract(standardPrice.multiply(BigDecimal.valueOf(actualDays)));
BigDecimal divide;