Commit 463f9227 authored by nie'hong's avatar nie'hong

完善工时统计

parent 0e036896
......@@ -51,7 +51,7 @@
<update id="updateIsConclusionById">
UPDATE
<include refid="table"/>
SET is_conclusion = 0
SET is_conclusion = 0, modify_time = now()
WHERE id = #{id}
</update>
<update id="updateProject">
......@@ -224,6 +224,9 @@
<if test="managerId != null and deptId == null">
AND manager_id = #{managerId}
</if>
<if test="year != null">
AND YEAR (create_time) &lt;= #{year} AND( (is_conclusion = 0 AND year(modify_time) >= #{year}) or (is_conclusion = 1))
</if>
</where>
</select>
......
......@@ -679,7 +679,9 @@ public class StatisticsServiceImpl implements StatisticsService {
} else if (rank.contains(LevelRankEnum.DEPARTMENT_LEVEL.getRank())) {
// 查询部门下所有项目,部门主键是用户的部门主键,当前权限最高级别为部门级别
map.put("deptId", deptId);
map.put("managerId", userId);
if (rank.contains(LevelRankEnum.PROJECT_LEVEL.getRank())) {
map.put("managerId", userId);
}
} else {
// 项目/商机级别,以项目管理查询
map.put("managerId", userId);
......@@ -703,23 +705,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 = "";
......@@ -900,6 +902,12 @@ public class StatisticsServiceImpl implements StatisticsService {
CellRangeAddress cellRangeAddress2 = new CellRangeAddress(1, 2, 1, 1);
sheet1.addMergedRegion(cellRangeAddress2);
setBorderStyle(BorderStyle.THIN, cellRangeAddress2, sheet1);
// 项目名后的合计
short lastCellNum1 = row_1.getLastCellNum();
CellRangeAddress cellRangeAddress6 = new CellRangeAddress(1, 2, lastCellNum1 - 1, lastCellNum1 - 1);
sheet1.addMergedRegion(cellRangeAddress6);
setBorderStyle(BorderStyle.THIN, cellRangeAddress6, sheet1);
// 合计行
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(userWorkTimeStatisticsReport.size() + 1, userWorkTimeStatisticsReport.size() + 1, 0, 1);
sheet1.addMergedRegion(cellRangeAddress3);
......
......@@ -168,7 +168,6 @@ public class StatisticsController extends BaseController {
}
@ApiOperation(value = "导出项目统计明细", notes = "导出项目明细表")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId",value = "用户主键"),
......
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