|
|
|
@ -3,9 +3,9 @@ package cokr.xit.fims.sprt.web;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Enumeration;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
@ -15,8 +15,11 @@ import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.code.CommonCode;
|
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter;
|
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.CellDef;
|
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.Styler;
|
|
|
|
|
import cokr.xit.base.user.ManagedUser;
|
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
@ -158,19 +161,7 @@ public class Sprt01Controller extends ApplicationController {
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
ArrayList<CellDef> cellDefs = fromJson(query.getCellDefs(), new TypeReference<ArrayList<CellDef>>() {});
|
|
|
|
|
|
|
|
|
|
String fileName = "통합조회자료 목록";
|
|
|
|
|
List<DataObject> listForExcel;
|
|
|
|
@ -187,75 +178,70 @@ public class Sprt01Controller extends ApplicationController {
|
|
|
|
|
XLSWriter xlsx = new XLSWriter()
|
|
|
|
|
.setFilename(fileName+".xlsx")
|
|
|
|
|
.worksheet(0);
|
|
|
|
|
List<Styler> headerStylers = CmmnUtil.makeHeadersByDiffrentWidths(widths, xlsx);
|
|
|
|
|
|
|
|
|
|
CellStyle center = xlsx.cellStyle(Styler.CENTER);
|
|
|
|
|
CellStyle numeric = xlsx.n_nn0();
|
|
|
|
|
CellStyle dateYMD = xlsx.yyyy_mm_dd();
|
|
|
|
|
CellStyle dateDT = xlsx.yyyy_mm_dd_hh_mm_ss();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> valueMap = new HashMap<String, Object>();
|
|
|
|
|
valueMap.put("시군구명" , xlsx.style("SGG_NM", center));
|
|
|
|
|
valueMap.put("과태료명" , xlsx.style("TASK_SE_NM", center));
|
|
|
|
|
valueMap.put("단속입력구분" , xlsx.style("CRDN_INPT_SE_NM", center));
|
|
|
|
|
valueMap.put("단속일시" , xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT));
|
|
|
|
|
valueMap.put("신고자명" , xlsx.style("CVLCPT_APLCNT_NM", center));
|
|
|
|
|
valueMap.put("민원접수번호" , xlsx.style("CVLCPT_RCPT_NO", center));
|
|
|
|
|
valueMap.put("민원접수일자" , xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("민원목록번호" , xlsx.style("CVLCPT_LIST_NO", center));
|
|
|
|
|
valueMap.put("단속차량번호" , "VHRNO");
|
|
|
|
|
valueMap.put("대체차량번호" , "RPM_SZR_VHRNO");
|
|
|
|
|
valueMap.put("사진건수" , xlsx.style("ATCH_FILE_CNT", center));
|
|
|
|
|
valueMap.put("차량확인" , xlsx.style("PARKNG_PSBLTY_RSLT_NM", center));
|
|
|
|
|
valueMap.put("납부자명" , xlsx.style("RTPYR_NM", center));
|
|
|
|
|
valueMap.put("납부자번호" , xlsx.style("RTPYR_NO", center));
|
|
|
|
|
valueMap.put("처리상태" , xlsx.style("CRDN_STTS_NM", center));
|
|
|
|
|
valueMap.put("제외사유" , "LEVY_EXCL_RSN_NM");
|
|
|
|
|
valueMap.put("제외일자" , xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("기타사항" , "ETC_CN");
|
|
|
|
|
valueMap.put("고지번호" , xlsx.style("GOJI_NO", center));
|
|
|
|
|
valueMap.put("처리일자" , xlsx.format(o -> xlsx.str2date(o.get("CRDN_STTS_CHG_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("단속장소" , "CRDN_PLC");
|
|
|
|
|
valueMap.put("단속구분" , xlsx.style("CRDN_SE_NM", center));
|
|
|
|
|
valueMap.put("의견진술여부" , xlsx.style("OPNN_SBMSN_YN_NM", center));
|
|
|
|
|
valueMap.put("의견진술기한" , xlsx.format(o -> xlsx.str2date(o.get("ADVNTCE_DUDT_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("견인여부" , xlsx.style("TOWNG_YN_NM", center));
|
|
|
|
|
valueMap.put("압류일자" , xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("압류해제일자" , xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("잔액" , xlsx.style("SUM_AMT", numeric));
|
|
|
|
|
valueMap.put("부과금액" , xlsx.style("LEVY_AMT", numeric));
|
|
|
|
|
valueMap.put("본세" , xlsx.style("LEVY_PCPTAX", numeric));
|
|
|
|
|
valueMap.put("가산금" , xlsx.style("LEVY_ADAMT", numeric));
|
|
|
|
|
valueMap.put("납부기한" , xlsx.format(o -> xlsx.str2date(o.get("DUDT_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("납기후일자" , xlsx.format(o -> xlsx.str2date(o.get("DUDT_AFTR_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("납기후금액" , xlsx.style("DUDT_AFTR_AMT", numeric));
|
|
|
|
|
valueMap.put("가상계좌번호" , xlsx.style("VR_ACTNO", center));
|
|
|
|
|
valueMap.put("전자납부번호" , xlsx.style("EPAYNO", center));
|
|
|
|
|
valueMap.put("수납유형" , xlsx.style("PAY_MTHD_SE_NM", center));
|
|
|
|
|
valueMap.put("수납일자" , xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD"))).style(dateYMD));
|
|
|
|
|
valueMap.put("수납금액" , xlsx.style("RCVMT_AMT", numeric));
|
|
|
|
|
valueMap.put("수납본세" , xlsx.style("RCVMT_PCPTAX", numeric));
|
|
|
|
|
valueMap.put("수납가산금" , xlsx.style("RCVMT_ADAMT", numeric));
|
|
|
|
|
valueMap.put("단속등록구분" , xlsx.style("CRDN_REG_SE_NM", center));
|
|
|
|
|
valueMap.put("납부자주소" , "RTPYR_FULL_ADDR");
|
|
|
|
|
valueMap.put("거주상태" , xlsx.style("RTPYR_STTS_NM", center));
|
|
|
|
|
valueMap.put("차량번호", "VHRNO");
|
|
|
|
|
valueMap.put("성명", "RTPYR_NM");
|
|
|
|
|
valueMap.put("주소", "RTPYR_ADDR");
|
|
|
|
|
valueMap.put("번지", "RTPYR_DTL_ADDR");
|
|
|
|
|
CellDef.setValues(cellDefs, valueMap);
|
|
|
|
|
|
|
|
|
|
xlsx.cell(0, 0)
|
|
|
|
|
.value(fileName, center)
|
|
|
|
|
.merge(0, titles.size()-1)
|
|
|
|
|
.merge(0, cellDefs.size()-1)
|
|
|
|
|
.cell(3, 0)
|
|
|
|
|
.rowValues(CmmnUtil.mergeListByIndex(titles, headerStylers));
|
|
|
|
|
|
|
|
|
|
BiFunction<String, String, ?> getValue = (titleNm, nothing) -> {
|
|
|
|
|
switch(titleNm) {
|
|
|
|
|
case "시군구명" : return xlsx.style("SGG_NM", center);
|
|
|
|
|
case "과태료명" : return xlsx.style("TASK_SE_NM", center);
|
|
|
|
|
case "단속입력구분" : return xlsx.style("CRDN_INPT_SE_NM", center);
|
|
|
|
|
case "단속일시" : return xlsx.format(o -> xlsx.str2datetime(o.get("CRDN_YMD_TM"))).style(dateDT);
|
|
|
|
|
case "신고자명" : return xlsx.style("CVLCPT_APLCNT_NM", center);
|
|
|
|
|
case "민원접수번호" : return xlsx.style("CVLCPT_RCPT_NO", center);
|
|
|
|
|
case "민원접수일자" : return xlsx.format(o -> xlsx.str2date(o.get("CVLCPT_RCPT_YMD"))).style(dateYMD);
|
|
|
|
|
case "민원목록번호" : return xlsx.style("CVLCPT_LIST_NO", center);
|
|
|
|
|
case "단속차량번호" : return "VHRNO";
|
|
|
|
|
case "대체차량번호" : return "RPM_SZR_VHRNO";
|
|
|
|
|
case "사진건수" : return xlsx.style("ATCH_FILE_CNT", center);
|
|
|
|
|
case "차량확인" : return xlsx.style("PARKNG_PSBLTY_RSLT_NM", center);
|
|
|
|
|
case "납부자명" : return xlsx.style("RTPYR_NM", center);
|
|
|
|
|
case "납부자번호" : return xlsx.style("RTPYR_NO", center);
|
|
|
|
|
case "처리상태" : return xlsx.style("CRDN_STTS_NM", center);
|
|
|
|
|
case "제외사유" : return "LEVY_EXCL_RSN_NM";
|
|
|
|
|
case "제외일자" : return xlsx.format(o -> xlsx.str2date(o.get("LEVY_EXCL_YMD"))).style(dateYMD);
|
|
|
|
|
case "기타사항" : return "ETC_CN";
|
|
|
|
|
case "고지번호" : return xlsx.style("GOJI_NO", center);
|
|
|
|
|
case "처리일자" : return xlsx.format(o -> xlsx.str2date(o.get("CRDN_STTS_CHG_YMD"))).style(dateYMD);
|
|
|
|
|
case "단속장소" : return "CRDN_PLC";
|
|
|
|
|
case "단속구분" : return xlsx.style("CRDN_SE_NM", center);
|
|
|
|
|
case "의견진술여부" : return xlsx.style("OPNN_SBMSN_YN_NM", center);
|
|
|
|
|
case "의견진술기한" : return xlsx.format(o -> xlsx.str2date(o.get("ADVNTCE_DUDT_YMD"))).style(dateYMD);
|
|
|
|
|
case "견인여부" : return xlsx.style("TOWNG_YN_NM", center);
|
|
|
|
|
case "압류일자" : return xlsx.format(o -> xlsx.str2date(o.get("SZR_YMD"))).style(dateYMD);
|
|
|
|
|
case "압류해제일자" : return xlsx.format(o -> xlsx.str2date(o.get("SZR_RMV_YMD"))).style(dateYMD);
|
|
|
|
|
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"))).style(dateYMD);
|
|
|
|
|
case "납기후일자" : return xlsx.format(o -> xlsx.str2date(o.get("DUDT_AFTR_YMD"))).style(dateYMD);
|
|
|
|
|
case "납기후금액" : return xlsx.style("DUDT_AFTR_AMT", numeric);
|
|
|
|
|
case "가상계좌번호" : return xlsx.style("VR_ACTNO", center);
|
|
|
|
|
case "전자납부번호" : return xlsx.style("EPAYNO", center);
|
|
|
|
|
case "수납유형" : return xlsx.style("PAY_MTHD_SE_NM", center);
|
|
|
|
|
case "수납일자" : return xlsx.format(o -> xlsx.str2date(o.get("RCVMT_YMD"))).style(dateYMD);
|
|
|
|
|
case "수납금액" : return xlsx.style("RCVMT_AMT", numeric);
|
|
|
|
|
case "수납본세" : return xlsx.style("RCVMT_PCPTAX", numeric);
|
|
|
|
|
case "수납가산금" : return xlsx.style("RCVMT_ADAMT", numeric);
|
|
|
|
|
case "단속등록구분" : return xlsx.style("CRDN_REG_SE_NM", center);
|
|
|
|
|
case "납부자주소" : return "RTPYR_FULL_ADDR";
|
|
|
|
|
case "거주상태" : return xlsx.style("RTPYR_STTS_NM", center);
|
|
|
|
|
|
|
|
|
|
case "차량번호": return "VHRNO";
|
|
|
|
|
case "성명": return "RTPYR_NM";
|
|
|
|
|
case "주소": return "RTPYR_ADDR";
|
|
|
|
|
case "번지": return "RTPYR_DTL_ADDR";
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
xlsx.cell(4, 0)
|
|
|
|
|
.values(listForExcel, titles.stream().map((item) -> { return getValue.apply(item, null); }).toArray());
|
|
|
|
|
.rowValues(CellDef.header(cellDefs, () -> CmmnUtil.headerStyle(xlsx)))
|
|
|
|
|
.cell(4, 0)
|
|
|
|
|
.values(listForExcel, CellDef.values(cellDefs));
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("xlsView").addObject("xls", xlsx);
|
|
|
|
|
}
|
|
|
|
|