|
|
|
|
@ -34,7 +34,6 @@ import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils; |
|
|
|
|
import org.apache.commons.lang3.time.DateUtils; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.PersonAbilityEntity; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.PersonResourceEntity; |
|
|
|
|
@ -51,7 +50,6 @@ import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 工艺能力表 服务实现类 |
|
|
|
|
@ -99,17 +97,7 @@ 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()); |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
baseMapper.deleteByDateTime(); |
|
|
|
|
log.info("初始化人力资源结束:"+ DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|