우편통합 - 접수결과 엑셀 저장 수정.

main
jjh 11 months ago
parent 5706cb72a9
commit 65398b7f45

@ -5,9 +5,14 @@ import java.util.Map;
import javax.annotation.Resource;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnQuery;
@ -335,6 +340,7 @@ public class Epst02Controller extends ApplicationController {
.addObject("pageName", "epst02050") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "epostRcptRslt") // prefix
.addObject("sggCd", managedUser.getOrgID()) // 시군구 코드(SGG_CD)
.addObject("deptCd", managedUser.getDeptCode()) // 부서 코드(DEPT_CD)
.addObject("EGP002List", commonCodes.get("EGP002")) // 취급 구분(DIV_KB)
.addObject("FIM054List", commonCodes.get("FIM054")) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM082List", commonCodes.get("FIM082")) // 작업 코드 3(JOB_CD)
@ -356,9 +362,53 @@ public class Epst02Controller extends ApplicationController {
* }</code></pre>
*/
public ModelAndView getEpostReceiptResultList(EpostQuery req) {
if (!"xls".equals(req.getDownload())) {
List<?> result = epostRcptRsltService.getEpostRcptRsltList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "epostRcptRslt");
} else {
XLSWriter xlsx = new XLSWriter()
.setFilename("우편통합 접수결과 목록.xlsx")
.worksheet(0);
CellStyle header = xlsx.cellStyle(new XLSWriter.Styler()
.width(32)
.foregroundColor(HSSFColor.HSSFColorPredefined.LIGHT_BLUE.getIndex())
.configure(styler -> {
Font font = xlsx.workbook().createFont();
font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
styler.font(font);
styler.alignment(HorizontalAlignment.CENTER);
})
)
, numeric = xlsx.n_nn0();
xlsx.cell(0, 0)
.value("우편통합 접수결과 목록", XLSWriter.Styler.CENTER)
.merge(0, 11)
.cell(3, 0)
.rowValues(List.of(
"발송자료키", header, "우편물코드", header, "우편물종류", header, "발송일자", header, "접수일자", header
, "취급구분", header, "발송건수", header, "결제금액", header, "제작수수료", header, "우편요금", header
, "등록일시", header, "등록사용자", header
))
.cell(4, 0)
.values( epostRcptRsltService.getEpostRcptRsltList(req.setFetchSize(0))
, xlsx.style("RELETCDATA", XLSWriter.Styler.CENTER)
, xlsx.style("JOB_CD", XLSWriter.Styler.CENTER)
, xlsx.style("JOB_CD3_NM", XLSWriter.Styler.CENTER)
, xlsx.format(r -> xlsx.str2date(r.get("EXTRI_REGYMD")))
, xlsx.format(r -> xlsx.str2date(r.get("RCEPT_YMD")))
, xlsx.style("DIV_KB_NM", XLSWriter.Styler.CENTER)
, xlsx.style("RCEPT_CNT", numeric)
, xlsx.style("RCEPT_AMT", numeric)
, xlsx.style("USEFEE_AMT", numeric)
, xlsx.style("TOTPOST_PRC", numeric)
, "REG_DT", "RGTR_NM"
);
return new ModelAndView("xlsView")
.addObject("xls", xlsx);
}
}
/** ID , .

@ -31,6 +31,7 @@
<form id="frmSearch--${pageName}" name="frmSearch">
<!-- hidden -->
<input type="hidden" id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" />
<input type="hidden" id="deptCd--${pageName}" name="deptCd" data-map="DEPT_CD" />
<!-- 메인 조건 -->
<div class="container-search">
@ -197,7 +198,7 @@
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}${pageDataName3}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTr--${pageName}${pageDataName3}">
<th class="cmn" style="width: 120px;">취급구분</th>
<th class="cmn" style="width: 160px;">취급구분</th>
<th class="cmn" style="width: 120px;">발송건수</th>
<th class="cmn" style="width: 200px;">결제금액</th>
<th class="cmn" style="width: 200px;">제작수수료</th>
@ -445,15 +446,16 @@
${pageName}Control.query.conOrg = ${pageName}${pageDataName2}Dataset.getValue("EGP_CON_ORG"); // 외부기관구분코드
${pageName}Control.query.relorsectCd = ${pageName}${pageDataName2}Dataset.getValue("DEPT_CD"); // 결제부서코드(부서코드)
// 검색
${pageName}Control.load(1);
// 합계 금액 조회
// 합계금액 검색
getSumAmtInfo${pageName}(${pageName}Control.query);
}
// 엑셀 버튼 이벤트
fnExcel${pageName} = () => {
${pageName}Control.download();
}
// 사용자 조회 버튼 이벤트
@ -536,6 +538,8 @@
// 시군구 코드 설정
$("#sggCd--${pageName}").val("${sggCd}");
// 부서 코드 설정
$("#deptCd--${pageName}").val("${deptCd}");
// 업무 구분 설정
let defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();

Loading…
Cancel
Save