|
@@ -222,8 +222,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
.eq("date", LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
.eq("date", LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
.eq("user_id", userId)
|
|
.eq("user_id", userId)
|
|
.in("action_type", workType));
|
|
.in("action_type", workType));
|
|
- for (TimeCalculation timeCalculation : timeCalculations) {
|
|
|
|
- totalWorkingTime += timeCalculation.getDuration();
|
|
|
|
|
|
+ if (timeCalculations != null) {
|
|
|
|
+ for (TimeCalculation timeCalculation : timeCalculations) {
|
|
|
|
+ totalWorkingTime += timeCalculation.getDuration();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//把总秒数转为double后换算为小时并保留两位小数
|
|
//把总秒数转为double后换算为小时并保留两位小数
|
|
resultMap.put("time", new DecimalFormat("0.00").format((double) totalWorkingTime / 3600));
|
|
resultMap.put("time", new DecimalFormat("0.00").format((double) totalWorkingTime / 3600));
|