|
|
@ -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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|