|
@@ -120,7 +120,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
style.setDataFormat(HSSFDataFormat.getBuiltinFormat("yy/mm/dd hh:mm"));
|
|
|
//新增数据行 并且装填数据
|
|
|
int rowNum = 1;
|
|
|
- for (Map<String, Object> map : reportMapper.getAllReportByDate(date)) {
|
|
|
+ List<Map<String, Object>> allReportByDate = reportMapper.getAllReportByDate(date);
|
|
|
+ for (Map<String, Object> map : allReportByDate) {
|
|
|
HSSFRow row = sheet.createRow(rowNum);
|
|
|
row.createCell(0).setCellValue(rowNum);
|
|
|
row.createCell(1).setCellValue((String) map.get("name"));
|
|
@@ -167,10 +168,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//以下区间被认为是工作时间
|
|
|
Integer[] workType = {-1, 0, 1, 2, 3, 4, 5};
|
|
|
//工作时间筛选
|
|
|
- for (TimeCalculation timeCalculation : timeCalculationMapper.selectList(new QueryWrapper<TimeCalculation>()
|
|
|
+ List<TimeCalculation> timeCalculations = timeCalculationMapper.selectList(new QueryWrapper<TimeCalculation>()
|
|
|
.eq("date", LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
|
|
.eq("user_id", userId)
|
|
|
- .in("action_type", workType))) {
|
|
|
+ .in("action_type", workType));
|
|
|
+ for (TimeCalculation timeCalculation : timeCalculations) {
|
|
|
totalWorkingTime += timeCalculation.getDuration();
|
|
|
}
|
|
|
//把总秒数转为double后换算为小时并保留两位小数
|