From 1da595aa0da816fe33d0eed7fdab97fd8f38cc51 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期六, 20 五月 2023 09:08:14 +0800 Subject: [PATCH] 工作号变任务号等 --- src/main/java/com/zy/asrs/entity/WrkMast.java | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/entity/WrkMast.java b/src/main/java/com/zy/asrs/entity/WrkMast.java index e896efc..1078c51 100644 --- a/src/main/java/com/zy/asrs/entity/WrkMast.java +++ b/src/main/java/com/zy/asrs/entity/WrkMast.java @@ -484,4 +484,26 @@ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.logErrTime); } + /** + * 鑾峰彇鎸佺画鏃堕棿 + */ + public String getDurationTime() { + if (Cools.isEmpty(this.ioTime)) { + return ""; + } + + Date endDate = new Date(); + + //鐢ㄦ潵鑾峰彇涓や釜鏃堕棿鐩稿樊鐨勬绉掓暟 + long l = this.ioTime.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) + "绉�"; + } + } -- Gitblit v1.9.1