From b22b5b594c4cc9321f1b0ab6814a6290f1bfa7b2 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 05 六月 2025 15:52:56 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/entity/CommandInfoLog.java | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/asrs/entity/CommandInfoLog.java b/src/main/java/com/zy/asrs/entity/CommandInfoLog.java
index 142f7da..31bdbbf 100644
--- a/src/main/java/com/zy/asrs/entity/CommandInfoLog.java
+++ b/src/main/java/com/zy/asrs/entity/CommandInfoLog.java
@@ -5,6 +5,8 @@
import com.baomidou.mybatisplus.annotations.TableField;
import java.text.SimpleDateFormat;
import java.util.Date;
+
+import com.zy.core.enums.CommandType;
import org.springframework.format.annotation.DateTimeFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -187,5 +189,37 @@
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.completeTime);
}
+ /**
+ * 鑾峰彇鎸佺画鏃堕棿
+ */
+ public String getDurationTime() {
+ if (Cools.isEmpty(this.startTime)) {
+ return "";
+ }
+
+ Date endDate = new Date();
+ if (!Cools.isEmpty(this.completeTime)) {
+ endDate = this.completeTime;
+ }
+
+ //鐢ㄦ潵鑾峰彇涓や釜鏃堕棿鐩稿樊鐨勬绉掓暟
+ long l = this.startTime.getTime() - endDate.getTime();
+
+ //鍒嗗埆璁$畻鐩稿樊鐨勫ぉ銆佸皬鏃躲�佸垎銆佺
+ long day = l / (24 * 60 * 60 * 1000);
+ long hour = (l / (60 * 60 * 1000) - day * 24);
+ long min = ((l / (60 * 1000)) - day * 24 * 60 - hour * 60);
+ long s = (l / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
+
+ return Math.abs(day) + "澶�" + Math.abs(hour) + "灏忔椂" + Math.abs(min) + "鍒�" + Math.abs(s) + "绉�";
+ }
+
+ public String getCommandType$() {
+ if (Cools.isEmpty(this.commandType)) {
+ return "";
+ }
+ return CommandType.get(this.commandType).desc;
+ }
+
}
--
Gitblit v1.9.1