Commit a781f9c7 authored by 周健威's avatar 周健威

Merge branch 'feature_chw_zjw' into dev-chw

parents d45c0c5c 38ba142c
...@@ -57,8 +57,9 @@ public interface CalculateInterface { ...@@ -57,8 +57,9 @@ public interface CalculateInterface {
default Integer getIncludeHours(Long startLong, Long endLong) { default Integer getIncludeHours(Long startLong, Long endLong) {
Map<String, Dictionary> dictionaryMap = getThirdFeign().dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = getThirdFeign().dictionaryGetAll4Map().getData();
Long hourLong = (60L * 60L * 1000L); Long hourLong = (60L * 60L * 1000L);
Long minuteLong = (60L * 1000L);
//Long dayLong = hourLong * 24; //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秒 //计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long bookTimeLag = endLong - startLong; Long bookTimeLag = endLong - startLong;
...@@ -70,16 +71,16 @@ public interface CalculateInterface { ...@@ -70,16 +71,16 @@ public interface CalculateInterface {
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + "")); // log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal(hourLong+ "")); // 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; Long excess = bookTimeLag%hourLong;
if(excess > bufferLong) { if(excess > bufferLong) {
hourDays += 1; hourNums += 1;
} }
if(0 == hourDays) { if(0 == hourNums) {
hourDays = 1; 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