|
|
|
@ -4,11 +4,13 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
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.Relation;
|
|
|
|
|
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.dao.UserMapper;
|
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
@ -92,6 +97,60 @@ public class Cvlc01Controller extends ApplicationController {
|
|
|
|
|
String sggCd = globalStngMapper.selectSggCd(curDeptCode);
|
|
|
|
|
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),"");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|