|
@@ -185,7 +185,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
sheet.setColumnWidth(7, 20 * 256);
|
|
sheet.setColumnWidth(7, 20 * 256);
|
|
sheet.setColumnWidth(8, 20 * 256);
|
|
sheet.setColumnWidth(8, 20 * 256);
|
|
sheet.setColumnWidth(9, 20 * 256);
|
|
sheet.setColumnWidth(9, 20 * 256);
|
|
- sheet.setColumnWidth(10, 20 * 256);
|
|
|
|
//设置为居中加粗
|
|
//设置为居中加粗
|
|
HSSFCellStyle headStyle = workbook.createCellStyle();
|
|
HSSFCellStyle headStyle = workbook.createCellStyle();
|
|
HSSFFont font = workbook.createFont();
|
|
HSSFFont font = workbook.createFont();
|
|
@@ -222,10 +221,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
headCell.setCellValue("是否逾期");
|
|
headCell.setCellValue("是否逾期");
|
|
headCell.setCellStyle(headStyle);
|
|
headCell.setCellStyle(headStyle);
|
|
headCell = headRow.createCell(8);
|
|
headCell = headRow.createCell(8);
|
|
- headCell.setCellValue("计划工时");
|
|
|
|
|
|
+ headCell.setCellValue("计划工时(h)");
|
|
headCell.setCellStyle(headStyle);
|
|
headCell.setCellStyle(headStyle);
|
|
- headCell = headRow.createCell(10);
|
|
|
|
- headCell.setCellValue("实际工时");
|
|
|
|
|
|
+ headCell = headRow.createCell(9);
|
|
|
|
+ headCell.setCellValue("实际工时(h)");
|
|
headCell.setCellStyle(headStyle);
|
|
headCell.setCellStyle(headStyle);
|
|
int rowNum = 1;
|
|
int rowNum = 1;
|
|
for (TimeTask task : list) {
|
|
for (TimeTask task : list) {
|
|
@@ -234,11 +233,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
row.createCell(1).setCellValue(project.getProjectName());
|
|
row.createCell(1).setCellValue(project.getProjectName());
|
|
row.createCell(2).setCellValue(task.getExecutorName());
|
|
row.createCell(2).setCellValue(task.getExecutorName());
|
|
row.createCell(3).setCellValue(dateTimeFormatter.format(task.getCreateDate()));
|
|
row.createCell(3).setCellValue(dateTimeFormatter.format(task.getCreateDate()));
|
|
- row.createCell(4).setCellValue(dateTimeFormatter.format(task.getEndDate()));
|
|
|
|
- row.createCell(5).setCellValue(dateTimeFormatter.format(task.getFinishDate()));
|
|
|
|
|
|
+ row.createCell(4).setCellValue(task.getEndDate() != null?dateTimeFormatter.format(task.getEndDate()):"");
|
|
|
|
+ row.createCell(5).setCellValue(task.getFinishDate() !=null?dateTimeFormatter.format(task.getFinishDate()):"");
|
|
row.createCell(6).setCellValue(task.getTaskStatus() == 1?"Y":"N");
|
|
row.createCell(6).setCellValue(task.getTaskStatus() == 1?"Y":"N");
|
|
boolean isExpired = false;
|
|
boolean isExpired = false;
|
|
- if (task.getTaskStatus() == 0 && !task.getEndDate().isAfter(LocalDate.now())) {
|
|
|
|
|
|
+ if (task.getTaskStatus() == 0 && task.getEndDate() !=null&& !task.getEndDate().isAfter(LocalDate.now())) {
|
|
isExpired = true;
|
|
isExpired = true;
|
|
}
|
|
}
|
|
row.createCell(7).setCellValue(isExpired?"Y":"N");
|
|
row.createCell(7).setCellValue(isExpired?"Y":"N");
|
|
@@ -255,9 +254,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
//返回生成的文件地址/upload文件夹下
|
|
//返回生成的文件地址/upload文件夹下
|
|
httpRespMsg.data = "/upload/" + fileUrlSuffix;
|
|
httpRespMsg.data = "/upload/" + fileUrlSuffix;
|
|
} catch (NullPointerException e) {
|
|
} catch (NullPointerException e) {
|
|
|
|
+ e.printStackTrace();
|
|
httpRespMsg.setError("验证失败或缺少数据");
|
|
httpRespMsg.setError("验证失败或缺少数据");
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
httpRespMsg.setError("文件生成错误");
|
|
httpRespMsg.setError("文件生成错误");
|
|
return httpRespMsg;
|
|
return httpRespMsg;
|
|
}
|
|
}
|