From 39714ff34bb47240a025838da8dd307aa6b0e29f Mon Sep 17 00:00:00 2001 From: daekuk Date: Fri, 12 Dec 2025 16:00:04 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=ED=8E=B8?= =?UTF-8?q?=EC=9D=98=EB=A5=BC=20=EC=9C=84=ED=95=B4=20=EC=9D=B8=ED=84=B0?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EB=93=B1=EB=A1=9D=EC=8B=9C=20?= =?UTF-8?q?=EC=9D=B8=EB=B0=94=EC=9A=B4=EB=93=9C=20url=20=EC=8B=9C=EC=9E=91?= =?UTF-8?q?=EC=9D=B4=20"/"=20=EB=A1=9C=20=EC=8B=9C=EC=9E=91=ED=95=A0=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20"/"=EB=8A=94=20=EC=A0=84=EB=B6=80=20replac?= =?UTF-8?q?e=20=EC=8B=9C=ED=82=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/onl/transaction/apim/apiInterfaceManDetail.jsp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp index 585bd45..62ee6e2 100644 --- a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp +++ b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp @@ -830,7 +830,12 @@ //표준이 아닐경우 업무추출키 셋팅되어야 됨 $("input[name=bzwkSvcKeyName]").val($("input[name=eaiTranName]").val()); } - + + // 사용자 편의를 위해 inboundRestPath 앞에 "/" 는 제외함. + $("input[name=inboundRestPath]").val(function(index, value) { + return value.replace(/^\/+/, ""); + }); + var postData = $('#ajaxForm').serializeArray(); if (isDetail){ postData.push({ name: "cmd" , value:"UPDATE"}); From efcd516afb80a63ddc1a144fa8e2d7769dc39258 Mon Sep 17 00:00:00 2001 From: daekuk Date: Fri, 12 Dec 2025 16:02:12 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EC=96=B4=EB=8C=91=ED=84=B0=20JSON=20?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EA=B0=80=EC=A0=B8=EC=98=A4=EA=B8=B0=20?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20=EC=A4=91=EB=B3=B5=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/onl/admin/adapter/adapterMan.jsp | 141 ++++++++++++++---- .../adapter/adapter/AdapterController.java | 9 +- .../adapter/adapter/AdapterManService.java | 25 +++- 3 files changed, 142 insertions(+), 33 deletions(-) diff --git a/WebContent/jsp/onl/admin/adapter/adapterMan.jsp b/WebContent/jsp/onl/admin/adapter/adapterMan.jsp index c627c7d..2c8d2ed 100644 --- a/WebContent/jsp/onl/admin/adapter/adapterMan.jsp +++ b/WebContent/jsp/onl/admin/adapter/adapterMan.jsp @@ -184,39 +184,125 @@ $(document).ready(function() { $("#btn_clone").hide(); } - FilePond.registerPlugin(FilePondPluginFileValidateType); - // FilePond 인스턴스 생성 - const pond = FilePond.create(document.querySelector('.filepond'), { - instantUpload: false, // 파일을 즉시 업로드하지 않음 - allowRevert: false, - acceptedFileTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/json'], - // 서버 설정 + // 25.12.11 파일 가져오기 할 때 중복 검사 기능추가. + FilePond.registerPlugin(FilePondPluginFileValidateType); + + let uploadErrors = []; + let processedCount = 0; + let totalFiles = 0; + + // FilePond 인스턴스 생성 + const pond = FilePond.create(document.querySelector('.filepond'), { + instantUpload: false, + allowRevert: false, + acceptedFileTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/json'], + + // 서버 설정 server: { process: { url: url_file + '?cmd=LIST_IMPORT_FILE&serviceType=' + sessionStorage["serviceType"], method: 'POST', - // 필요한 경우 headers나 다른 설정 추가 - }, - // revert, load, restore, fetch 설정 (필요한 경우) - }, - // 다른 필요한 옵션 추가 - }); + ondata: (formData) => { + const chkBox = document.querySelector('#uploadModal input[name="importDupliCheck"]'); + const isChecked = chkBox ? chkBox.checked : false; + formData.append('importDupliCheck', isChecked); + return formData; + }, + onerror: (response) => { + return response; + } + } + } + }); - pond.on('processfiles', () => { - // 여기에 모든 파일 업로드 완료 후 실행할 코드를 작성 - console.debug('모든 파일의 처리가 완료되었습니다.'); - $('#btn_search').click(); - }); + // 파일 처리 결과 수신 + pond.on('processfile', (error, file) => { + processedCount++; - // "업로드 시작" 버튼 클릭 이벤트 핸들러 - document.getElementById('uploadButton').addEventListener('click', function() { - pond.processFiles(); // 선택된 모든 파일을 업로드 - }); + if (error) { + let errorMsg = ''; + + if (error.body) { + errorMsg = error.body; + } else if (typeof error === 'string') { + errorMsg = error; + } else { + errorMsg = '가져오기 중 오류가 발생 했습니다.'; + } + + let fileName = 'UnKnown'; + if (file) { + if(file.filename) fileName = file.filename; + else if (file.file && file.file.name) fileName = file.file.name; + } + + uploadErrors.push('파일명 [ ' + fileName + '] \n MESSAGE : ' + errorMsg); + } + + // 모든 파일 처리 완료 시 + if (processedCount >= totalFiles) { + setTimeout(() => { + if (uploadErrors.length > 0) { + const msg = "파일 처리 중 오류가 발생했습니다. \n" + uploadErrors.join('\n'); + + // 실패 시 변수 초기화 + uploadErrors = []; + processedCount = 0; + + $('#btn_search').click(); + alert(msg); + + } else { + alert('모든 파일이 성공적으로 업로드 되었습니다.'); + $('#uploadModal').modal('hide'); + $('#btn_search').click(); + } + }, 100); + } + }); + + // 업로드 버튼 클릭 이벤트 + document.getElementById('uploadButton').addEventListener('click', function(e) { + e.stopPropagation(); + + uploadErrors = []; + processedCount = 0; + + const currentFiles = pond.getFiles(); + totalFiles = currentFiles.length; + + if (totalFiles === 0) { + alert("업로드 할 파일을 선택하세요."); + return; + } + + const chkBox = document.getElementById('importDupliCheck'); + + if (chkBox && !chkBox.checked) { + if (!confirm("중복검사를 체크하지 않는 경우 기존 값은 덮어 씌워집니다. \n진행하시겠습니까?")) { + return; + } + } + + pond.processFiles(); + }); + + // 모달이 닫힐 때만 초기화 + $('#uploadModal').on('hidden.bs.modal', function(e) { + resetPond(); + }); + + function resetPond() { + pond.removeFiles(); + + const chkBox = document.getElementById('importDupliCheck'); + if (chkBox) chkBox.checked = false; + + processedCount = 0; + totalFiles = 0; + uploadErrors = []; + } - // 모달 닫기 이벤트 핸들러 - $('#uploadModal').on('hidden.bs.modal', function (e) { - pond.removeFiles(); // 모달이 닫힐 때 파일 목록에서 모든 파일 제거 - }); }); function jqGridInit() { @@ -412,6 +498,9 @@ function jqGridInit() {