考勤打卡问题

This commit is contained in:
aikai 2024-05-22 11:24:54 +08:00
parent 665e99cfc5
commit bf39a38a8c
6 changed files with 24 additions and 10 deletions

View File

@ -38,11 +38,11 @@ public class AttendanceController {
return success(vo);
}
// @PostMapping("/statistics")
// @Operation(summary = "统计")
// public CommonResult<AttendancePunchVO> statistics(@RequestBody AttendancePunchDTO dto) {
// AttendancePunchVO vo = attendanceService.punch(dto);
// return success(vo);
// }
@PostMapping("/statistics")
@Operation(summary = "统计")
public CommonResult<AttendancePunchVO> statistics(@RequestBody AttendancePunchDTO dto) {
AttendancePunchVO vo = attendanceService.punch(dto);
return success(vo);
}
}

View File

@ -42,11 +42,18 @@ public class AttendancePunchPageVO {
* 应打卡时间
*/
private LocalDateTime shouldPunchTime;
/**
* 打卡归属时间 主要是为了统计夸天的
*/
private String targetDayStr;
/**
* 考勤组
*/
private AttendanceGroupDO activationGroup;
/**
* 考勤组班次id
*/
private Long attendanceGroupShiftId;
/**
* 考勤组班次
*/

View File

@ -82,6 +82,10 @@ public class AttendancePunchRecordDO extends BaseDO {
* 打卡时间
*/
private LocalDateTime punchTime;
/**
* 应打卡时间
*/
private LocalDateTime shouldPunchTime;
/**
* 打卡备注
*/

View File

@ -132,7 +132,7 @@ public class AttendanceServiceImpl implements AttendanceService {
.setFieldServiceFlag(
(AttendanceGroupDO.TRUE.equals(pageVO.getFieldworkFlag()) && AttendanceGroupDO.FALSE.equals(pageVO.getPunchPoint()))
? AttendanceGroupDO.TRUE : AttendanceGroupDO.FALSE)
.setDayTime(dto.getLocalDateTime().format(Constants.REPO_DATE_FORMAT))
.setDayTime(pageVO.getTargetDayStr())
.setShouldPunchTime(pageVO.getShouldPunchTime())
.setPunchTime(dto.getLocalDateTime())
.setRemark(dto.getRemark())
@ -190,9 +190,9 @@ public class AttendanceServiceImpl implements AttendanceService {
, Double.parseDouble(activationGroup.getLatitude()), Double.parseDouble(activationGroup.getLongitude()), activationGroup.getScope()));
// -- 获取班次
AttendanceGroupShiftDO attendanceGroupShiftDO = attendanceGroupShiftService.getGroupShift(dto.getActivationGroup().getId());
AttendanceGroupShiftDO attendanceGroupShiftDO = attendanceGroupShiftService.getGroupShift(vo.getAttendanceGroupShiftId());
// -- 获取班次item
List<AttendanceGroupShiftItemDO> attendanceGroupShiftItemDOList = attendanceGroupShiftItemService.getGroupShiftItemListByShiftId(dto.getActivationGroup().getId());
List<AttendanceGroupShiftItemDO> attendanceGroupShiftItemDOList = attendanceGroupShiftItemService.getGroupShiftItemListByShiftId(vo.getAttendanceGroupShiftId());
String key = Constants.ATTENDANCE + Constants.UNDERLINE + activationGroup.getId() + Constants.UNDERLINE; // + 时间
String mapKey = dto.getUserId().toString();
@ -252,6 +252,7 @@ public class AttendanceServiceImpl implements AttendanceService {
}
index++;
}
vo.setTargetDayStr(targetDayStr);
vo.setAttendanceOnTheDayDTOS(attendanceOnTheDayDTOS);
if (dto.getFlag()) {
vo.setRedisKey(key + targetDayStr);

View File

@ -115,6 +115,7 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
}
vo.setAttendanceGroupShiftId(attendanceFixedDO.getAttendanceGroupShiftId());
attendanceService.calculatePunch(dto, vo);
return vo;
}

View File

@ -130,6 +130,7 @@ public class AttendanceSchedulingServiceImpl implements AttendanceSchedulingServ
if (attendanceSchedulingDO == null || Constants.ONE.equals(attendanceSchedulingDO.getRestFlag()) || attendanceSchedulingDO.getAttendanceGroupShiftId() == null) {
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
}
vo.setAttendanceGroupShiftId(attendanceSchedulingDO.getAttendanceGroupShiftId());
attendanceService.calculatePunch(dto, vo);
return vo;
}