Commit 67e21ccf authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 9a438c73
...@@ -139,21 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -139,21 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
attendanceStatEntity.setHomeLeave(balanceEntity.getHomeLeave()); attendanceStatEntity.setHomeLeave(balanceEntity.getHomeLeave());
attendanceStatEntity.setPersonalLeave(balanceEntity.getPersonalLeaveDays()); attendanceStatEntity.setPersonalLeave(balanceEntity.getPersonalLeaveDays());
attendanceStatService.save(attendanceStatEntity); attendanceStatService.save(attendanceStatEntity);
//统计各级部门员工数量 todo 优化统计
if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if (split.length > 1) {
String ancestor = split[1];
String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
if (Objects.nonNull(deptEntity2)) {
deptEntity2.setPersonNum(deptEntity2.getPersonNum() + 1);
deptService.update(deptEntity2);
}
}
}
}
} else { } else {
//更新 //更新
if (!ObjectUtils.isEmpty(deptEntity)) { if (!ObjectUtils.isEmpty(deptEntity)) {
...@@ -170,21 +156,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -170,21 +156,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setUpdateUserId(1L); staffEntity.setUpdateUserId(1L);
staffEntity.setUpdateTime(new Date()); staffEntity.setUpdateTime(new Date());
staffService.update(staffEntity); staffService.update(staffEntity);
//统计各级部门员工数量
if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if(split.length>1){
String ancestor = split[1];
String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
if (Objects.nonNull(deptEntity2)) {
deptEntity2.setPersonNum(deptEntity2.getPersonNum() + 1);
deptService.update(deptEntity2);
}
}
}
}
} }
} }
} }
......
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