This commit is contained in:
sungsu
2024-01-24 15:14:35 +09:00
parent e9f78f87f7
commit 8699e6923e
2 changed files with 1 additions and 74 deletions

View File

@@ -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";
};
}