|
@@ -584,10 +584,29 @@ public class DataCollectTask {
|
|
}
|
|
}
|
|
if(!CollectionUtils.isEmpty(toAddList)){
|
|
if(!CollectionUtils.isEmpty(toAddList)){
|
|
for (Project project : toAddList) {
|
|
for (Project project : toAddList) {
|
|
- projectMapper.insert(project);
|
|
|
|
- if (company.getPackageProject() == 1) {
|
|
|
|
- initGroup(specialCompanyId,project.getId());
|
|
|
|
|
|
+ ProjectCategory category = projectCategoryMapper.selectOne(new LambdaQueryWrapper<ProjectCategory>()
|
|
|
|
+ .eq(ProjectCategory::getCompanyId, specialCompanyId)
|
|
|
|
+ .eq(ProjectCategory::getName, project.getCategoryName())
|
|
|
|
+ .last(" limit 1 ")
|
|
|
|
+ );
|
|
|
|
+ int categoryId;
|
|
|
|
+ if(null != category){
|
|
|
|
+ categoryId = category.getId();
|
|
|
|
+ }else{
|
|
|
|
+ ProjectCategory tmp = new ProjectCategory();
|
|
|
|
+ tmp.setName(project.getCategoryName());
|
|
|
|
+ tmp.setCompanyId(specialCompanyId);
|
|
|
|
+ projectCategoryMapper.insert(tmp);
|
|
|
|
+ categoryId = tmp.getId();
|
|
}
|
|
}
|
|
|
|
+ if(0!= categoryId){
|
|
|
|
+ project.setCategory(categoryId);
|
|
|
|
+ projectMapper.insert(project);
|
|
|
|
+ if (company.getPackageProject() == 1) {
|
|
|
|
+ initGroup(specialCompanyId,project.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
// projectMapper.batchInsert(toAddList);
|
|
// projectMapper.batchInsert(toAddList);
|
|
}
|
|
}
|