Commit 34b9ba79 authored by nie'hong's avatar nie'hong

完善工时统计

parent 97c07cfd
......@@ -167,7 +167,7 @@ public class StatisticsServiceImpl implements StatisticsService {
map.remove("status");
map.remove("startModifyTime");
//待审核包括:新提交和重新提交的
// 待审核包括:新提交和重新提交的
List<Integer> statusArray = new ArrayList<>();
statusArray.add(WorkOrderStatus.WAIT_AUDIT.getCode());
statusArray.add(WorkOrderStatus.RE_SUBMIT.getCode());
......@@ -175,11 +175,9 @@ public class StatisticsServiceImpl implements StatisticsService {
map.put("startWorkDay", firstDayOfMonth);
map.put("statusArray", statusArray);
// 用户在该权限对应的级别
List<Integer> rank = this.getUserRank(roleUserLevel, LevelEnum.EXAMINE.getLevelName());
// 项目和商机的未审批的数
// 项目和商机的待审核的数
Integer notCompletedCount1 = 0;
// 项目商机级别,查询用户负责项目商机未审批条数
if (rank.contains(LevelRankEnum.PROJECT_LEVEL.getRank())) {
......@@ -705,23 +703,23 @@ public class StatisticsServiceImpl implements StatisticsService {
List<ProjectStatisticsByMonth> projectStatisticsByMonths1 = workProjectTimeCostMapper.selectListStatistics(map);
// 将在查询时间端内未存在填报信息的项目补齐
if (projectId == null) {
// 查询项目
List<WorkProject> projects = workProjectMapper.getListByCriteria(map);
// 查询统计结果中的项目主键
List<Integer> queryProjectId = projectStatisticsByMonths1.stream().map(ProjectStatisticsByMonth::getProjectId).collect(Collectors.toList());
for (WorkProject project : projects) {
// 如果在查询结果中未存在所管理的项目,新建对象加入统计
if (!queryProjectId.contains(project.getId())) {
ProjectStatisticsByMonth projectStatisticsByMonth = new ProjectStatisticsByMonth();
projectStatisticsByMonth.setProjectName(project.getProjectName());
projectStatisticsByMonth.setProjectId(project.getId());
List<ProjectStatisticsByMonth.StatisticsDateAndWorkTime> statisticsDateAndWorkTimes = new ArrayList<>();
projectStatisticsByMonth.setStatisticsDateAndWorkTimes(statisticsDateAndWorkTimes);
projectStatisticsByMonths1.add(projectStatisticsByMonth);
}
}
}
// if (projectId == null) {
// // 查询项目
// List<WorkProject> projects = workProjectMapper.getListByCriteria(map);
// // 查询统计结果中的项目主键
// List<Integer> queryProjectId = projectStatisticsByMonths1.stream().map(ProjectStatisticsByMonth::getProjectId).collect(Collectors.toList());
// for (WorkProject project : projects) {
// // 如果在查询结果中未存在所管理的项目,新建对象加入统计
// if (!queryProjectId.contains(project.getId())) {
// ProjectStatisticsByMonth projectStatisticsByMonth = new ProjectStatisticsByMonth();
// projectStatisticsByMonth.setProjectName(project.getProjectName());
// projectStatisticsByMonth.setProjectId(project.getId());
// List<ProjectStatisticsByMonth.StatisticsDateAndWorkTime> statisticsDateAndWorkTimes = new ArrayList<>();
// projectStatisticsByMonth.setStatisticsDateAndWorkTimes(statisticsDateAndWorkTimes);
// projectStatisticsByMonths1.add(projectStatisticsByMonth);
// }
// }
// }
String startDate = "";
......@@ -776,7 +774,7 @@ public class StatisticsServiceImpl implements StatisticsService {
HSSFRow row0 = sheet1.createRow(0);
HSSFCell row0Cell0 = row0.createCell(0);
row0Cell0.setCellValue("部门:" + dept.getDeptName() + " 时间:" + statisticsStart + "-" + statisticsEnd);
row0.setHeight((short) 500);
// 获取合计,写入项目名称和正常工时加班工时表头,除开请假和调休,这两种类型没有正常和加班之分
UserWorkTimeStatisticsByProject userWorkTimeStatisticsByProject = userWorkTimeStatisticsReport.get(userWorkTimeStatisticsReport.size() - 1);
......@@ -932,11 +930,11 @@ public class StatisticsServiceImpl implements StatisticsService {
}
sheet1.getRow(0).getCell(0).setCellStyle(ordinaryCellStyle1);
// 设置姓名\单位(小时)单元格样式,左对齐
// 设置姓名\单位(小时)单元格样式,左对齐
HSSFCellStyle ordinaryCellStyle3 = this.createOrdinaryCellStyle(sheets);
ordinaryCellStyle3.setAlignment(HorizontalAlignment.LEFT);
row_1Cell2.setCellStyle(ordinaryCellStyle3);
sheet1.setZoom(8,5);
this.closeSheets(sheets);
return sheets;
}
......
......@@ -102,9 +102,8 @@ public class StatisticsController extends BaseController {
String deptName = sheets.getSheet("Sheet1").getRow(1).getCell(1).getStringCellValue();
// 文件名
String fileName = deptName + "-" + param.getYear() + "年" + param.getMonth() + "月工时汇总";
this.downExcel(response,sheets,fileName);
this.downExcel(response,sheets,fileName);
}finally {
try {
sheets.close();
......
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