mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
#수정
This commit is contained in:
@@ -156,57 +156,5 @@ public class VendorController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/vendor/uplodeExcel")
|
|
||||||
public String uploadExcel(@ModelAttribute("dto") VendorDto dto , RedirectAttributes redirectAttributes, final MultipartHttpServletRequest multiRequest,
|
|
||||||
HttpServletRequest request, ModelMap model) {
|
|
||||||
|
|
||||||
// Map<String, Object> resMap = new HashMap<>();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// ExcelRequestManager em = new ExcelRequestManager();
|
|
||||||
//
|
|
||||||
// // 멀티파트 요청 객체에서 파일 맵을 가져옴
|
|
||||||
// final Map<String, MultipartFile> files = multiRequest.getFileMap();
|
|
||||||
// //초기화
|
|
||||||
// List<HashMap<String,String>> apply =null;
|
|
||||||
//
|
|
||||||
// //엑셀파일 가져와서 저장 및 읽기
|
|
||||||
// //변수는 멀티파트 요청 객체의 파일맵, 저장할 엑셀파일명 이름에 추가할 숫자(그냥 0으로 해도 됨)
|
|
||||||
// //마찬가지로 엑셀파일 명 이름에 추가할 문자열, uplode폴더에 들어갈 폴더명(카테고리같은 파트 이름으로 해주세요)
|
|
||||||
// //폴더가 없으면 자동생성되게 해뒀습니다.
|
|
||||||
// //마지막으로 HttpServletRequest
|
|
||||||
// apply = em.parseExcelSpringMultiPart(files, "거래처 데이터 입력 서식", 0, "", "vendor", request);
|
|
||||||
//
|
|
||||||
// for (int i = 0; i < apply.size(); i++) {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// dto.setName(apply.get(i).get("cell_0"));
|
|
||||||
// dto.setPresident_name(apply.get(i).get("cell_1"));
|
|
||||||
// dto.setAddress(apply.get(i).get("cell_2"));
|
|
||||||
// dto.setRegistration_number(apply.get(i).get("cell_3"));
|
|
||||||
// dto.setEmail(apply.get(i).get("cell_4"));
|
|
||||||
// dto.setPresident_telephone(apply.get(i).get("cell_5"));
|
|
||||||
// dto.setVendor_manager(apply.get(i).get("cell_6"));
|
|
||||||
// dto.setVendor_manager_telephone(apply.get(i).get("cell_7"));
|
|
||||||
// dto.setMain_product(apply.get(i).get("cell_8"));
|
|
||||||
// dto.setManager_id(manager_id);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// service.createProcess(dto);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// resMap.put("res", "ok");
|
|
||||||
// resMap.put("msg", "업로드 성공");
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// System.out.println(e.toString());
|
|
||||||
// resMap.put("res", "error");
|
|
||||||
// resMap.put("msg", "업로드 실패");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// redirectAttributes.addFlashAttribute("resMap", resMap);
|
|
||||||
return "redirect:/vendor/list";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/main/webapp/WEB-INF/views/vendor/list.jsp
vendored
23
src/main/webapp/WEB-INF/views/vendor/list.jsp
vendored
@@ -70,7 +70,6 @@
|
|||||||
<div class="row row-buttons">
|
<div class="row row-buttons">
|
||||||
<div class="col-3 text-start">
|
<div class="col-3 text-start">
|
||||||
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
|
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
|
||||||
<button type="button" class="btn btn-success" id="downlodeExcelForm">양식 다운로드</button>
|
|
||||||
<button type="button" class="btn btn-success" id="downlodeExcelList">리스트 다운로드</button>
|
<button type="button" class="btn btn-success" id="downlodeExcelList">리스트 다운로드</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 d-flex justify-content-center">
|
<div class="col-6 d-flex justify-content-center">
|
||||||
@@ -100,13 +99,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- row row-buttons -->
|
</div><!-- row row-buttons -->
|
||||||
|
|
||||||
|
|
||||||
<form name="uplodeExcleForm" id="uplodeExcleForm" method="post" onsubmit="return _onSubmit();" action="/vendor/uplodeExcel" enctype="multipart/form-data" class="form-horizontal">
|
|
||||||
<input type="file" name="file" id="file" accept=".xlsx, .xls"/>
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-success" id="uploadExcel">업로드</button>
|
|
||||||
<%-- <input type='hidden' id="manager_id" value="${userData.id }">--%>
|
|
||||||
</form><!-- uplodeExcleForm -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -190,8 +182,7 @@
|
|||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
});
|
});
|
||||||
var msg = "${resMap.msg}";
|
|
||||||
if (msg != "") alert(msg);
|
|
||||||
|
|
||||||
|
|
||||||
});//ready
|
});//ready
|
||||||
@@ -225,18 +216,6 @@
|
|||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _onSubmit(){
|
|
||||||
|
|
||||||
if($("#file").val() == ""){
|
|
||||||
alert("파일을 업로드해주세요.");
|
|
||||||
$("#file").focus();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user