|
@@ -94,13 +94,15 @@ public class ProjectTemController extends BaseController {
|
|
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model)throws Exception {
|
|
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model)throws Exception {
|
|
String projectName = request.getParameter("projectName"); //项目名称
|
|
String projectName = request.getParameter("projectName"); //项目名称
|
|
String itemName = request.getParameter("itemName"); //项目名称
|
|
String itemName = request.getParameter("itemName"); //项目名称
|
|
- String projectId = request.getParameter("projectId"); //工程ID
|
|
|
|
String type = request.getParameter("type"); //工程类型
|
|
String type = request.getParameter("type"); //工程类型
|
|
String id = getId();
|
|
String id = getId();
|
|
try {
|
|
try {
|
|
WbsProject wbsProject = new WbsProject();
|
|
WbsProject wbsProject = new WbsProject();
|
|
wbsProject.setProjectName(projectName);
|
|
wbsProject.setProjectName(projectName);
|
|
projectService.save(wbsProject);
|
|
projectService.save(wbsProject);
|
|
|
|
+ List<WbsProject> wbsProjects = projectService.findByName(projectName);
|
|
|
|
+ WbsProject wbsProject1 = wbsProjects.get(0);
|
|
|
|
+ String projectId = wbsProject1.getId();
|
|
// 保存数据到数据库
|
|
// 保存数据到数据库
|
|
if(type.equals("1")) {
|
|
if(type.equals("1")) {
|
|
overheadLineService.saveJk(file,itemName, id, projectId, type);
|
|
overheadLineService.saveJk(file,itemName, id, projectId, type);
|
|
@@ -110,10 +112,10 @@ public class ProjectTemController extends BaseController {
|
|
}
|
|
}
|
|
} catch (RuntimeException e) {
|
|
} catch (RuntimeException e) {
|
|
addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
- return "redirect:/a/project/list";
|
|
|
|
|
|
+ return "redirect:/a/project/tem/index";
|
|
} catch (Exception e){
|
|
} catch (Exception e){
|
|
addMessage(redirectAttributes, "导入失败");
|
|
addMessage(redirectAttributes, "导入失败");
|
|
- return "redirect:/a/project/list";
|
|
|
|
|
|
+ return "redirect:/a/project/tem/index";
|
|
}
|
|
}
|
|
addMessage(redirectAttributes, "导入成功");
|
|
addMessage(redirectAttributes, "导入成功");
|
|
return "redirect:/a/jkxl/list?id="+id+"&type="+type;
|
|
return "redirect:/a/jkxl/list?id="+id+"&type="+type;
|
|
@@ -209,8 +211,9 @@ public class ProjectTemController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "tolist")
|
|
@RequestMapping(value = "tolist")
|
|
- public String toList(){
|
|
|
|
- return "redirect:/a/project/list";
|
|
|
|
|
|
+ public String toList(HttpServletRequest request){
|
|
|
|
+ String projectId = request.getParameter("projectId");
|
|
|
|
+ return "redirect:/a/project/tem/list?projectId="+projectId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|