Commit 7b4ded1d authored by 赵啸非's avatar 赵啸非

修改考勤汇总

parent 42bfbb35
......@@ -111,26 +111,19 @@ public class TestController {
DeptEntity deptEntity = deptService.get(deptId);
updateDeptPersonNum(deptEntity);
});
return "ok";
}
private void updateDeptPersonNum(DeptEntity deptEntity) {
if(ObjectUtils.isEmpty(deptEntity.getParentId())){
if(!ObjectUtils.isEmpty(deptEntity.getParentId())){
int sum = deptService.find(new DeptQuery().parentId(deptEntity.getId())).stream().mapToInt(i -> i.getPersonNum()).sum();
DeptEntity parentDept = deptService.get(deptEntity.getParentId());
if(ObjectUtils.isEmpty(parentDept)){
parentDept.setPersonNum(sum);
deptService.update(parentDept);
updateDeptPersonNum(parentDept);
}
}
}
......
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