考勤打卡问题
This commit is contained in:
parent
665e99cfc5
commit
bf39a38a8c
@ -38,11 +38,11 @@ public class AttendanceController {
|
|||||||
return success(vo);
|
return success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PostMapping("/statistics")
|
@PostMapping("/statistics")
|
||||||
// @Operation(summary = "统计")
|
@Operation(summary = "统计")
|
||||||
// public CommonResult<AttendancePunchVO> statistics(@RequestBody AttendancePunchDTO dto) {
|
public CommonResult<AttendancePunchVO> statistics(@RequestBody AttendancePunchDTO dto) {
|
||||||
// AttendancePunchVO vo = attendanceService.punch(dto);
|
AttendancePunchVO vo = attendanceService.punch(dto);
|
||||||
// return success(vo);
|
return success(vo);
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,18 @@ public class AttendancePunchPageVO {
|
|||||||
* 应打卡时间
|
* 应打卡时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime shouldPunchTime;
|
private LocalDateTime shouldPunchTime;
|
||||||
|
/**
|
||||||
|
* 打卡归属时间 (主要是为了统计夸天的)
|
||||||
|
*/
|
||||||
|
private String targetDayStr;
|
||||||
/**
|
/**
|
||||||
* 考勤组
|
* 考勤组
|
||||||
*/
|
*/
|
||||||
private AttendanceGroupDO activationGroup;
|
private AttendanceGroupDO activationGroup;
|
||||||
|
/**
|
||||||
|
* 考勤组班次id
|
||||||
|
*/
|
||||||
|
private Long attendanceGroupShiftId;
|
||||||
/**
|
/**
|
||||||
* 考勤组班次
|
* 考勤组班次
|
||||||
*/
|
*/
|
||||||
|
@ -82,6 +82,10 @@ public class AttendancePunchRecordDO extends BaseDO {
|
|||||||
* 打卡时间
|
* 打卡时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime punchTime;
|
private LocalDateTime punchTime;
|
||||||
|
/**
|
||||||
|
* 应打卡时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime shouldPunchTime;
|
||||||
/**
|
/**
|
||||||
* 打卡备注
|
* 打卡备注
|
||||||
*/
|
*/
|
||||||
|
@ -132,7 +132,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
.setFieldServiceFlag(
|
.setFieldServiceFlag(
|
||||||
(AttendanceGroupDO.TRUE.equals(pageVO.getFieldworkFlag()) && AttendanceGroupDO.FALSE.equals(pageVO.getPunchPoint()))
|
(AttendanceGroupDO.TRUE.equals(pageVO.getFieldworkFlag()) && AttendanceGroupDO.FALSE.equals(pageVO.getPunchPoint()))
|
||||||
? AttendanceGroupDO.TRUE : AttendanceGroupDO.FALSE)
|
? AttendanceGroupDO.TRUE : AttendanceGroupDO.FALSE)
|
||||||
.setDayTime(dto.getLocalDateTime().format(Constants.REPO_DATE_FORMAT))
|
.setDayTime(pageVO.getTargetDayStr())
|
||||||
.setShouldPunchTime(pageVO.getShouldPunchTime())
|
.setShouldPunchTime(pageVO.getShouldPunchTime())
|
||||||
.setPunchTime(dto.getLocalDateTime())
|
.setPunchTime(dto.getLocalDateTime())
|
||||||
.setRemark(dto.getRemark())
|
.setRemark(dto.getRemark())
|
||||||
@ -190,9 +190,9 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
, Double.parseDouble(activationGroup.getLatitude()), Double.parseDouble(activationGroup.getLongitude()), activationGroup.getScope()));
|
, Double.parseDouble(activationGroup.getLatitude()), Double.parseDouble(activationGroup.getLongitude()), activationGroup.getScope()));
|
||||||
|
|
||||||
// -- 获取班次
|
// -- 获取班次
|
||||||
AttendanceGroupShiftDO attendanceGroupShiftDO = attendanceGroupShiftService.getGroupShift(dto.getActivationGroup().getId());
|
AttendanceGroupShiftDO attendanceGroupShiftDO = attendanceGroupShiftService.getGroupShift(vo.getAttendanceGroupShiftId());
|
||||||
// -- 获取班次item
|
// -- 获取班次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 key = Constants.ATTENDANCE + Constants.UNDERLINE + activationGroup.getId() + Constants.UNDERLINE; // + 时间
|
||||||
String mapKey = dto.getUserId().toString();
|
String mapKey = dto.getUserId().toString();
|
||||||
@ -252,6 +252,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
vo.setTargetDayStr(targetDayStr);
|
||||||
vo.setAttendanceOnTheDayDTOS(attendanceOnTheDayDTOS);
|
vo.setAttendanceOnTheDayDTOS(attendanceOnTheDayDTOS);
|
||||||
if (dto.getFlag()) {
|
if (dto.getFlag()) {
|
||||||
vo.setRedisKey(key + targetDayStr);
|
vo.setRedisKey(key + targetDayStr);
|
||||||
|
@ -115,6 +115,7 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
|||||||
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
|
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
|
||||||
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
|
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
|
||||||
}
|
}
|
||||||
|
vo.setAttendanceGroupShiftId(attendanceFixedDO.getAttendanceGroupShiftId());
|
||||||
attendanceService.calculatePunch(dto, vo);
|
attendanceService.calculatePunch(dto, vo);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ public class AttendanceSchedulingServiceImpl implements AttendanceSchedulingServ
|
|||||||
if (attendanceSchedulingDO == null || Constants.ONE.equals(attendanceSchedulingDO.getRestFlag()) || attendanceSchedulingDO.getAttendanceGroupShiftId() == null) {
|
if (attendanceSchedulingDO == null || Constants.ONE.equals(attendanceSchedulingDO.getRestFlag()) || attendanceSchedulingDO.getAttendanceGroupShiftId() == null) {
|
||||||
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
|
return vo.setTodayNeedAttendance(AttendanceGroupDO.FALSE);
|
||||||
}
|
}
|
||||||
|
vo.setAttendanceGroupShiftId(attendanceSchedulingDO.getAttendanceGroupShiftId());
|
||||||
attendanceService.calculatePunch(dto, vo);
|
attendanceService.calculatePunch(dto, vo);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user