|
@@ -66,10 +66,11 @@ public class ProjectTemController extends BaseController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/import")
|
|
|
- public HashMap importFile(@RequestParam(value = "file")MultipartFile[] file,String projectName,String[] itemNames,String[] units,String[] itemNo) throws IOException, InvalidFormatException {
|
|
|
+ public HashMap importFile(@RequestParam(value = "file")MultipartFile[] file,String projectName,String projectNo,String[] itemNames,String[] units,String[] itemNo) throws IOException, InvalidFormatException {
|
|
|
HashMap map = new HashMap();
|
|
|
WbsProject wbsProject = new WbsProject();
|
|
|
wbsProject.setProjectName(projectName);
|
|
|
+ wbsProject.setProjectNo(projectNo);
|
|
|
projectService.save(wbsProject);
|
|
|
String projectId = wbsProject.getId();
|
|
|
String fileName = "";
|
|
@@ -78,34 +79,18 @@ public class ProjectTemController extends BaseController {
|
|
|
fileName = file[i].getOriginalFilename();
|
|
|
WbsItem wbsItem = new WbsItem();
|
|
|
wbsItem.setItemName(itemNames[i]);
|
|
|
-// wbsItem.setType(itemTypes[i]);
|
|
|
wbsItem.setProjectId(projectId);
|
|
|
if(null != units && units.length >0){
|
|
|
if(StringUtils.isNotBlank(units[i])){
|
|
|
- wbsItem.setUnit(units[i]);
|
|
|
+ wbsItem.setUnit(units[i]);
|
|
|
}
|
|
|
}
|
|
|
- if(null != itemNo && itemNo.length >0) {
|
|
|
- if (StringUtils.isNotBlank(itemNo[i])) {
|
|
|
- wbsItem.setItemNo(itemNo[i]);
|
|
|
- }
|
|
|
- }
|
|
|
-// 保存数据到数据库
|
|
|
-// 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(null != itemNo && itemNo.length >0) {
|
|
|
+// if (StringUtils.isNotBlank(itemNo[i])) {
|
|
|
+// wbsItem.setItemNo(itemNo[i]);
|
|
|
+// }
|
|
|
// }
|
|
|
+// 保存数据到数据库
|
|
|
String id = getId();
|
|
|
wbsItem.setId(id);
|
|
|
String str = projectService.save(file[i],wbsItem);
|