|
@@ -59,7 +59,7 @@ public class ProjectTemController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *数据导入
|
|
|
|
|
|
+ *文件多个导入
|
|
*/
|
|
*/
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequestMapping("/import")
|
|
@RequestMapping("/import")
|
|
@@ -100,6 +100,38 @@ public class ProjectTemController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ *文件导入
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("/importfile")
|
|
|
|
+ public String importFile(MultipartFile file, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) {
|
|
|
|
+ String projectName = request.getParameter("name"); //项目名称
|
|
|
|
+ String projectId = request.getParameter("projectId"); //工程ID
|
|
|
|
+ String type = request.getParameter("type"); //工程类型
|
|
|
|
+ String id = getId();
|
|
|
|
+ try {
|
|
|
|
+// 保存数据到数据库
|
|
|
|
+ if(type.equals("1")) {
|
|
|
|
+ overheadLineService.saveJk(file, projectName, id, projectId, type);
|
|
|
|
+ }
|
|
|
|
+ if (type.equals("2")) {
|
|
|
|
+ overheadLineService.saveDl(file, projectName, id, projectId, type);
|
|
|
|
+ }
|
|
|
|
+ } catch (RuntimeException e) {
|
|
|
|
+ addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
|
|
+ return "redirect:/a/project/list";
|
|
|
|
+ } catch (Exception e){
|
|
|
|
+ addMessage(redirectAttributes, "导入失败");
|
|
|
|
+ return "redirect:/a/project/list";
|
|
|
|
+ }
|
|
|
|
+ addMessage(redirectAttributes, "导入成功");
|
|
|
|
+ return "redirect:/a/jkxl/list?id="+id+"&type="+type+"&projectId="+projectId;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 返回
|
|
* 返回
|
|
* @param request
|
|
* @param request
|
|
* @return
|
|
* @return
|
|
@@ -111,6 +143,21 @@ public class ProjectTemController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping("/form")
|
|
|
|
+ public String form(WbsProject wbsProject, Model model) {
|
|
|
|
+ WbsProject wbsProject1 = projectService.get(wbsProject.getId());
|
|
|
|
+ List<WbsProject> list = new ArrayList<>();
|
|
|
|
+ list.add(wbsProject1);
|
|
|
|
+ model.addAttribute("list", list);
|
|
|
|
+ String view = "updateItem";
|
|
|
|
+ String tabId = request.getParameter("tabId");
|
|
|
|
+ if("1".equals(tabId)){
|
|
|
|
+ view = "lookItem";
|
|
|
|
+ }
|
|
|
|
+ return "modules/sg/projecttem/"+view;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|