|
@@ -2773,6 +2773,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
inputStream.close();
|
|
inputStream.close();
|
|
outputStream.close();
|
|
outputStream.close();
|
|
if(fileName.endsWith(".xlsx")){
|
|
if(fileName.endsWith(".xlsx")){
|
|
|
|
+ if(!fileName.endsWith(".xlsx")){
|
|
|
|
+ msg.setError("文件格式错误,请使用’.xlsx’格式");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
//然后解析表格
|
|
//然后解析表格
|
|
XSSFWorkbook workbook = new XSSFWorkbook(file);
|
|
XSSFWorkbook workbook = new XSSFWorkbook(file);
|
|
//我们只需要第一个sheet
|
|
//我们只需要第一个sheet
|
|
@@ -3000,6 +3004,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
operationRecord.setContent("导入了"+importCount+"条项目数据");
|
|
operationRecord.setContent("导入了"+importCount+"条项目数据");
|
|
operationRecordService.save(operationRecord);
|
|
operationRecordService.save(operationRecord);
|
|
}else if(fileName.endsWith(".xls")){
|
|
}else if(fileName.endsWith(".xls")){
|
|
|
|
+ if(!fileName.endsWith(".xls")){
|
|
|
|
+ msg.setError("文件格式错误,请使用’.xlsx’格式");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
//然后解析表格
|
|
//然后解析表格
|
|
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
|
|
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
|
|
//我们只需要第一个sheet
|
|
//我们只需要第一个sheet
|
|
@@ -3523,13 +3531,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
ProjectKeyNodesSetting projectKeyNodesSetting = projectKeyNodesSettingList.get(x);
|
|
ProjectKeyNodesSetting projectKeyNodesSetting = projectKeyNodesSettingList.get(x);
|
|
Optional<ProjectKeyNodes> first = nodes.stream().filter(ns -> ns.getNodesId().equals(projectKeyNodesSetting.getId())).findFirst();
|
|
Optional<ProjectKeyNodes> first = nodes.stream().filter(ns -> ns.getNodesId().equals(projectKeyNodesSetting.getId())).findFirst();
|
|
ProjectKeyNodes projectKeyNodes=new ProjectKeyNodes();
|
|
ProjectKeyNodes projectKeyNodes=new ProjectKeyNodes();
|
|
|
|
+ boolean flagNodes=false;
|
|
switch (x){
|
|
switch (x){
|
|
case 0:
|
|
case 0:
|
|
if(plate1!=null&&plate1.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate1.getDateCellValue())){
|
|
if(plate1!=null&&plate1.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate1.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate1.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate1.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate2!=null&&plate2.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate2.getDateCellValue())){
|
|
if(plate2!=null&&plate2.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate2.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate2.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate2.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate3!=null&&!StringUtils.isEmpty(plate3.getStringCellValue())){
|
|
if(plate3!=null&&!StringUtils.isEmpty(plate3.getStringCellValue())){
|
|
switch (plate3.getStringCellValue()){
|
|
switch (plate3.getStringCellValue()){
|
|
@@ -3540,14 +3551,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
if(plate4!=null&&plate4.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate4.getDateCellValue())){
|
|
if(plate4!=null&&plate4.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate4.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate4.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate4.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate5!=null&&plate5.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate5.getDateCellValue())){
|
|
if(plate5!=null&&plate5.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate5.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate5.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate5.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate6!=null&&!StringUtils.isEmpty(plate6.getStringCellValue())){
|
|
if(plate6!=null&&!StringUtils.isEmpty(plate6.getStringCellValue())){
|
|
switch (plate6.getStringCellValue()){
|
|
switch (plate6.getStringCellValue()){
|
|
@@ -3558,14 +3572,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
if(plate7!=null&&plate7.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate7.getDateCellValue())){
|
|
if(plate7!=null&&plate7.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate7.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate7.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate7.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate8!=null&&plate8.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate8.getDateCellValue())){
|
|
if(plate8!=null&&plate8.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate8.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate8.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate8.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate9!=null&&!StringUtils.isEmpty(plate9.getStringCellValue())){
|
|
if(plate9!=null&&!StringUtils.isEmpty(plate9.getStringCellValue())){
|
|
switch (plate9.getStringCellValue()){
|
|
switch (plate9.getStringCellValue()){
|
|
@@ -3576,14 +3593,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
if(plate10!=null&&plate10.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate10.getDateCellValue())){
|
|
if(plate10!=null&&plate10.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate10.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate10.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate10.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate11!=null&&plate11.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate11.getDateCellValue())){
|
|
if(plate11!=null&&plate11.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate11.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate11.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate11.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate12!=null&&!StringUtils.isEmpty(plate12.getStringCellValue())){
|
|
if(plate12!=null&&!StringUtils.isEmpty(plate12.getStringCellValue())){
|
|
switch (plate12.getStringCellValue()){
|
|
switch (plate12.getStringCellValue()){
|
|
@@ -3594,14 +3614,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
if(plate13!=null&&plate13.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate13.getDateCellValue())){
|
|
if(plate13!=null&&plate13.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate13.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate13.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate13.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate14!=null&&plate14.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate14.getDateCellValue())){
|
|
if(plate14!=null&&plate14.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate14.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate14.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate14.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate15!=null&&!StringUtils.isEmpty(plate15.getStringCellValue())){
|
|
if(plate15!=null&&!StringUtils.isEmpty(plate15.getStringCellValue())){
|
|
switch (plate15.getStringCellValue()){
|
|
switch (plate15.getStringCellValue()){
|
|
@@ -3612,14 +3635,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 5:
|
|
case 5:
|
|
if(plate16!=null&&plate16.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate16.getDateCellValue())){
|
|
if(plate16!=null&&plate16.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate16.getDateCellValue())){
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate16.getDateCellValue()));
|
|
projectKeyNodes.setPlanCompleteDate(sdf.format(plate16.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate17!=null&&plate17.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate17.getDateCellValue())){
|
|
if(plate17!=null&&plate17.getCellTypeEnum() == CellType.NUMERIC && !StringUtils.isEmpty(plate17.getDateCellValue())){
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate17.getDateCellValue()));
|
|
projectKeyNodes.setActualCompleteDate(sdf.format(plate17.getDateCellValue()));
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
if(plate18!=null&&!StringUtils.isEmpty(plate18.getStringCellValue())){
|
|
if(plate18!=null&&!StringUtils.isEmpty(plate18.getStringCellValue())){
|
|
switch (plate18.getStringCellValue()){
|
|
switch (plate18.getStringCellValue()){
|
|
@@ -3630,12 +3656,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
case "完成":projectKeyNodes.setStates("2");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ flagNodes=true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if(first.isPresent()){
|
|
if(first.isPresent()){
|
|
- projectKeyNodes.setId(first.get().getId());
|
|
|
|
- projectKeyNodesMapper.updateById(projectKeyNodes);
|
|
|
|
|
|
+ if(flagNodes){
|
|
|
|
+ projectKeyNodes.setId(first.get().getId());
|
|
|
|
+ projectKeyNodesMapper.updateById(projectKeyNodes);
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
projectKeyNodes.setProjectId(id);
|
|
projectKeyNodes.setProjectId(id);
|
|
projectKeyNodes.setNodesId(projectKeyNodesSetting.getId());
|
|
projectKeyNodes.setNodesId(projectKeyNodesSetting.getId());
|
|
@@ -3804,7 +3833,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
p.setProjectId(project.getId());
|
|
p.setProjectId(project.getId());
|
|
participationMapper.insert(p);
|
|
participationMapper.insert(p);
|
|
} else {
|
|
} else {
|
|
- projectMapper.deleteById(project.getId());
|
|
|
|
throw new Exception("参与人["+str+"]不存在");
|
|
throw new Exception("参与人["+str+"]不存在");
|
|
}
|
|
}
|
|
}
|
|
}
|