|
@@ -257,7 +257,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", companyId));
|
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
List<Integer> projectIds = projectList.stream().distinct().map(pl -> pl.getId()).collect(Collectors.toList());
|
|
|
- List<ProjectSeparate> projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", projectIds));
|
|
|
List<ProjectVO> list = new ArrayList<>();
|
|
|
for (Project project : projectList) {
|
|
|
ProjectVO projectVO = new ProjectVO();
|
|
@@ -314,9 +313,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
projectVO.setProviderInfoList(mapList);
|
|
|
}
|
|
|
if(companyId==936){
|
|
|
- Optional<ProjectSeparate> first1 = projectSeparateList.stream().filter(ps -> ps.getId().equals(project.getId())).findFirst();
|
|
|
- if(first1.isPresent()){
|
|
|
- projectVO.setProjectSeparate(first1.get());
|
|
|
+ if(projectIds!=null){
|
|
|
+ List<ProjectSeparate> projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", projectIds));
|
|
|
+ Optional<ProjectSeparate> first1 = projectSeparateList.stream().filter(ps -> ps.getId().equals(project.getId())).findFirst();
|
|
|
+ if(first1.isPresent()){
|
|
|
+ projectVO.setProjectSeparate(first1.get());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
list.add(projectVO);
|
|
@@ -417,6 +419,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
.setTaskGpIncharge(taskGpIncharge)
|
|
|
.setProviderIds(providerIds)
|
|
|
.setProviderNames(providerNames);
|
|
|
+ ProjectMain projectMain = projectMainMapper.selectById(projectMainId);
|
|
|
+ if(projectMain!=null){
|
|
|
+ project.setCategory(projectMain.getCategoryId());
|
|
|
+ project.setCategoryName(projectMain.getCategoryName());
|
|
|
+ }
|
|
|
if (category != null) {
|
|
|
ProjectCategory projectCategory = projectCategoryMapper.selectById(category);
|
|
|
if (projectCategory != null) {
|
|
@@ -2617,6 +2624,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
//参与人
|
|
|
+ if(inchargerCell!=null){
|
|
|
+ if(participatorCell==null||StringUtils.isEmpty(participatorCell.getStringCellValue())){
|
|
|
+ String value = inchargerCell.getStringCellValue();
|
|
|
+ Participation p = new Participation();
|
|
|
+ Optional<User> first = userList.stream().filter(u -> u.getName().equals(value)).findFirst();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ p.setUserId(first.get().getId());
|
|
|
+ p.setProjectId(project.getId());
|
|
|
+ participationMapper.insert(p);
|
|
|
+ } else {
|
|
|
+ throw new Exception("参与人["+value+"]不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (participatorCell != null) {
|
|
|
String part = participatorCell.getStringCellValue().trim();
|
|
|
//将项目负责人也添加到参与人当中来
|
|
@@ -2808,14 +2829,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
/*if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
|
|
|
if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);*/
|
|
|
if (amountCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
- if (contractCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
+ if (contractCell != null)contractCell.setCellType(CellType.STRING);
|
|
|
/*if (warrantyStartDateCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
if (warrantyEndDateCell != null)amountCell.setCellType(CellType.STRING);*/
|
|
|
- if (projectCategorySubCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
- if (regionCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
- if (buCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
- if (stateCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
- if (stageCell != null)amountCell.setCellType(CellType.STRING);
|
|
|
+ if (projectCategorySubCell != null)projectCategorySubCell.setCellType(CellType.STRING);
|
|
|
+ if (regionCell != null)regionCell.setCellType(CellType.STRING);
|
|
|
+ if (buCell != null)buCell.setCellType(CellType.STRING);
|
|
|
+ if (stateCell != null)stateCell.setCellType(CellType.STRING);
|
|
|
+ if (stageCell != null)stageCell.setCellType(CellType.STRING);
|
|
|
if (nameCell == null) {//项目名称为空的直接跳过
|
|
|
throw new Exception("项目名称不能为空");
|
|
|
}
|
|
@@ -2991,7 +3012,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (endDateCell !=null && endDateCell.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
|
|
|
project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
}
|
|
|
- if (amountCell !=null && endDateCell.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
|
|
|
+ if (amountCell !=null && amountCell.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
|
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
|
}
|
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
@@ -3023,6 +3044,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Optional<ProjectMain> first = projectMainList.stream().filter(pm -> pm.getName().equals(mainName)).findFirst();
|
|
|
if(first.isPresent()){
|
|
|
project.setProjectMainId(first.get().getId());
|
|
|
+ project.setCategory(first.get().getCategoryId());
|
|
|
+ project.setCategoryName(first.get().getCategoryName());
|
|
|
}else {
|
|
|
msg.setError("主项目["+mainName+"]不存在");
|
|
|
return msg;
|
|
@@ -3066,6 +3089,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
importCount++;
|
|
|
//参与人
|
|
|
+ if(inchargerCell!=null){
|
|
|
+ if(participatorCell==null||StringUtils.isEmpty(participatorCell.getStringCellValue())){
|
|
|
+ String value = inchargerCell.getStringCellValue();
|
|
|
+ Participation p = new Participation();
|
|
|
+ Optional<User> first = userList.stream().filter(u -> u.getName().equals(value)).findFirst();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ p.setUserId(first.get().getId());
|
|
|
+ p.setProjectId(project.getId());
|
|
|
+ participationMapper.insert(p);
|
|
|
+ } else {
|
|
|
+ throw new Exception("参与人["+value+"]不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (participatorCell != null) {
|
|
|
String part = participatorCell.getStringCellValue().trim();
|
|
|
//将项目负责人也添加到参与人当中来
|