Commit 35b86997 authored by nie'hong's avatar nie'hong

完善工时统计

parent 5d7e19ff
......@@ -430,6 +430,10 @@ public class StatisticsServiceImpl implements StatisticsService {
row1.createCell(0).setCellValue("序号");
row1.createCell(1).setCellValue("部门名称");
row1.createCell(2).setCellValue("姓名");
row1.getCell(0).setCellStyle(cellStyle);
row1.getCell(1).setCellStyle(cellStyle);
row1.getCell(2).setCellStyle(cellStyle);
for (int i = 1; i <= dayCount; i++) {
HSSFCell cell = row1.createCell(2 + i);
cell.setCellValue(i + "日");
......@@ -448,10 +452,13 @@ public class StatisticsServiceImpl implements StatisticsService {
HSSFRow row_i = sheet.createRow(i);
// 序号
row_i.createCell(0).setCellValue(i);
row_i.getCell(0).setCellStyle(cellStyle);
// 部门名称
row_i.createCell(1).setCellValue(next.getDeptName());
row_i.getCell(1).setCellStyle(cellStyle);
// 姓名
row_i.createCell(2).setCellValue(next.getUserName());
row_i.getCell(2).setCellStyle(cellStyle);
// 日期与工时集合
List<DayWorkTimeAndType> timeAndTypes = next.getDayWorkTimeAndTypeList();
// 在excel中对应日期单元格添加工时
......@@ -907,18 +914,18 @@ public class StatisticsServiceImpl implements StatisticsService {
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderBottom(BorderStyle.THIN);
//设置下边框的边框线颜色(颜色和上述的颜色对照表是一样的)
cellStyle.setBottomBorderColor(IndexedColors.SKY_BLUE.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.GREY_80_PERCENT.getIndex());
//左边框
cellStyle.setLeftBorderColor(IndexedColors.SKY_BLUE.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.GREY_80_PERCENT.getIndex());
//上边框
cellStyle.setRightBorderColor(IndexedColors.SKY_BLUE.getIndex());
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.GREY_80_PERCENT.getIndex());
//右边框
cellStyle.setTopBorderColor(IndexedColors.SKY_BLUE.getIndex());
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.GREY_80_PERCENT.getIndex());
// 自动换行
cellStyle.setWrapText(true);
return cellStyle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment