Explorar el Código

返回状态2

Reiskuchen hace 5 años
padre
commit
fbd74420d9

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

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