차세대세외수입 고지서 pdf파일 정보 추출 관련 controller, html 추가
1. 요청처리용 컨트롤러 추가 2. 업로드용 html화면 추가main
parent
e812d2bbed
commit
4ae3a2e631
@ -0,0 +1,34 @@
|
||||
package cokr.xit.fims.cmmn.web;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import cokr.xit.fims.cmmn.pdf.PDFUtil;
|
||||
import cokr.xit.foundation.web.AbstractController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(name = "연계 처리", value = "/link")
|
||||
public class LinkController extends AbstractController {
|
||||
|
||||
@RequestMapping(name = "파일 처리", value = "/fileProcess.do")
|
||||
public ModelAndView fileProcess(String filePath, String job, String param) {
|
||||
ModelAndView mav = new ModelAndView("jsonView");
|
||||
|
||||
boolean saved = false;
|
||||
|
||||
System.out.println("파일경로 : " +filePath);
|
||||
System.out.println("업무 : " + job);
|
||||
System.out.println("파라미터 : "+ param);
|
||||
|
||||
//차세대 세외수입 pdf파일 정보 추출
|
||||
if(job.equals("01")) {
|
||||
PDFUtil.extract(param);
|
||||
}
|
||||
|
||||
mav.addObject("saved", saved);
|
||||
return mav;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,266 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="/resources/image/favicon.ico" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="stylesheet" href="/resources/font/publicsans/fontface.css" />
|
||||
|
||||
<!-- Icons. Uncomment required icon fonts -->
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/boxicons.css" />
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/fontawesome.css" />
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/flag-icons.css" />
|
||||
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-icon.css" />
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core.css" />
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/theme-default.css" />
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/docs.css" />
|
||||
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core-extend.css" />
|
||||
|
||||
<!-- Vendors CSS -->
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.css" />
|
||||
|
||||
<link rel="stylesheet" href="/resources/3rd-party/sneat/libs/bs-stepper/bs-stepper.css" />
|
||||
|
||||
<link rel="stylesheet" href="/resources/css/styles.css" />
|
||||
|
||||
<link rel="stylesheet" href="/resources/css/fims/framework/common/common.css"/>
|
||||
<link rel="stylesheet" href="/resources/lib/fims/framework/jquery-ui/1.13.2/themes/redmond/jquery-ui.css" />
|
||||
<link rel="stylesheet" href="/resources/lib/fims/framework/datepicker/datepicker.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
<title>파일업로드</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card m-4 p-3">
|
||||
|
||||
<form id="hiddenForm" name="hiddenForm">
|
||||
<input type="hidden" id="filePath" name="filePath" />
|
||||
</form>
|
||||
|
||||
<div class="bs-stepper wizard-numbered mt-2"> <!-- 스테퍼 -->
|
||||
|
||||
<div class="bs-stepper-header"> <!-- 스텝헤더s -->
|
||||
|
||||
<div class="step" data-target="#uploadStep"> <!-- 스텝헤더1 -->
|
||||
<button type="button" class="step-trigger" disabled>
|
||||
<span class="bs-stepper-circle">1</span>
|
||||
<span class="bs-stepper-label mt-1">
|
||||
<span class="bs-stepper-title">파일업로드</span>
|
||||
<span class="bs-stepper-subtitle">파일업로드</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="line">
|
||||
<i class="bx bx-chevron-right"></i>
|
||||
</div>
|
||||
|
||||
<div class="step" data-target="#selectJobStep"> <!-- 스텝헤더2 -->
|
||||
<button type="button" class="step-trigger" disabled>
|
||||
<span class="bs-stepper-circle">2</span>
|
||||
<span class="bs-stepper-label mt-1">
|
||||
<span class="bs-stepper-title">처리업무 선택</span>
|
||||
<span class="bs-stepper-subtitle">처리업무 선택</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="line">
|
||||
<i class="bx bx-chevron-right"></i>
|
||||
</div>
|
||||
|
||||
<div class="step" data-target="#additionalStep"> <!-- 스텝헤더3 -->
|
||||
<button type="button" class="step-trigger" disabled>
|
||||
<span class="bs-stepper-circle">3</span>
|
||||
<span class="bs-stepper-label mt-1">
|
||||
<span class="bs-stepper-title">추가작업</span>
|
||||
<span class="bs-stepper-subtitle">추가작업</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div> <!-- 스텝헤더s끝 -->
|
||||
|
||||
|
||||
<div class="bs-stepper-content"> <!-- 스텝콘텐츠 -->
|
||||
|
||||
|
||||
<div id="uploadStep" class="content"> <!-- 스텝콘텐츠1 -->
|
||||
|
||||
<form name="form1" id="form1" method="post" enctype="multipart/form-data">
|
||||
|
||||
<label>파일</label>
|
||||
<input type="file" id="uploadFiles" name="uploadFiles" />
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between">
|
||||
<button type="button" class="btn btn-primary ms-auto" onclick="fnTempFileUpload();">전송</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="selectJobStep" class="content"> <!-- 스텝콘텐츠2 -->
|
||||
|
||||
<form name="form2" id="form2">
|
||||
<label class="required">처리 업무</label>
|
||||
<select id="selectJob" name="selectJob" class="form-select" style="max-width:300px!important;">
|
||||
<option value="">선택하세요.</option>
|
||||
<option value="01">차세대세외수입 고지서 pdf 정보 추출</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between">
|
||||
|
||||
<button type="button" id="btnSelectJob" class="btn btn-primary ms-auto">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1 me-0">Next</span>
|
||||
<i class="bx bx-chevron-right bx-sm me-sm-n2"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="additionalStep" class="content"> <!-- 스텝콘텐츠3 -->
|
||||
|
||||
<form name="form3" id="form3">
|
||||
<label>서식</label>
|
||||
<select id="tmplatId" name="tmplatId" class="form-select">
|
||||
<option value="JU001">사전통지서</option>
|
||||
<option value="JU002">본고지(수신분)</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between">
|
||||
|
||||
<button type="button" id="btnComplete"
|
||||
class="btn btn-success ms-auto">완료</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/JavaScript" src="/resources/3rd-party/sneat/libs/jquery/jquery.js" ></script>
|
||||
|
||||
<script src="/resources/3rd-party/sneat/libs/popper/popper.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/js/bootstrap.js"></script>
|
||||
|
||||
<script src="/resources/3rd-party/sneat/libs/bs-stepper/bs-stepper.js"></script>
|
||||
|
||||
<script src="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/libs/hammer/hammer.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/libs/i18n/i18n.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/js/menu.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/libs/jstree/jstree.js"></script>
|
||||
<script src="/resources/3rd-party/jstree/jstree-support.js"></script>
|
||||
<script src="/resources/3rd-party/sneat/libs/chartjs/chartjs.js"></script>
|
||||
|
||||
|
||||
<script src="/resources/lib/fims/framework/jquery-ui/1.13.2/jquery-ui.js"></script>
|
||||
|
||||
<script src="/resources/js/base/base.js"></script>
|
||||
<script src="/resources/js/base/base-fims.js"></script>
|
||||
<script src="/resources/js/base/dataset.js"></script>
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
|
||||
const wizardNumbered = document.querySelector(".wizard-numbered");
|
||||
const numberedStepper = new Stepper(wizardNumbered, {
|
||||
linear: false
|
||||
});
|
||||
|
||||
if (typeof wizardNumbered !== undefined && wizardNumbered !== null) {
|
||||
const wizardNumberedBtnNextList = [].slice.call(wizardNumbered.querySelectorAll('.btn-next'));
|
||||
const wizardNumberedBtnPrevList = [].slice.call(wizardNumbered.querySelectorAll('.btn-prev'));
|
||||
const wizardNumberedBtnSubmit = wizardNumbered.querySelector('.btn-submit');
|
||||
|
||||
if (wizardNumberedBtnNextList) {
|
||||
wizardNumberedBtnNextList.forEach(wizardNumberedBtnNext => {
|
||||
wizardNumberedBtnNext.addEventListener('click', event => {
|
||||
numberedStepper.next();
|
||||
});
|
||||
});
|
||||
}
|
||||
if (wizardNumberedBtnPrevList) {
|
||||
wizardNumberedBtnPrevList.forEach(wizardNumberedBtnPrev => {
|
||||
wizardNumberedBtnPrev.addEventListener('click', event => {
|
||||
numberedStepper.previous();
|
||||
});
|
||||
});
|
||||
}
|
||||
if (wizardNumberedBtnSubmit) {
|
||||
wizardNumberedBtnSubmit.addEventListener('click', event => {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fnTempFileUpload(){
|
||||
|
||||
var formData = new FormData(document.getElementById("form1"));
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/file/uploadBeforeProcess.do"),
|
||||
contentType : false, processData : false,
|
||||
data : formData,
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
$("#filePath").val(resp.filePath);
|
||||
numberedStepper.next();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#btnSelectJob").on("click", function(){
|
||||
|
||||
if($("#selectJob").val() == ""){
|
||||
alert("처리 업무를 선택하세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
numberedStepper.next();
|
||||
|
||||
});
|
||||
|
||||
$("#btnComplete").on("click", function(){
|
||||
|
||||
var data = {
|
||||
filePath : $("#filePath").val(),
|
||||
job : $("#selectJob").val(),
|
||||
};
|
||||
var param = "{ " + "'tmplatId'" + " : " + $("#tmplatId").val() + " }";
|
||||
|
||||
data.param = param;
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/link/fileProcess.do"),
|
||||
data : data,
|
||||
success : (resp) => {
|
||||
|
||||
alert("완료되었습니다.");
|
||||
//window.close();
|
||||
//if(resp.saved){
|
||||
|
||||
//}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
wctx.csrf = window.opener.wctx.csrf;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue