|
|
@@ -362,6 +362,18 @@ public class PunchInManagerImpl implements IPunchInManager {
|
|
|
updatePiTask.setId(piTask.getId());
|
|
|
updatePiTask.setTaskStatus(VersionStatusEnum.ARCHIVE);
|
|
|
piTaskService.update(updatePiTask);
|
|
|
+
|
|
|
+ // 切换打卡模式删除当前旧打卡数据
|
|
|
+ if (!piTask.getPunchInMethod().equals(addPiTask.getPunchInMethod())) {
|
|
|
+ PiTaskHistoryQuery piTaskHistoryQuery = new PiTaskHistoryQuery();
|
|
|
+ piTaskHistoryQuery.setTaskUniqueIds(Arrays.asList(piTask.getUniqueId()));
|
|
|
+ piTaskHistoryQuery.setPunchInDate(LocalDate.now().toString());
|
|
|
+ List<PiTaskHistory> piTaskHistories = piTaskHistoryService.queryByCondition(piTaskHistoryQuery);
|
|
|
+ if (!CollectionUtils.isEmpty(piTaskHistories)) {
|
|
|
+ Set<Long> piTaskHistoryIds = piTaskHistories.stream().map(PiTaskHistory::getId).collect(Collectors.toSet());
|
|
|
+ piTaskHistoryService.deleteByIds(piTaskHistoryIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 保存数据
|
|
|
@@ -402,7 +414,7 @@ public class PunchInManagerImpl implements IPunchInManager {
|
|
|
}
|
|
|
|
|
|
// 清除缓存
|
|
|
- clearCache(currentUserId, false, false);
|
|
|
+ clearCache(currentUserId, true, true);
|
|
|
}
|
|
|
|
|
|
@Override
|