Explorar el Código

修改for循环中的查询语句

wutt hace 5 años
padre
commit
d221f8c805

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationServiceImpl.java

@@ -106,8 +106,9 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
                 //然后根据日期和用户id获取到所有的记录 然后手动累加在一起
                 Long[] timeArray = {0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
                 //其他 编程 上网 文档 设计 美工 运营 看小说 影视娱乐 听音乐
-                for (Map<String, Object> dataMap : timeCalculationMapper
-                        .getTodayStatistics((String) userMap.get("id"), date, companyId)) {
+                List<Map<String, Object>> tatistics = timeCalculationMapper
+                        .getTodayStatistics((String) userMap.get("id"), date, companyId);
+                for (Map<String, Object> dataMap : tatistics) {
                     timeArray[(int) dataMap.get("type") + 1] += (Long) dataMap.get("duration");
                 }
                 Long[] resultArray = new Long[6];