@Component
@DependsOn("flywayInitializer")
public class WorkloadInitRunner implements InitializingBean {
@Autowired
private ConsultantReserveMapper consultantReserveMapper;
@Autowired
private ConsultationConsultantWorkloadMapper consultationConsultantWorkloadMapper;
@Autowired
private ConsultationWorkForceMapper workForceMapper;
/**
* 初始化咨询工作量
*
* @throws Exception
*/
@Override
public void afterPropertiesSet() {
//初始化过就不初始化了
ConsultationConsultantWorkloadEntity one = consultationConsultantWorkloadMapper.selectOne(Wrappers.<ConsultationConsultantWorkloadEntity>lambdaQuery().last("limit 1"));
if (one != null) {
return;
}
long current = 1L;
Page<ConsultantReserveEntity> page = new Page<>(current, 500);
while (true) {
Page<ConsultantReserveEntity> entityPage = consultantReserveMapper.selectPage(page, Wrappers.<ConsultantReserveEntity>lambdaQuery()
05-13
2088
03-16
1199
02-11
3560
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交