|
@@ -3902,16 +3902,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
//跳过第一行标题
|
|
//跳过第一行标题
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- //检查项目是否存在
|
|
|
|
- List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
|
|
|
|
- if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
|
|
|
|
- Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
|
|
|
|
- if(!category.isPresent()){
|
|
|
|
- throw new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
|
|
|
|
- }
|
|
|
|
- project.setCategory(category.get().getId());
|
|
|
|
- project.setCategoryName(categoryCell.getStringCellValue());
|
|
|
|
- }
|
|
|
|
//检查编号是否已经存在
|
|
//检查编号是否已经存在
|
|
if (!StringUtils.isEmpty(code)) {
|
|
if (!StringUtils.isEmpty(code)) {
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
@@ -3927,6 +3917,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
project.setProjectCode(code);
|
|
project.setProjectCode(code);
|
|
}
|
|
}
|
|
|
|
+ //检查项目分类是否存在
|
|
|
|
+ List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
|
|
|
|
+ if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
|
|
|
|
+ Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
|
|
|
|
+ if(!category.isPresent()){
|
|
|
|
+ throw new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
|
|
|
|
+ }
|
|
|
|
+ project.setCategory(category.get().getId());
|
|
|
|
+ project.setCategoryName(categoryCell.getStringCellValue());
|
|
|
|
+ }
|
|
String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
project.setCompanyId(user.getCompanyId());
|
|
project.setCompanyId(user.getCompanyId());
|
|
project.setCreatorId(userId);
|
|
project.setCreatorId(userId);
|
|
@@ -4712,17 +4712,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
//跳过第一行标题
|
|
//跳过第一行标题
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- //检查项目是否存在
|
|
|
|
- List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
|
|
|
|
- if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
|
|
|
|
- HSSFCell finalCategoryCell = categoryCell;
|
|
|
|
- Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(finalCategoryCell.getStringCellValue())).findFirst();
|
|
|
|
- if(!category.isPresent()){
|
|
|
|
- throw new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
|
|
|
|
- }
|
|
|
|
- project.setCategory(category.get().getId());
|
|
|
|
- project.setCategoryName(categoryCell.getStringCellValue());
|
|
|
|
- }
|
|
|
|
//检查编号是否已经存在
|
|
//检查编号是否已经存在
|
|
if (!StringUtils.isEmpty(code)) {
|
|
if (!StringUtils.isEmpty(code)) {
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
@@ -4738,6 +4727,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
project.setProjectCode(code);
|
|
project.setProjectCode(code);
|
|
}
|
|
}
|
|
|
|
+ //检查项目编号是否存在
|
|
|
|
+ List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
|
|
|
|
+ if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
|
|
|
|
+ HSSFCell finalCategoryCell = categoryCell;
|
|
|
|
+ Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(finalCategoryCell.getStringCellValue())).findFirst();
|
|
|
|
+ if(!category.isPresent()){
|
|
|
|
+ throw new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
|
|
|
|
+ }
|
|
|
|
+ project.setCategory(category.get().getId());
|
|
|
|
+ project.setCategoryName(categoryCell.getStringCellValue());
|
|
|
|
+ }
|
|
String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
project.setCompanyId(user.getCompanyId());
|
|
project.setCompanyId(user.getCompanyId());
|
|
project.setCreatorId(userId);
|
|
project.setCreatorId(userId);
|