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

完善工时统计

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