Commit 38ba142c authored by 周健威's avatar 周健威

修改bug

parent 0ff46e63
......@@ -57,8 +57,9 @@ public interface CalculateInterface {
default Integer getIncludeHours(Long startLong, Long endLong) {
Map<String, Dictionary> dictionaryMap = getThirdFeign().dictionaryGetAll4Map().getData();
Long hourLong = (60L * 60L * 1000L);
Long minuteLong = (60L * 1000L);
//Long dayLong = hourLong * 24;
Long bufferLong = Long.valueOf(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_TIME_HOUR_BUFFER).getDetail()) * hourLong;
Long bufferLong = Long.valueOf(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_TIME_HOUR_BUFFER).getDetail()) * minuteLong;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long bookTimeLag = endLong - startLong;
......@@ -70,16 +71,16 @@ public interface CalculateInterface {
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal(hourLong+ ""));
Integer hourDays = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(hourLong+ ""), 0, RoundingMode.DOWN).intValue();
Integer hourNums = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(hourLong+ ""), 0, RoundingMode.DOWN).intValue();
Long excess = bookTimeLag%hourLong;
if(excess > bufferLong) {
hourDays += 1;
hourNums += 1;
}
if(0 == hourDays) {
hourDays = 1;
if(0 == hourNums) {
hourNums = 1;
}
return hourDays;
return hourNums;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment