考核时长

master
pd 4 years ago
parent 04b1a87f8b
commit 9ae34709fc
  1. 8
      src/main/java/com/yipin/liuwanr/helper/AssesmentHelper.java
  2. 4
      src/main/java/com/yipin/liuwanr/service/AssesmentService.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();
}

@ -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;

Loading…
Cancel
Save