|
@@ -120,10 +120,9 @@ public class ProjectController extends BaseController {
|
|
*/
|
|
*/
|
|
@RequestMapping("/import")
|
|
@RequestMapping("/import")
|
|
public String importFile(MultipartFile file,WbsItem wbsItem, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) throws IOException, InvalidFormatException {
|
|
public String importFile(MultipartFile file,WbsItem wbsItem, RedirectAttributes redirectAttributes, HttpServletRequest request, Model model) throws IOException, InvalidFormatException {
|
|
-// String type = wbsItem.getType(); //项目类型
|
|
|
|
String id = getId();
|
|
String id = getId();
|
|
wbsItem.setId(id);
|
|
wbsItem.setId(id);
|
|
-// try {
|
|
|
|
|
|
+ try {
|
|
//判断结算数类型并保存数据到数据库
|
|
//判断结算数类型并保存数据到数据库
|
|
String str = projectService.save(file,wbsItem);
|
|
String str = projectService.save(file,wbsItem);
|
|
if(str.equals(BashInfo.INVALIDFORMAT)){
|
|
if(str.equals(BashInfo.INVALIDFORMAT)){
|
|
@@ -131,13 +130,10 @@ public class ProjectController extends BaseController {
|
|
}
|
|
}
|
|
addMessage(redirectAttributes, "导入成功");
|
|
addMessage(redirectAttributes, "导入成功");
|
|
return "redirect:/a/jkxl/list?id="+id+"&type="+str;
|
|
return "redirect:/a/jkxl/list?id="+id+"&type="+str;
|
|
-// } catch (RuntimeException e) {
|
|
|
|
-// addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
|
|
-// return "redirect:/a/project/list";
|
|
|
|
-// } catch (Exception e){
|
|
|
|
-// addMessage(redirectAttributes, "导入失败");
|
|
|
|
-// return "redirect:/a/project/list";
|
|
|
|
-// }
|
|
|
|
|
|
+ } catch (Exception e){
|
|
|
|
+ addMessage(redirectAttributes, "导入失败,"+e.getMessage());
|
|
|
|
+ return "redirect:/a/project/list";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//导出
|
|
//导出
|