Commit 5f45b625 authored by nie'hong's avatar nie'hong

完善工时统计

parent ba04204a
......@@ -244,8 +244,8 @@
</foreach>
OR t.project_id IS null)
</if>
<if test="startTime != null">
AND work_day >= #{startTime}
<if test="firstDayOfMonth != null">
AND work_day >= #{firstDayOfMonth}
</if>
<if test="deptId != null">
AND t.dept_id = #{deptId}
......
......@@ -317,7 +317,10 @@ public class StatisticsServiceImpl implements StatisticsService {
// 部门和中心级别
if (role.contains(ManagerEnum.IS_DEPARTMENT_DIRECTOR.getCode()) || role.contains(ManagerEnum.IS_CENTRE_DIRECTOR.getCode())) {
// 清除查询条件
map.clear();
map.remove("projectIds");
map.remove("centreId");
types.clear();
// 请假、调休、外部商务、技术交流,内部培训、技术准备、管理,其他非项目/商机工作
for (WorkType workType : workTypes) {
// 查询条件排除项目和商机
......@@ -326,12 +329,13 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
// 用户仅为部门管理
// 用户仅为部门管理,以部门主键作为查询条件之一,否则中心级别查询所有部门
if (role.contains(ManagerEnum.IS_DEPARTMENT_DIRECTOR.getCode()) && role.size() == 1) {
map.put("deptId", user.getDeptId());
}
map.put("types", types);
List<WorkTimeAndCostCollect> workTimeAndCostCollect = workTimeOrderMapper.getWorkTimeAndCostCollect(map);
// 将查询结果封装在一起
collect.addAll(workTimeAndCostCollect);
......@@ -505,7 +509,6 @@ public class StatisticsServiceImpl implements StatisticsService {
if (role.contains(ManagerEnum.IS_CENTRE_DIRECTOR.getCode()) && deptId == null) {
deptId = DEFAULT_DEPT_ID;
}
// 默认统计截至时间为前一天
if (StringUtil.isEmpty(endDate)) {
Date date = new Date();
......@@ -627,6 +630,7 @@ public class StatisticsServiceImpl implements StatisticsService {
statisticsDateAndWorkTime1.setCost(cost);
statisticsDateAndWorkTimes.add(statisticsDateAndWorkTime1);
}
return projectStatistics;
}
......
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