功能修改-sjx

liweidong
sunjianxi 2 weeks ago
parent 52ac4955d6
commit fd195787e7
  1. 10
      blade-service/blade-scheduling/src/main/java/org/springblade/scheduling/scheduling/service/impl/PersonResourceServiceImpl.java

@ -101,7 +101,15 @@ public class PersonResourceServiceImpl extends BaseServiceImpl<PersonResourceMap
//删除3天之前的数据
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());
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"));
}

Loading…
Cancel
Save