From 9ae34709fc80d62f5ec2fdaf82d59e7f87dfd6c6 Mon Sep 17 00:00:00 2001 From: pd <2776455882@qq.com> Date: Fri, 31 Jul 2020 19:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E6=A0=B8=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yipin/liuwanr/helper/AssesmentHelper.java | 8 ++++---- .../java/com/yipin/liuwanr/service/AssesmentService.java | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/helper/AssesmentHelper.java b/src/main/java/com/yipin/liuwanr/helper/AssesmentHelper.java index e423384..605117a 100644 --- a/src/main/java/com/yipin/liuwanr/helper/AssesmentHelper.java +++ b/src/main/java/com/yipin/liuwanr/helper/AssesmentHelper.java @@ -18,10 +18,10 @@ public class AssesmentHelper { long hours = time / (1000 * 60 * 60); long minutes = (time - hours * (1000 * 60 * 60)) / (1000 * 60); StringBuffer buffer = new StringBuffer(); - buffer.append(hours).append("h"); - if(minutes!=0) { - buffer.append(minutes).append("m"); - } + buffer.append(hours).append("h").append(minutes).append("m"); +// if(minutes!=0) { +// buffer.append(minutes).append("m"); +// } return buffer.toString(); } diff --git a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java index 7c48060..cf5ef5b 100644 --- a/src/main/java/com/yipin/liuwanr/service/AssesmentService.java +++ b/src/main/java/com/yipin/liuwanr/service/AssesmentService.java @@ -281,7 +281,9 @@ public class AssesmentService { if (datas != null && datas.length > 0) { hour = Integer.parseInt(datas[0]); if (datas.length > 2) { - minute = Integer.parseInt(datas[1]); + String str=datas[1]; + String[] strs=str.split("m"); + minute = Integer.parseInt(strs[1]); } } long time = ((hour * 60) + minute) * 60 * 1000;