|
|
|
@ -101,7 +101,15 @@ public class PersonResourceServiceImpl extends BaseServiceImpl<PersonResourceMap |
|
|
|
//删除3天之前的数据
|
|
|
|
//删除3天之前的数据
|
|
|
|
List<PersonResourceEntity> deleteList = this.list(Wrappers.<PersonResourceEntity>lambdaQuery().le(PersonResourceEntity::getDateTime,DateFormatUtils.format(DateUtils.addDays(date,-3),"yyyy-MM-dd"))); |
|
|
|
List<PersonResourceEntity> deleteList = this.list(Wrappers.<PersonResourceEntity>lambdaQuery().le(PersonResourceEntity::getDateTime,DateFormatUtils.format(DateUtils.addDays(date,-3),"yyyy-MM-dd"))); |
|
|
|
List<Long> idList = deleteList.stream().map(BaseEntity::getId).collect(Collectors.toList()); |
|
|
|
List<Long> idList = deleteList.stream().map(BaseEntity::getId).collect(Collectors.toList()); |
|
|
|
baseMapper.deleteByIds(idList); |
|
|
|
List<List<Long>> partitionedList = new ArrayList<>(); |
|
|
|
|
|
|
|
int size = idList.size(); |
|
|
|
|
|
|
|
for (int i = 0; i < size; i += 1000) { |
|
|
|
|
|
|
|
int end = Math.min(i + 1000, size); |
|
|
|
|
|
|
|
partitionedList.add(idList.subList(i, end)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(List<Long> sublist : partitionedList){ |
|
|
|
|
|
|
|
baseMapper.deleteByIds(sublist); |
|
|
|
|
|
|
|
} |
|
|
|
log.info("初始化人力资源结束:"+ DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
log.info("初始化人力资源结束:"+ DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|