团队统计
This commit is contained in:
parent
cd8bcd203b
commit
628682bb8d
@ -29,11 +29,15 @@ public class TeamAttendanceStatisticsByCycleVO {
|
||||
@Schema(description = "外勤")
|
||||
private List<TeamAttendancePunchStatisticsVO> fieldServiceList;
|
||||
|
||||
@Schema(description = "顶部")
|
||||
private TeamAttendanceStatisticsNumVO teamAttendanceStatisticsNumVO;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class TeamAttendanceStatisticsNumVO {
|
||||
@Schema(description = "平均工时")
|
||||
private BigDecimal averageWorkingHours;
|
||||
private Long averageWorkingHours;
|
||||
|
||||
@Schema(description = "迟到次数")
|
||||
private Integer beLateNum;
|
||||
|
@ -687,12 +687,24 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
fieldServiceList.add(averageWorkingHourVO.setTop(calculateNum.getTotalFieldServiceNumber() + "次").setDown(""));
|
||||
}
|
||||
}
|
||||
|
||||
vo.setAverageWorkingHoursList(averageWorkingHours);
|
||||
vo.setBeLateList(beLateList);
|
||||
vo.setLeaveEarlyList(leaveEarlyList);
|
||||
vo.setMissingCardList(missingCardList);
|
||||
vo.setAbsenteeismList(absenteeismList);
|
||||
vo.setFieldServiceList(fieldServiceList);
|
||||
int sum = averageWorkingHours.stream().mapToInt(a -> a.getCalculateNum().getTotalAttendanceDays()).sum();
|
||||
vo.setTeamAttendanceStatisticsNumVO(new TeamAttendanceStatisticsByCycleVO.TeamAttendanceStatisticsNumVO()
|
||||
.setAverageWorkingHours(
|
||||
sum == 0 ? 0 : averageWorkingHours.stream().mapToLong(a -> a.getCalculateNum().getTotalWorkingHours()).sum() / sum
|
||||
)
|
||||
.setBeLateNum(beLateList.stream().mapToInt(a -> a.getCalculateNum().getTotalLateArrivalsNumber()).sum())
|
||||
.setLeaveEarlyNum(leaveEarlyList.stream().mapToInt(a -> a.getCalculateNum().getTotalEarlyDeparturesNumber()).sum())
|
||||
.setMissingCardNum(missingCardList.stream().mapToInt(a -> a.getCalculateNum().getTotalMissingCardsNumber()).sum())
|
||||
.setAbsenteeismNum(absenteeismList.stream().mapToInt(a -> a.getCalculateNum().getTotalMinerDays()).sum())
|
||||
.setFieldServiceNum(fieldServiceList.stream().mapToInt(a -> a.getCalculateNum().getTotalFieldServiceNumber()).sum())
|
||||
);
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user