|
@@ -1278,6 +1278,7 @@ public class ReportController {
|
|
|
httpRespMsg.setError(MessageUtils.message("profession.workDurationError"));
|
|
|
return httpRespMsg;
|
|
|
} else if (report.getOvertimeHours() > report.getWorkingTime()) {
|
|
|
+
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.0");
|
|
|
decimalFormat.setRoundingMode(RoundingMode.HALF_UP);
|
|
@@ -2116,6 +2117,8 @@ public class ReportController {
|
|
|
JSONArray array = JSONArray.parseArray(str);
|
|
|
try {
|
|
|
double totalHours = 0;
|
|
|
+ long totalSeconds = 0l;
|
|
|
+ double totalHoursTmp = 0;
|
|
|
for (int t=0;t<array.size(); t++) {
|
|
|
JSONObject jsonObject = array.getJSONObject(t);
|
|
|
WorktimeItem item = JSONObject.toJavaObject(jsonObject, WorktimeItem.class);
|
|
@@ -2133,14 +2136,15 @@ public class ReportController {
|
|
|
if (excludeTime > 0) {
|
|
|
time -= excludeTime;
|
|
|
}
|
|
|
-
|
|
|
+ totalSeconds+=time;
|
|
|
int minutes = (int)time/1000/60;
|
|
|
double hours = minutes*1.0f/60;
|
|
|
item.setTime(hours);
|
|
|
jsonObject.put("time", hours);
|
|
|
totalHours += hours;
|
|
|
}
|
|
|
- report.setWorkingTime(totalHours);
|
|
|
+ totalHoursTmp = ((int)totalSeconds/1000/60)*1.0f/60;
|
|
|
+ report.setWorkingTime(totalHoursTmp);
|
|
|
report.setCost(hourCost.multiply(new BigDecimal(totalHours)));
|
|
|
report.setContent(array.toJSONString());
|
|
|
} catch (ParseException e) {
|