|
@@ -4,6 +4,7 @@ import com.jeeplus.common.json.AjaxJson;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.core.web.BaseController;
|
|
|
import com.jeeplus.modules.sg.overheadline.service.OverheadLineService;
|
|
|
+import com.jeeplus.modules.sg.overheadline.util.BashInfo;
|
|
|
import com.jeeplus.modules.sg.project.entity.WbsItem;
|
|
|
import com.jeeplus.modules.sg.project.entity.WbsProject;
|
|
|
import com.jeeplus.modules.sg.project.entity.WbsSelection;
|
|
@@ -90,20 +91,26 @@ public class ProjectTemController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
// 保存数据到数据库
|
|
|
- if (itemTypes[i].equals("1")) {
|
|
|
- String id = getId();
|
|
|
- wbsItem.setId(id);
|
|
|
- overheadLineService.saveJk(file[i],wbsItem);
|
|
|
- }
|
|
|
- if (itemTypes[i].equals("2")) {
|
|
|
- String id = getId();
|
|
|
- wbsItem.setId(id);
|
|
|
- overheadLineService.saveDl(file[i],wbsItem);
|
|
|
- }
|
|
|
- if (itemTypes[i].equals("3")) {
|
|
|
- String id = getId();
|
|
|
- wbsItem.setId(id);
|
|
|
- substationService.save(file[i],wbsItem);
|
|
|
+// if (itemTypes[i].equals("1")) {
|
|
|
+// String id = getId();
|
|
|
+// wbsItem.setId(id);
|
|
|
+// overheadLineService.saveJk(file[i],wbsItem);
|
|
|
+// }
|
|
|
+// if (itemTypes[i].equals("2")) {
|
|
|
+// String id = getId();
|
|
|
+// wbsItem.setId(id);
|
|
|
+// overheadLineService.saveDl(file[i],wbsItem);
|
|
|
+// }
|
|
|
+// if (itemTypes[i].equals("3")) {
|
|
|
+// String id = getId();
|
|
|
+// wbsItem.setId(id);
|
|
|
+// substationService.save(file[i],wbsItem);
|
|
|
+// }
|
|
|
+ String id = getId();
|
|
|
+ wbsItem.setId(id);
|
|
|
+ String str = projectService.save(file[i],wbsItem);
|
|
|
+ if(str.equals(BashInfo.INVALIDFORMAT)){
|
|
|
+ throw new RuntimeException(str);
|
|
|
}
|
|
|
}
|
|
|
} catch (RuntimeException e) {
|
|
@@ -129,21 +136,27 @@ public class ProjectTemController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("/importfile")
|
|
|
public String importFile(MultipartFile file,WbsItem wbsItem, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) {
|
|
|
- String type = wbsItem.getType(); //项目类型
|
|
|
+// String type = wbsItem.getType(); //项目类型
|
|
|
String projectId = wbsItem.getProjectId();
|
|
|
String id = getId();
|
|
|
wbsItem.setId(id);
|
|
|
try {
|
|
|
// 保存数据到数据库
|
|
|
- if(type.equals("1")) {
|
|
|
- overheadLineService.saveJk(file, wbsItem);
|
|
|
- }
|
|
|
- if (type.equals("2")) {
|
|
|
- overheadLineService.saveDl(file, wbsItem);
|
|
|
- }
|
|
|
- if (type.equals("3")) {
|
|
|
- substationService.save(file, wbsItem);
|
|
|
+// if(type.equals("1")) {
|
|
|
+// overheadLineService.saveJk(file, wbsItem);
|
|
|
+// }
|
|
|
+// if (type.equals("2")) {
|
|
|
+// overheadLineService.saveDl(file, wbsItem);
|
|
|
+// }
|
|
|
+// if (type.equals("3")) {
|
|
|
+// substationService.save(file, wbsItem);
|
|
|
+// }
|
|
|
+ String str = projectService.save(file,wbsItem);
|
|
|
+ if(str.equals(BashInfo.INVALIDFORMAT)){
|
|
|
+ throw new RuntimeException(str);
|
|
|
}
|
|
|
+ addMessage(redirectAttributes, "导入成功");
|
|
|
+ return "redirect:/a/jkxl/list?id="+id+"&type="+str+"&projectId="+projectId;
|
|
|
} catch (RuntimeException e) {
|
|
|
addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
|
return "redirect:/a/project/tem/list?projectId="+projectId;
|
|
@@ -151,8 +164,8 @@ public class ProjectTemController extends BaseController {
|
|
|
addMessage(redirectAttributes, "导入失败");
|
|
|
return "redirect:/a/project/tem/list?projectId="+projectId;
|
|
|
}
|
|
|
- addMessage(redirectAttributes, "导入成功");
|
|
|
- return "redirect:/a/jkxl/list?id="+id+"&type="+type+"&projectId="+projectId;
|
|
|
+// addMessage(redirectAttributes, "导入成功");
|
|
|
+// return "redirect:/a/jkxl/list?id="+id+"&type="+type+"&projectId="+projectId;
|
|
|
}
|
|
|
|
|
|
|