diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFUtil.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFUtil.java index d4fe7958..1560e2bd 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFUtil.java @@ -12,13 +12,13 @@ import org.apache.pdfbox.pdmodel.PDPageTree; public class PDFUtil { - public static List extract(String pdfName) { + public static List extract(String pdfPath, String templateId) { List extractList = new ArrayList(); File file = null; try { - file = new File(pdfName); + file = new File(pdfPath); } catch (Exception e2) { e2.printStackTrace(); } @@ -42,7 +42,8 @@ public class PDFUtil { extraction = new Extraction(); extraction.setPage(pageIndex+1); - String epayNo = ExtractText.getExtractByStng(pdDocument, pageIndex+1, 0 , 0, 100, 100); + //설정 = mapper.get설정(query.setSggCd().setTemplateId(templateId)); + String epayNo = ExtractText.getExtractByStng(pdDocument, pageIndex+1, 0, 0, 100, 100); extraction.setEpayNo(epayNo); diff --git a/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java b/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java index 96db43db..948a1f4e 100644 --- a/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java +++ b/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java @@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.cmmn.pdf.PDFUtil; +import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.web.AbstractController; @Controller @@ -21,9 +22,13 @@ public class LinkController extends AbstractController { System.out.println("업무 : " + job); System.out.println("파라미터 : "+ param); + DataObject dataObject = fromJson(param, DataObject.class); + //차세대 세외수입 pdf파일 정보 추출 if(job.equals("01")) { - PDFUtil.extract(param); + String tmplatId = dataObject.string("tmplatId"); + + PDFUtil.extract(filePath, tmplatId); } mav.addObject("saved", saved); diff --git a/src/main/webapp/resources/html/fileUpload.html b/src/main/webapp/resources/html/fileUpload.html index 07402e1f..4e6d9d64 100644 --- a/src/main/webapp/resources/html/fileUpload.html +++ b/src/main/webapp/resources/html/fileUpload.html @@ -241,7 +241,7 @@ $("#btnComplete").on("click", function(){ filePath : $("#filePath").val(), job : $("#selectJob").val(), }; - var param = "{ " + "'tmplatId'" + " : " + $("#tmplatId").val() + " }"; + var param = '{ ' + '"tmplatId"' + ' : ' + '"' + $("#tmplatId").val() + '"' + ' }'; data.param = param;