计算站点订单日报

This commit is contained in:
2023-06-05 16:30:26 +08:00
parent 3677121bd5
commit b22e055748
5 changed files with 108 additions and 3 deletions

View File

@@ -218,6 +218,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
/**
* 计算相差天数 (会显示负值)
*
* @param endDate
* @param nowDate
* @return
@@ -574,6 +575,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
return simpleDateFormat.format(date);
}
public static String formatDateTime(LocalDateTime localDateTime) {
if (localDateTime == null) {
return "";
}
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
return formatDateTime(date);
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@@ -788,11 +797,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
/**
* 秒 转 天时分秒
* 时分秒HoursMinutesSeconds
*
* @param mss 秒数
* @return xx天xx小时xx分钟xx秒
*/
public static String formatDateTime(long mss) {
public static String formatHoursMinutesSeconds(long mss) {
String DateTimes = null;
long days = mss / (60 * 60 * 24);
long hours = (mss % (60 * 60 * 24)) / (60 * 60);
@@ -828,7 +838,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
if (time.compareTo(beginTime) == 0 || time.compareTo(endTime) == 0) {
return true;
}
if (beginTime.isBefore(time) && endTime.isAfter(time)){
if (beginTime.isBefore(time) && endTime.isAfter(time)) {
return true;
}
return false;