| | |
| | | clockInStatistic.setRoleName(roleName); |
| | | } |
| | | } |
| | | Integer shouldClockInDays = clockInStatistic.getShouldClockInDays(); |
| | | Integer clockInDays = clockInStatistic.getClockInDays(); |
| | | Integer lateEarly = clockInStatistic.getLateEarly(); |
| | | clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly); |
| | | } |
| | | pageInfo.setRecords(clockInStatistics); |
| | | return pageInfo; |
| | |
| | | clockInStatistic.setRoleName(roleName); |
| | | } |
| | | } |
| | | Integer shouldClockInDays = clockInStatistic.getShouldClockInDays(); |
| | | Integer clockInDays = clockInStatistic.getClockInDays(); |
| | | Integer lateEarly = clockInStatistic.getLateEarly(); |
| | | clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays - lateEarly); |
| | | } |
| | | |
| | | ExcelUtil<ClockInStatisticsDto> excel = new ExcelUtil<ClockInStatisticsDto>(ClockInStatisticsDto.class); |
| | |
| | | dto.setList(pageInfo); |
| | | XpOperationsUser xpOperationsUser = xpOperationUserClient.queryById(query.getAppUserId()).getData(); |
| | | List<Long> longList = fleetOperationsClient.getFleetIdsByUserId(xpOperationsUser.getId()).getData(); |
| | | List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleetId", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime)); |
| | | QueryWrapper<XpClockIn> last1 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 1 or clock_out_result = 1)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | QueryWrapper<XpClockIn> last2 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 2 or clock_out_result = 2)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | QueryWrapper<XpClockIn> last3 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 3 or clock_out_result = 3)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleet_id", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime)); |
| | | dto.setShouldClockInCount(list.size() * 2); |
| | | dto.setNormalClockInCount(this.count(last1)); |
| | | dto.setLateClockInCount(this.count(last2)); |
| | | dto.setMissingClockInCount(this.count(last3)); |
| | | dto.setNormalClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(1, query.getAppUserId(), startTime, endTime)); |
| | | dto.setLateClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(2, query.getAppUserId(), startTime, endTime)); |
| | | dto.setMissingClockInCount(this.baseMapper.getClockInStatisticsDetailsCount(3, query.getAppUserId(), startTime, endTime)); |
| | | return dto; |
| | | } |
| | | |