|
@@ -3,8 +3,10 @@ package com.migao.config.listener;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.migao.entity.po.Dictionary;
|
|
|
+import com.migao.entity.po.ProjectStage;
|
|
|
import com.migao.entity.po.Role;
|
|
|
import com.migao.mapper.DictionaryMapper;
|
|
|
+import com.migao.mapper.ProjectStageMapper;
|
|
|
import com.migao.mapper.RoleMapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.context.ApplicationListener;
|
|
@@ -24,6 +26,8 @@ public class InitializeListener implements ApplicationListener<ContextRefreshedE
|
|
|
private RoleMapper roleMapper;
|
|
|
@Resource
|
|
|
private DictionaryMapper dictionaryMapper;
|
|
|
+ @Resource
|
|
|
+ private ProjectStageMapper projectStageMapper;
|
|
|
|
|
|
@Override
|
|
|
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
|
|
@@ -38,6 +42,11 @@ public class InitializeListener implements ApplicationListener<ContextRefreshedE
|
|
|
if (dictionaryList.size()<=0){
|
|
|
dictionaryMapper.insertAll();
|
|
|
}
|
|
|
+ //默认项目阶段配置
|
|
|
+ List<ProjectStage> projectStageList = projectStageMapper.selectList(Wrappers.emptyWrapper());
|
|
|
+ if (projectStageList.size()<=0){
|
|
|
+ projectStageMapper.insertAll();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|