민원관리 엑셀저장 추가

main
이범준 11 months ago
parent 2c73ccbf62
commit e9026d34b1

@ -4,11 +4,13 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.BiFunction;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -16,9 +18,12 @@ import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation; import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
@ -92,6 +97,60 @@ public class Cvlc01Controller extends ApplicationController {
String sggCd = globalStngMapper.selectSggCd(curDeptCode); String sggCd = globalStngMapper.selectSggCd(curDeptCode);
query.setSggCd(sggCd); query.setSggCd(sggCd);
if("xls".equals(query.getDownload())) {
String[] excelTitle = query.getExcelTitle();
List<String> titles = new ArrayList<String>();
for(int i = 0; i < excelTitle.length; i++) {
String item = excelTitle[i];
titles.add(item);
}
int[] excelTitleWidth = query.getExcelTitleWidth();
List<Integer> widths = new ArrayList<>();
for(int i = 0; i < excelTitleWidth.length; i++) {
int item = excelTitleWidth[i];
widths.add(item);
}
XLSWriter xlsx = new XLSWriter()
.setFilename("민원접수자료 목록.xlsx")
.worksheet(0);
List<Styler> headerStylers = CmmnUtil.makeHeadersByDiffrentWidths(widths, xlsx);
CellStyle numeric = xlsx.n_nn0();
xlsx.cell(0, 0)
.value("민원접수자료 목록", XLSWriter.Styler.CENTER)
.merge(0, titles.size()-1)
.cell(3, 0)
.rowValues(CmmnUtil.mergeListByIndex(titles, headerStylers));
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> {
switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO";
case "등록구분": return "CRDN_REG_SE_NM";
case "신고자": return "CVLCPT_APLCNT_NM";
case "담당자" : return "CVLCPT_PRCS_PIC_NM";
case "담당자전화번호": return "CVLCPT_PRCS_PIC_TELNO";
case "접수일자": return xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD")));
case "처리기한": return xlsx.format(o -> xlsx.str2datetime(o.get("CVLCPT_PRCS_PRNMNT_DT")));
case "위반일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM")));
case "위반내용": return "VLTN_ARTCL";
case "차량번호": return "VHRNO";
case "사진건수": return "ATCH_FILE_CNT";
}
return "";
};
xlsx.cell(4, 0)
.values(list, titles.stream().map((item) -> { return getValue.apply(item, null); }).toArray());
return new ModelAndView("xlsView").addObject("xls", xlsx);
}
return setCollectionInfo(new ModelAndView("jsonView"), crdnCvlcptService.getCivilComplaintList(query),""); return setCollectionInfo(new ModelAndView("jsonView"), crdnCvlcptService.getCivilComplaintList(query),"");
} }

@ -1,17 +1,23 @@
package cokr.xit.fims.cvlc.web; package cokr.xit.fims.cvlc.web;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.BiFunction;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.poi.ss.usermodel.CellStyle;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
@ -80,6 +86,59 @@ public class Cvlc02Controller extends ApplicationController {
String sggCd = globalStngMapper.selectSggCd(curDeptCode); String sggCd = globalStngMapper.selectSggCd(curDeptCode);
query.setSggCd(sggCd); query.setSggCd(sggCd);
if("xls".equals(query.getDownload())) {
String[] excelTitle = query.getExcelTitle();
List<String> titles = new ArrayList<String>();
for(int i = 0; i < excelTitle.length; i++) {
String item = excelTitle[i];
titles.add(item);
}
int[] excelTitleWidth = query.getExcelTitleWidth();
List<Integer> widths = new ArrayList<>();
for(int i = 0; i < excelTitleWidth.length; i++) {
int item = excelTitleWidth[i];
widths.add(item);
}
XLSWriter xlsx = new XLSWriter()
.setFilename("민원답변대상자료 목록.xlsx")
.worksheet(0);
List<Styler> headerStylers = CmmnUtil.makeHeadersByDiffrentWidths(widths, xlsx);
CellStyle numeric = xlsx.n_nn0();
xlsx.cell(0, 0)
.value("민원답변대상자료 목록", XLSWriter.Styler.CENTER)
.merge(0, titles.size()-1)
.cell(3, 0)
.rowValues(CmmnUtil.mergeListByIndex(titles, headerStylers));
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> {
switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO";
case "신고자": return "CVLCPT_APLCNT_NM";
case "담당자" : return "CVLCPT_PRCS_PIC_NM";
case "담당자전화번호": return "CVLCPT_PRCS_PIC_TELNO";
case "접수일자": return xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD")));
case "처리기한": return xlsx.format(o -> xlsx.str2datetime(o.get("CVLCPT_PRCS_PRNMNT_DT")));
case "위반일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM")));
case "위반내용": return "VLTN_ARTCL";
case "차량번호": return "VHRNO";
case "서손/계고사유": return "LEVY_EXCL_RSN_NM";
case "특기사항": return "ETC_CN";
}
return "";
};
xlsx.cell(4, 0)
.values(list, titles.stream().map((item) -> { return getValue.apply(item, null); }).toArray());
return new ModelAndView("xlsView").addObject("xls", xlsx);
}
return setCollectionInfo(new ModelAndView("jsonView"), crdnCvlcptService.getCivilComplaintList(query), ""); return setCollectionInfo(new ModelAndView("jsonView"), crdnCvlcptService.getCivilComplaintList(query), "");
} }

@ -1,20 +1,27 @@
package cokr.xit.fims.cvlc.web; package cokr.xit.fims.cvlc.web;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.BiFunction;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.poi.ss.usermodel.CellStyle;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.xls.XLSWriter;
import cokr.xit.base.file.xls.XLSWriter.Styler;
import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
import cokr.xit.foundation.data.DataObject;
/** .<br /> /** .<br />
* { }/cvlc/cvlc03 . * { }/cvlc/cvlc03 .
@ -70,6 +77,61 @@ public class Cvlc03Controller extends ApplicationController {
String sggCd = globalStngMapper.selectSggCd(curDeptCode); String sggCd = globalStngMapper.selectSggCd(curDeptCode);
query.setSggCd(sggCd); query.setSggCd(sggCd);
if("xls".equals(query.getDownload())) {
String[] excelTitle = query.getExcelTitle();
List<String> titles = new ArrayList<String>();
for(int i = 0; i < excelTitle.length; i++) {
String item = excelTitle[i];
titles.add(item);
}
int[] excelTitleWidth = query.getExcelTitleWidth();
List<Integer> widths = new ArrayList<>();
for(int i = 0; i < excelTitleWidth.length; i++) {
int item = excelTitleWidth[i];
widths.add(item);
}
XLSWriter xlsx = new XLSWriter()
.setFilename("민원자료 목록.xlsx")
.worksheet(0);
List<Styler> headerStylers = CmmnUtil.makeHeadersByDiffrentWidths(widths, xlsx);
CellStyle numeric = xlsx.n_nn0();
xlsx.cell(0, 0)
.value("민원자료 목록", XLSWriter.Styler.CENTER)
.merge(0, titles.size()-1)
.cell(3, 0)
.rowValues(CmmnUtil.mergeListByIndex(titles, headerStylers));
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> {
switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO";
case "등록구분": return "CRDN_REG_SE_NM";
case "신고자": return "CVLCPT_APLCNT_NM";
case "담당자" : return "CVLCPT_PRCS_PIC_NM";
case "담당자전화번호": return "CVLCPT_PRCS_PIC_TELNO";
case "접수일자": return xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD")));
case "처리기한": return xlsx.format(o -> xlsx.str2datetime(o.get("CVLCPT_PRCS_PRNMNT_DT")));
case "위반일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM")));
case "위반내용": return "VLTN_ARTCL";
case "차량번호": return "VHRNO";
case "사진건수": return "ATCH_FILE_CNT";
case "서손/계고사유": return "LEVY_EXCL_RSN_NM";
case "특기사항": return "ETC_CN";
}
return "";
};
xlsx.cell(4, 0)
.values(list, titles.stream().map((item) -> { return getValue.apply(item, null); }).toArray());
return new ModelAndView("xlsView").addObject("xls", xlsx);
}
return setCollectionInfo(new ModelAndView("jsonView"),crdnCvlcptService.getCivilComplaintList(query),""); return setCollectionInfo(new ModelAndView("jsonView"),crdnCvlcptService.getCivilComplaintList(query),"");
} }
} }

@ -74,6 +74,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, C.SGG_CD <!-- 시군구 코드 --> , C.SGG_CD <!-- 시군구 코드 -->
, C.TASK_SE_CD <!-- 업무 구분 코드 --> , C.TASK_SE_CD <!-- 업무 구분 코드 -->
, C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 --> , C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 -->
, GET_CODE_NM('FIM026', C.CRDN_REG_SE_CD) AS CRDN_REG_SE_NM
, C.CRDN_INPT_SE_CD <!-- 단속 입력 구분 코드 --> , C.CRDN_INPT_SE_CD <!-- 단속 입력 구분 코드 -->
, C.LINK_TBL_NM <!-- 연계 테이블 명 --> , C.LINK_TBL_NM <!-- 연계 테이블 명 -->
, C.LINK_ID <!-- 연계 ID --> , C.LINK_ID <!-- 연계 ID -->
@ -147,6 +148,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_TRSM_DT <!-- 민원 전송 일시 --> , CC.CVLCPT_TRSM_DT <!-- 민원 전송 일시 -->
, CC.CVLCPT_TRSM_CD <!-- 민원 전송 코드 --> , CC.CVLCPT_TRSM_CD <!-- 민원 전송 코드 -->
, LE.LEVY_EXCL_RSN_CD <!-- 부과 제외 사유 코드 --> , LE.LEVY_EXCL_RSN_CD <!-- 부과 제외 사유 코드 -->
, GET_CODE_NM('FIM022', LE.LEVY_EXCL_RSN_CD) AS LEVY_EXCL_RSN_NM
, LE.LEVY_EXCL_YMD <!-- 부과 제외 일자 --> , LE.LEVY_EXCL_YMD <!-- 부과 제외 일자 -->
, LE.ETC_CN AS LEVY_EXCL_ETC_CN <!-- 부과 제외 기타 내용 --> , LE.ETC_CN AS LEVY_EXCL_ETC_CN <!-- 부과 제외 기타 내용 -->
, C.DEL_YN , C.DEL_YN
@ -219,6 +221,7 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT('%',
<include refid="utility.paging-prefix"/> <include refid="utility.paging-prefix"/>
SELECT C.CRDN_ID <!-- 단속 ID --> SELECT C.CRDN_ID <!-- 단속 ID -->
, C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 --> , C.CRDN_REG_SE_CD <!-- 단속 등록 구분 코드 -->
, GET_CODE_NM('FIM026', C.CRDN_REG_SE_CD) AS CRDN_REG_SE_NM
, CC.CVLCPT_APLCNT_NM <!-- 민원 신청인 명 --> , CC.CVLCPT_APLCNT_NM <!-- 민원 신청인 명 -->
, CC.CVLCPT_PRCS_PIC_NM <!-- 민원 처리 담당자 명 --> , CC.CVLCPT_PRCS_PIC_NM <!-- 민원 처리 담당자 명 -->
, (SELECT TELNO , (SELECT TELNO
@ -417,6 +420,7 @@ SELECT C.CRDN_ID <!-- 단속 ID -->
, CC.CVLCPT_LIST_NO <!-- 민원 목록 번호 --> , CC.CVLCPT_LIST_NO <!-- 민원 목록 번호 -->
, C.VHRNO <!-- 차량번호 --> , C.VHRNO <!-- 차량번호 -->
, LE.LEVY_EXCL_RSN_CD <!-- 부과 제외 사유 코드 --> , LE.LEVY_EXCL_RSN_CD <!-- 부과 제외 사유 코드 -->
, GET_CODE_NM('FIM022', LE.LEVY_EXCL_RSN_CD) AS LEVY_EXCL_RSN_NM
, C.ETC_CN <!-- 기타 내용 --> , C.ETC_CN <!-- 기타 내용 -->
, (CASE , (CASE
WHEN C.CRDN_ID IN (SELECT DISTINCT(A.BFR_CRDN_ID) FROM TB_CRDN A WHERE A.DEL_YN = 'N' AND A.CRDN_REG_SE_CD = '04') WHEN C.CRDN_ID IN (SELECT DISTINCT(A.BFR_CRDN_ID) FROM TB_CRDN A WHERE A.DEL_YN = 'N' AND A.CRDN_REG_SE_CD = '04')

@ -621,6 +621,19 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var headerInfo = $("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").getHeaderInfo();
$P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
$P.crdnControl.download();
});
$("#btnHold--${pageName}").on("click", () => $P.fnHold()); $("#btnHold--${pageName}").on("click", () => $P.fnHold());
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove());
$("#btnDeleteSameRcptYmd--${pageName}").on("click", () => $P.fnRemoveSameRcptYmd()); $("#btnDeleteSameRcptYmd--${pageName}").on("click", () => $P.fnRemoveSameRcptYmd());

@ -649,6 +649,18 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var headerInfo = $("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)").getHeaderInfo();
$P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
$P.crdnControl.download();
});
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());
$("#btnOpenAnswerPreview--${pageName}").on("click", () => $P.fnOpenAnswerPreview()); $("#btnOpenAnswerPreview--${pageName}").on("click", () => $P.fnOpenAnswerPreview());
$("#btnExecuteAnswer--${pageName}").on("click", () => $P.fnExecuteAnswer()); $("#btnExecuteAnswer--${pageName}").on("click", () => $P.fnExecuteAnswer());

@ -525,6 +525,18 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var headerInfo = $("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").getHeaderInfo();
$P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
$P.crdnControl.download();
});
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove());
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());

Loading…
Cancel
Save