사전통지서 출력 대상 화면 추가
parent
152fbd4547
commit
ccf0bdc690
@ -0,0 +1,35 @@
|
||||
package cokr.xit.fims.cmmn.pdf;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class PDFPrintUtil {
|
||||
|
||||
private int fileNameIndex = 0;
|
||||
|
||||
public String filePathForNewFile() {
|
||||
|
||||
SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String currentTime = ymdhmsFormat.format(new Date());
|
||||
String year = currentTime.substring(0, 4);
|
||||
String month = currentTime.substring(4, 6);
|
||||
String day = currentTime.substring(6, 8);
|
||||
|
||||
String fileResultRootPath = "files" + File.separator + "result" + File.separator + "print";
|
||||
|
||||
String fileResultFolderPath = fileResultRootPath
|
||||
+ File.separator + year + File.separator + month + File.separator + day;
|
||||
File formatFileResultFolder = new File(fileResultFolderPath);
|
||||
if(!formatFileResultFolder.exists()) {
|
||||
formatFileResultFolder.mkdirs();
|
||||
}
|
||||
String resultPdfPath = fileResultFolderPath
|
||||
+ File.separator + currentTime + "_" + (this.fileNameIndex++) + ".pdf";
|
||||
|
||||
|
||||
return resultPdfPath;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
|
||||
<c:set var="prefixName" scope="request">출력대상-사전통지서</c:set>
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div class="card p-3">
|
||||
<div class="row mb-3 justify-content-start">
|
||||
<div class="col-md-12">
|
||||
<div class="float-start">
|
||||
<button type="button" id="btnPrintAdvntcePdf--${pageName}" class="btn btn-info">사전통보서출력(PDF)</button>
|
||||
<button type="button" id="btnPrintAdvntceOutsourcing--${pageName}" class="btn btn-info">사전통보서출력(외주파일)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-datatable text-nowrap mb-3">
|
||||
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div class="table-responsive"
|
||||
style="overflow-x:scroll; height:300px; overflow-y:scroll;" >
|
||||
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
|
||||
id="table--${pageName}" aria-describedby="DataTables_Table_0_info">
|
||||
<thead class="sticky-thead" >
|
||||
<tr id="theadTr--${pageName}">
|
||||
<th style="width:120px">시군구명</th>
|
||||
<th style="width:180px">과태료명</th>
|
||||
<th style="width:120px">차량번호</th>
|
||||
<th style="width:120px">대체차량번호</th>
|
||||
<th style="width:200px">단속일시</th>
|
||||
<th style="width:200px">단속장소</th>
|
||||
<th style="width:120px">고지번호</th>
|
||||
<th style="width:120px">수납일자</th>
|
||||
<th style="width:120px">처리상태</th>
|
||||
<th style="width:120px">수납금액</th>
|
||||
<th style="width:120px">잔액</th>
|
||||
<th style="width:120px">성명</th>
|
||||
<th style="width:400px">주소</th>
|
||||
<th style="width:400px">번지</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody--${pageName}">
|
||||
</tbody>
|
||||
<template id="found--${pageName}">
|
||||
<tr data-key="{CRDN_ID}" onclick="pageObject['${pageName}'].clickGrid(this);">
|
||||
<td>{SGG_NM}</td>
|
||||
<td>{TASK_SE_NM}</td>
|
||||
<td>{VHRNO}</td>
|
||||
<td>{RPM_SZR_VHRNO}</td>
|
||||
<td>{CRDN_YMD_TM}</td>
|
||||
<td>{CRDN_PLC}</td>
|
||||
<td>{GOJI_NO}</td>
|
||||
<td>{RCVMT_YMD}</td>
|
||||
<td>{CRDN_STTS_NM}</td>
|
||||
<td>{RCVMT_AMT}</td>
|
||||
<td>{SUM_AMT}</td>
|
||||
<td>{RTPYR_NM}</td>
|
||||
<td>{RTPYR_ADDR}</td>
|
||||
<td>{RTPYR_DTL_ADDR}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="frmEdit--${pageName}">
|
||||
<input type="text" name="dialogId" hidden />
|
||||
|
||||
</form>
|
||||
|
||||
<span id="tempArea--${pageName}" hidden></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
pageObject["${pageName}"] = {};
|
||||
pageObject["${pageName}"].provided = {};
|
||||
|
||||
pageObject.childReq = [];
|
||||
pageObject.childReq.push({
|
||||
getInfo : function(){ return null; },
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var $P = pageObject["${pageName}"];
|
||||
|
||||
$P.crdnIds = ${crdnIds};
|
||||
|
||||
if(pageObject.parentRes.length > 0){
|
||||
$P.provided = pageObject.parentRes.pop();
|
||||
} else {
|
||||
$P.provided = pageObject.childReq.pop();
|
||||
}
|
||||
|
||||
//그리드클릭
|
||||
$P.clickGrid = (element) => {
|
||||
var key = element.dataset.key;
|
||||
|
||||
$("#tbody--${pageName}").setCurrentRow(key);
|
||||
|
||||
var info = $P.provided.getInfo(key);
|
||||
var ff = new FimsFormFields("#frmEdit--${pageName}");
|
||||
ff.set(info);
|
||||
}
|
||||
|
||||
$P.fnMakeFile = (fileType) => {
|
||||
if(!customValidate($("#frmEdit--${pageName} input"))) return;
|
||||
|
||||
|
||||
var url = "";
|
||||
if(fileType == "pdf"){
|
||||
url = wctx.url("/sprt/sprt01/140/makeAdvntcePdf.do");
|
||||
} else if(fileType == "outsourcing"){
|
||||
url = wctx.url("/sprt/sprt01/140/makeAdvntceOutsourcing.do");
|
||||
}
|
||||
var formFields = new FimsFormFields("#frmEdit--${pageName}");
|
||||
var globalVariable = formFields.get();
|
||||
|
||||
ajax.post({
|
||||
url : url,
|
||||
data : {
|
||||
crdnIds : $P.crdnIds.join(",")
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.filePath != null && resp.filePath != ""){
|
||||
var a = document.createElement("a");
|
||||
a.href = resp.filePath;
|
||||
a.download = resp.fileName;
|
||||
document.getElementById("tempArea--${pageName}").appendChild(a);
|
||||
a.click();
|
||||
document.getElementById("tempArea--${pageName}").removeChild(a);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//버튼이벤트
|
||||
$("#btnPrintAdvntcePdf--${pageName}").on("click", () => $P.fnMakeFile('pdf') );
|
||||
$("#btnPrintAdvntceOutsourcing--${pageName}").on("click", () => $P.fnMakeFile('outsourcing') );
|
||||
|
||||
//첫번째 줄 클릭
|
||||
$("#tbody--${pageName}").find("tr:eq(0)").click();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue