통합조회 엑셀저장 추가

main
이범준 11 months ago
parent 68fe09fd26
commit 836c55370c

@ -123,7 +123,7 @@ public class Crdn02Controller extends ApplicationController {
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0)); List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "단속일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))); case "단속일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM")));
case "자료출처": return "CRDN_INPT_SE_NM"; case "자료출처": return "CRDN_INPT_SE_NM";

@ -109,7 +109,7 @@ public class Crdn03Controller extends ApplicationController {
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0)); List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "자료출처": return "CRDN_INPT_SE_NM"; case "자료출처": return "CRDN_INPT_SE_NM";
case "위반일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))); case "위반일시": return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM")));

@ -116,7 +116,7 @@ public class Crdn06Controller extends ApplicationController {
List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0)); List<DataObject> list = crdnService.getCrackdownList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "자료출처": return "CRDN_INPT_SE_NM"; case "자료출처": return "CRDN_INPT_SE_NM";
case "차량번호": return "VHRNO"; case "차량번호": return "VHRNO";

@ -106,7 +106,7 @@ public class Crdn08Controller extends ApplicationController {
List<DataObject> list = crdnStngService.getExemptionVehicleList(query.setFetchSize(0)); List<DataObject> list = crdnStngService.getExemptionVehicleList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "차량번호": return "VHRNO"; case "차량번호": return "VHRNO";
case "사유": return "EXMPTN_RSN"; case "사유": return "EXMPTN_RSN";

@ -126,7 +126,7 @@ public class Cvlc01Controller extends ApplicationController {
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0)); List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO"; case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO"; case "목록번호": return "CVLCPT_LIST_NO";

@ -115,7 +115,7 @@ public class Cvlc02Controller extends ApplicationController {
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0)); List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO"; case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO"; case "목록번호": return "CVLCPT_LIST_NO";

@ -106,7 +106,7 @@ public class Cvlc03Controller extends ApplicationController {
List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0)); List<DataObject> list = crdnCvlcptService.getCivilComplaintList(query.setFetchSize(0));
BiFunction<String, String, ?> getValue = (titleNm, noting) -> { BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) { switch(titleNm) {
case "접수번호": return "CVLCPT_RCPT_NO"; case "접수번호": return "CVLCPT_RCPT_NO";
case "목록번호": return "CVLCPT_LIST_NO"; case "목록번호": return "CVLCPT_LIST_NO";

@ -25,6 +25,7 @@ public class SprtQuery extends CmmnQuery {
private List<Keyword> ischKeywordSet; // 통합조회 키워드 private List<Keyword> ischKeywordSet; // 통합조회 키워드
private List<String> ischOnlyDataSet; // 특정자료만 조회 private List<String> ischOnlyDataSet; // 특정자료만 조회
private List<String> ischExclDataSet; // 특정자료 제외 private List<String> ischExclDataSet; // 특정자료 제외
private String gridType;
private String vhrno; // 차량번호 private String vhrno; // 차량번호
private String rtpyrNo; // 납부자 번호 private String rtpyrNo; // 납부자 번호
@ -157,6 +158,16 @@ public class SprtQuery extends CmmnQuery {
return self(); return self();
} }
public String getGridType() {
return ifEmpty(gridType, () -> null);
}
public <T extends SprtQuery> T setGridType(String gridType) {
this.gridType = gridType;
return self();
}
public String getVhrno() { public String getVhrno() {
return ifEmpty(vhrno, () -> null); return ifEmpty(vhrno, () -> null);
} }

@ -5,18 +5,23 @@ import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
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.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
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;
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.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.sprt.Keyword; import cokr.xit.fims.sprt.Keyword;
@ -148,14 +153,107 @@ public class Sprt01Controller extends ApplicationController {
this.makeIntegrationSearchQuery(query, req); this.makeIntegrationSearchQuery(query, req);
List<DataObject> list = null; List<DataObject> list = sprt01Service.getIntegrationDataList(query);
list = sprt01Service.getIntegrationDataList(query);
List<DataObject> upList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("N")).toList(); List<DataObject> upList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("N")).toList();
List<DataObject> downList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("Y")).toList(); List<DataObject> downList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("Y")).toList();
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);
}
String fileName = "통합조회자료 목록";
List<DataObject> listForExcel;
if(ifEmpty(query.getGridType(), () -> "").equals("up")) {
fileName += "(미납자료)";
listForExcel = upList;
} else if(ifEmpty(query.getGridType(), () -> "").equals("down")) {
fileName += "(수납,기타)";
listForExcel = downList;
} else {
listForExcel = list;
}
XLSWriter xlsx = new XLSWriter()
.setFilename(fileName+".xlsx")
.worksheet(0);
List<Styler> headerStylers = CmmnUtil.makeHeadersByDiffrentWidths(widths, xlsx);
CellStyle numeric = xlsx.n_nn0();
xlsx.cell(0, 0)
.value(fileName, XLSWriter.Styler.CENTER)
.merge(0, titles.size()-1)
.cell(3, 0)
.rowValues(CmmnUtil.mergeListByIndex(titles, headerStylers));
BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
switch(titleNm) {
case "시군구명": return "SGG_NM";
case "과태료명": return "TASK_SE_NM";
case "단속입력구분": return "CRDN_INPT_SE_NM";
case "단속일시": return "CRDN_YMD_TM";
case "신고자명": return "CVLCPT_APLCNT_NM";
case "민원접수번호": return "CVLCPT_RCPT_NO";
case "민원접수일자": return xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD")));
case "민원목록번호": return "CVLCPT_LIST_NO";
case "단속차량번호": return "VHRNO";
case "대체차량번호": return "RPM_SZR_VHRNO";
case "사진건수": return "ATCH_FILE_CNT";
case "차량확인": return "PARKNG_PSBLTY_RSLT_NM";
case "납부자명": return "RTPYR_NM";
case "납부자번호": return "RTPYR_NO";
case "처리상태": return "CRDN_STTS_NM";
case "제외사유": return "LEVY_EXCL_RSN_NM";
case "제외일자": return xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD")));
case "기타사항": return "ETC_CN";
case "고지번호": return "GOJI_NO";
case "처리일자": return xlsx.format(o -> xlsx.str2date(o.get("CRDN_STTS_CHG_YMD")));
case "단속장소": return "CRDN_PLC";
case "단속구분": return "CRDN_SE_NM";
case "의견진술여부": return "OPNN_SBMSN_YN_NM";
case "의견진술기한": return xlsx.format(o -> xlsx.str2date(o.get("ADVNTCE_DUDT_YMD")));
case "견인여부": return "TOWNG_YN_NM";
case "압류일자": return xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD")));
case "압류해제일자": return xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD")));
case "잔액": return xlsx.style("SUM_AMT", numeric);
case "부과금액": return xlsx.style("LEVY_AMT", numeric);
case "본세": return xlsx.style("LEVY_PCPTAX", numeric);
case "가산금": return xlsx.style("LEVY_ADAMT", numeric);
case "납부기한": return xlsx.format(o -> xlsx.str2date(o.get("DUDT_YMD")));
case "납기후일자": return xlsx.format(o -> xlsx.str2date(o.get("DUDT_AFTR_YMD")));
case "납기후금액": return xlsx.style("DUDT_AFTR_AMT", numeric);
case "가상계좌번호": return "VR_ACTNO";
case "전자납부번호": return "EPAYNO";
case "수납유형": return "PAY_MTHD_SE_NM";
case "수납일자": return xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD")));
case "수납금액": return xlsx.style("RCVMT_AMT", numeric);
case "수납본세": return xlsx.style("RCVMT_PCPTAX", numeric);
case "수납가산금": return xlsx.style("RCVMT_ADAMT", numeric);
case "단속등록구분": return "CRDN_REG_SE_NM";
case "납부자주소": return "RTPYR_FULL_ADDR";
case "거주상태": return "RTPYR_STTS_NM";
}
return "";
};
xlsx.cell(4, 0)
.values(listForExcel, titles.stream().map((item) -> { return getValue.apply(item, null); }).toArray());
return new ModelAndView("xlsView").addObject("xls", xlsx);
}
mav.addObject("upList", upList); mav.addObject("upList", upList);
mav.addObject("downList", downList); mav.addObject("downList", downList);
return mav; return mav;
} }

@ -297,7 +297,30 @@ integrationSearch.renderList = (updown, tabGroup) => {
// 엑셀 // 엑셀
integrationSearch.fnExcel = (updown) => { integrationSearch.fnExcel = (updown) => {
var headerInfo;
if(updown == "up"){
if(integrationSearchControl.updataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
headerInfo = $("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").getHeaderInfo();
integrationSearchControl.query.gridType = "up";
} else {
if(integrationSearchControl.downdataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
headerInfo = $("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").getHeaderInfo();
integrationSearchControl.query.gridType = "down";
}
integrationSearchControl.query.excelTitle = headerInfo.excelTitle;
integrationSearchControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
integrationSearchControl.download();
} }
//납부자번호 복사 //납부자번호 복사

Loading…
Cancel
Save