|
@@ -82,6 +82,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
//数据库是秒,时间转换为小时;
|
|
//数据库是秒,时间转换为小时;
|
|
double d = calculateTime * 1.0 / 3600;
|
|
double d = calculateTime * 1.0 / 3600;
|
|
map.put("calculateTime", df.format(d));
|
|
map.put("calculateTime", df.format(d));
|
|
|
|
+ map.put("state", list.get(0).get("state"));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
nameList = reportMapper.getReportNameByDate(date,
|
|
nameList = reportMapper.getReportNameByDate(date,
|
|
@@ -91,13 +92,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
List<Map<String, Object>> list = reportMapper.getReportByDate(date, (String) map.get("id"));
|
|
List<Map<String, Object>> list = reportMapper.getReportByDate(date, (String) map.get("id"));
|
|
map.put("data", list);
|
|
map.put("data", list);
|
|
double reportTime = 0;
|
|
double reportTime = 0;
|
|
- for (Map<String, Object> m : list) {
|
|
|
|
- double t = (double) m.get("time");
|
|
|
|
- reportTime += t;
|
|
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ for (Map<String, Object> m : list) {
|
|
|
|
+ double t = (double) m.get("time");
|
|
|
|
+ reportTime += t;
|
|
|
|
+ }
|
|
|
|
+ map.put("state", list.get(0).get("state"));
|
|
}
|
|
}
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
map.put("reportTime", df.format(reportTime));
|
|
map.put("reportTime", df.format(reportTime));
|
|
- List<TimeCalculationShow> timeList = timeCalculationShowMapper.selectList(new QueryWrapper<TimeCalculationShow>().eq("user_id", (String) map.get("id")).eq("date", date));
|
|
|
|
|
|
+ List<TimeCalculationShow> timeList = timeCalculationShowMapper.selectList(
|
|
|
|
+ new QueryWrapper<TimeCalculationShow>()
|
|
|
|
+ .eq("user_id", map.get("id"))
|
|
|
|
+ .eq("date", date));
|
|
int calculateTime = 0;
|
|
int calculateTime = 0;
|
|
for (TimeCalculationShow show : timeList) {
|
|
for (TimeCalculationShow show : timeList) {
|
|
calculateTime += show.getDuration();
|
|
calculateTime += show.getDuration();
|